diff options
| author | Doug Barton <dougb@FreeBSD.org> | 2001-04-15 20:43:49 +0000 |
|---|---|---|
| committer | Doug Barton <dougb@FreeBSD.org> | 2001-04-15 20:43:49 +0000 |
| commit | cf6490c9c76cb48a3f52da8933e35710cfdf10fc (patch) | |
| tree | e623a66beef62d6bb76942db634ee3b88bd46403 /usr.sbin/adduser | |
| parent | f756964985614a58e6242e79cbf84be5c6c6403a (diff) | |
Notes
Diffstat (limited to 'usr.sbin/adduser')
| -rw-r--r-- | usr.sbin/adduser/rmuser.perl | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/usr.sbin/adduser/rmuser.perl b/usr.sbin/adduser/rmuser.perl index 96a4ed1f5e0d..07ba499e0a78 100644 --- a/usr.sbin/adduser/rmuser.perl +++ b/usr.sbin/adduser/rmuser.perl @@ -317,11 +317,22 @@ sub update_passwd_file { print STDERR "\n${whoami}: Warning: couldn't set mode of $new_passwd_file to 0600 ($!)\n\tcontinuing, but please check mode of /etc/master.passwd!\n"; $skipped = 0; while (<MASTER_PW>) { - if (not /^\Q$login_name:/o) { - print NEW_PW; - } else { + if (/^\Q$login_name:/o) { print STDERR "Dropped entry for $login_name\n" if $debug; $skipped = 1; + } else { + print NEW_PW; + # The other perl password tools assume all lowercase entries. + # Add a warning to help unsuspecting admins who might be + # using the wrong tool for the job, or might otherwise + # be unwittingly holding a loaded foot-shooting device. + if (/^\Q$login_name:/io) { + my $name = $_; + $name =~ s#\:.*\n##; + print STDERR "\n\n\tThere is also an entry for $name in your", + "password file.\n\tThis can cause problems in some ", + "situations.\n\n"; + } } } close(NEW_PW); |
