1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Keep similar things together: Check for too long usernames

inside the function that verifies username validity.
This commit is contained in:
Yaroslav Tykhiy 2002-01-28 17:59:09 +00:00
parent 76ed1f96fd
commit 8335d0edc2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89926

View File

@ -317,10 +317,6 @@ sub new_users_name {
while(1) {
$name = &confirm_list("Enter username", 1, $usernameregexp, "");
if (length($name) > 16) {
warn "Username is longer than 16 chars\a\n";
next;
}
last if (&new_users_name_valid($name));
}
return $name;
@ -332,6 +328,9 @@ sub new_users_name_valid {
if ($name eq $usernameregexp) { # user/admin just pressed <Return>
warn "Please enter a username\a\n";
return 0;
} elsif (length($name) > 16) {
warn "Username is longer than 16 characters.\a\n";
return 0;
} elsif ($name =~ /[:\n]/) {
warn "Username cannot contain colon or newline characters.\a\n";
return 0;