summaryrefslogtreecommitdiff
path: root/usr.sbin/adduser/adduser.perl
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-20 07:20:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-20 07:20:59 +0000
commite0107850bdb2bbd50819542842d7097e863ae468 (patch)
tree719e8fbe362371534c7f2d4b995ad88e059e950a /usr.sbin/adduser/adduser.perl
parent37ab1bd05dc98a75d80f81ba7b39cb546538a97f (diff)
clone freebsd semantics for usernames; noted by abyss@abyss.imaji.net
Diffstat (limited to 'usr.sbin/adduser/adduser.perl')
-rw-r--r--usr.sbin/adduser/adduser.perl8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl
index ec56d432a93..08ac1e026fd 100644
--- a/usr.sbin/adduser/adduser.perl
+++ b/usr.sbin/adduser/adduser.perl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
-# $OpenBSD: adduser.perl,v 1.8 1998/06/03 05:36:57 deraadt Exp $
+# $OpenBSD: adduser.perl,v 1.9 1998/07/20 07:20:58 deraadt Exp $
#
# Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
# All rights reserved.
@@ -350,7 +350,7 @@ sub new_users_name {
local($name);
while(1) {
- $name = &confirm_list("Enter username", 1, "A-Za-z0-9_", "");
+ $name = &confirm_list("Enter username", 1, "a-z0-9_", "");
if (length($name) > 8) {
warn "Username is longer than 8 chars\a\n";
next;
@@ -363,7 +363,7 @@ sub new_users_name {
sub new_users_name_valid {
local($name) = @_;
- if ($name !~ /^[a-z0-9]+$/) {
+ if ($name !~ /^[a-z0-9_][a-z0-9_\-]*$/ || $name eq "a-z0-9_-") {
warn "Wrong username. " .
"Please use only lowercase characters or digits\a\n";
return 0;
@@ -1442,7 +1442,7 @@ sub config_write {
print C <<EOF;
#
-# $OpenBSD: adduser.perl,v 1.8 1998/06/03 05:36:57 deraadt Exp $
+# $OpenBSD: adduser.perl,v 1.9 1998/07/20 07:20:58 deraadt Exp $
# $config - automatic generated by adduser(8)
#
# Note: adduser read *and* write this file.