summaryrefslogtreecommitdiffstats
path: root/adduser/adduser.perl
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>1996-12-29 21:56:31 +0000
committerWolfram Schneider <wosch@FreeBSD.org>1996-12-29 21:56:31 +0000
commit25f63f421b80bfa998fecaa48de5b964c67f511d (patch)
treee030f96ad03a8058d27d6c3ff041e295cc742525 /adduser/adduser.perl
parentcedac7220acc2b9c0720e5927a22008dabccf619 (diff)
downloadpw-darwin-25f63f421b80bfa998fecaa48de5b964c67f511d.tar.gz
pw-darwin-25f63f421b80bfa998fecaa48de5b964c67f511d.tar.zst
pw-darwin-25f63f421b80bfa998fecaa48de5b964c67f511d.zip
Allow dash `-' (except for first char) and underscore `_' in usernames.
pointed out by: max
Diffstat (limited to 'adduser/adduser.perl')
-rw-r--r--adduser/adduser.perl6
1 files changed, 3 insertions, 3 deletions
diff --git a/adduser/adduser.perl b/adduser/adduser.perl
index 98ed4a5..42a1c5e 100644
--- a/adduser/adduser.perl
+++ b/adduser/adduser.perl
@@ -24,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: adduser.perl,v 1.23 1996/12/23 00:10:19 mpp Exp $
+# $Id: adduser.perl,v 1.24 1996/12/29 15:06:52 wosch Exp $
# read variables
@@ -307,7 +307,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) > 16) {
warn "Username is longer than 16 chars\a\n";
next;
@@ -320,7 +320,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_\-]*$/) {
warn "Wrong username. " .
"Please use only lowercase characters or digits\a\n";
return 0;