From 556b4b94e14597c39f72aff865eb25ad50a274f1 Mon Sep 17 00:00:00 2001 From: yar Date: Wed, 2 Jan 2002 15:49:49 +0000 Subject: Forbid adding duplicate users with the name of "0". Previously, it was possible due to 0 and "0" being equivalent in Perl. --- usr.sbin/adduser/adduser.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl index 8e54d09..421cf02 100644 --- a/usr.sbin/adduser/adduser.perl +++ b/usr.sbin/adduser/adduser.perl @@ -319,7 +319,7 @@ sub new_users_name { warn "Username is longer than 16 chars\a\n"; next; } - last if (&new_users_name_valid($name) eq $name); + last if (&new_users_name_valid($name)); } return $name; } @@ -334,7 +334,7 @@ sub new_users_name_valid { } elsif ($username{$name}) { warn "Username ``$name'' already exists!\a\n"; return 0; } - return $name; + return 1; } # return full name -- cgit v1.1