summaryrefslogtreecommitdiffstats
path: root/usr.sbin/adduser/adduser.perl
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1996-12-29 21:56:31 +0000
committerwosch <wosch@FreeBSD.org>1996-12-29 21:56:31 +0000
commit61d66dc5401e2febc66f9ab28bb96ef22359afbb (patch)
treef02a514394e010e20e2e90bf98e2dc9ae8201b59 /usr.sbin/adduser/adduser.perl
parentbeaf8b0d57fe60ba0cee4882734bea828681d809 (diff)
downloadFreeBSD-src-61d66dc5401e2febc66f9ab28bb96ef22359afbb.zip
FreeBSD-src-61d66dc5401e2febc66f9ab28bb96ef22359afbb.tar.gz
Allow dash `-' (except for first char) and underscore `_' in usernames.
pointed out by: max
Diffstat (limited to 'usr.sbin/adduser/adduser.perl')
-rw-r--r--usr.sbin/adduser/adduser.perl6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl
index 98ed4a5..42a1c5e 100644
--- a/usr.sbin/adduser/adduser.perl
+++ b/usr.sbin/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;
OpenPOWER on IntegriCloud