]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Disallow adding duplicate roots, toors, or other users w/uid 0.
authorYaroslav Tykhiy <ytykhiy@gmail.com>
Mon, 28 Jan 2002 17:30:12 +0000 (17:30 +0000)
committerYaroslav Tykhiy <ytykhiy@gmail.com>
Mon, 28 Jan 2002 17:30:12 +0000 (17:30 +0000)
Previously, a truth check instead if defined() check erroneously
allowed that.

PR: bin/8745

adduser/adduser.perl

index 2728eff8d36f3469225a46cce16a087ca0f9648e..2aa9c319b8775953b191c607d3e4f3e3d5a7ba82 100644 (file)
@@ -345,7 +345,7 @@ sub new_users_name_valid {
            warn "Username doesn't match the regexp /$usernameregexp/\a\n";
        }
        return 0;
-    } elsif ($username{$name}) {
+    } elsif (defined($username{$name})) {
        warn "Username ``$name'' already exists!\a\n"; return 0;
     }
     return 1;