#
# Check root's . files to make sure they are private
#

&pcheck("Dot Files");
$warn = 0;
$fail = 0;

foreach $file (@dot_files) {

	if (-f $file) {

		@perms = &permissions($file);

		if (@perms[4] == 1) {
			&report("WARNING: $file is excutable by group.\n");
			$warn = 1;
		} elsif (@perms[4] == 4) {
			&report("WARNING: $file is readable by group.\n");
			$warn = 1;
		} elsif (@perms[4] == 2) {
			&report("DANGER: $file is WRITABLE by group.\n");
			$fail = 1;
		}
	
		if (@perms[5] == 1) {
			&report("WARNING: $file is excutable by world.\n");
			$warn = 1;
		} elsif (@perms[5] == 4) {
			&report("WARNING: $file is readable by world.\n");
			$warn = 1;
		} elsif (@perms[5] == 2) {
			&report("DANGER: $file is WRITABLE by world.\n");
			$fail = 1;
		}
	}
}


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

exit 0;
