With procmail, vacation and forward files do not work if the user’s home directory is group writable. Here’s a script that will locate all group writable home directories:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#!/usr/bin/perl my %users; open(P,"/etc/passwd"); while(<p>) { chomp(); my ($uname,$pass,$uid,$gid,$gecos,$home,$shell) = split(/\:/,$_); $users{$uname} = $home; }; close P; LINE: foreach $user (sort keys %users) { $home = $users{$user}; next LINE if ($user eq "dbus"); next LINE if ($user eq "distcache"); next LINE if ($user eq "haldaemon"); next LINE if ($user eq "nobody"); next LINE if ($user eq "rpc"); $test = `find $home -maxdepth 0 -perm -g=w -type d 2>&1`; chomp($test); if ($test ne "") { if ($test =~ /No such file or directory/) { $msg = "NOT FOUND"; } else { print $user . " : " . $home . "\n"; }; }; }; </p> |