#
# Check /usr/adm/*SYSLOG permissions and check for a logger group.
#

&pcheck("System Log Permissions");

foreach $log (@logs) {

	if (-f $log) {

                @perms = &permissions($log);

		if (@perms[1] == "0") {
			&report("WARNING: $log should be owned by a restricted log group.\n");
			$warn = 1;
		}
		if ((@perms[4] == "2")||(@perms[4] == "3")||
				(@perms[4] == "6")||(@perms[4] == "7")) {
			&report("DANGER: $log should not be group WRITABLE.\n");
			$fail = 1;
		}
		if ((@perms[5] == "4")||(@perms[5] == "5")||
				(@perms[5] == "6")||(@perms[5] == "7")) {
			&report("WARNING: $log should not be world readble.\n");
			$warn = 1;
		}
		if ((@perms[5] == "2")||(@perms[5] == "3")||
				(@perms[5] == "6")||(@perms[5] == "7")) {
			&report("DANGER: $log should not be world WRITABLE.\n");
			$fail = 1;
		}
	}
}

if ($fail) {
	&failed;
} elsif ($warn) {
	&warn;
} else {
	&passed;
}

exit 0;
