diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-15 20:52:42 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-15 20:52:42 +0000 |
commit | 249395028cd5152a22beb827afe020a69b842928 (patch) | |
tree | 37e6c7dc6018ad97126653790ba0e2a5eb98b372 /gnu/usr.sbin/sendmail/contrib/passwd-to-alias.pl | |
parent | 22559135ed5223c81e7a49b8726db8ee1927e322 (diff) |
sendmail 8.11.2
Diffstat (limited to 'gnu/usr.sbin/sendmail/contrib/passwd-to-alias.pl')
-rw-r--r-- | gnu/usr.sbin/sendmail/contrib/passwd-to-alias.pl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gnu/usr.sbin/sendmail/contrib/passwd-to-alias.pl b/gnu/usr.sbin/sendmail/contrib/passwd-to-alias.pl index 05a51b93496..24bb7a1c544 100644 --- a/gnu/usr.sbin/sendmail/contrib/passwd-to-alias.pl +++ b/gnu/usr.sbin/sendmail/contrib/passwd-to-alias.pl @@ -8,22 +8,23 @@ print "# Generated from passwd by $0\n"; +$wordpat = '([a-zA-Z]+?[a-zA-Z0-9-]*)?[a-zA-Z0-9]'; # 'DB2' while (@a = getpwent) { ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = @a; ($fullname = $gcos) =~ s/,.*$//; - if (!-d $dir || !-x $shell) { - print "$name: root\n"; + if (!-d $dir || !-x $shell || $shell =~ m!/bin/(false|true)$!) { + print "$name: root\n"; # handle pseudo user } $fullname =~ s/\.*[ _]+\.*/./g; - $fullname =~ tr [εδφΕΔΦι] [aaoAAOe]; # <hakan@af.lu.se> 1997-06-15 - if ($fullname =~ /^[a-zA-Z][a-zA-Z-]+(\.[a-zA-Z][a-zA-Z-]+)+$/) { -# if ($fullname =~ /^[a-zA-Z]+(\.[a-zA-Z]+)+$/) { # Kari E. Hurtta + $fullname =~ tr [εδιφόΕΔΦά] [aaeouAAOU]; # <hakan@af.lu.se> 1997-06-15 + next if (!$fullname || lc($fullname) eq $name); # avoid nonsense + if ($fullname =~ /^$wordpat(\.$wordpat)*$/o) { # Ulrich Windl print "$fullname: $name\n"; } else { - print "# $fullname: $name\n"; + print "# $fullname: $name\n"; # avoid strange names } }; |