From nobody@FreeBSD.org  Fri Oct  4 16:40:26 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 93E5D37B401
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  4 Oct 2002 16:40:26 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3283943E6A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  4 Oct 2002 16:40:26 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g94NeP7R078700
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 4 Oct 2002 16:40:25 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.6/8.12.6/Submit) id g94NePMw078699;
	Fri, 4 Oct 2002 16:40:25 -0700 (PDT)
Message-Id: <200210042340.g94NePMw078699@www.freebsd.org>
Date: Fri, 4 Oct 2002 16:40:25 -0700 (PDT)
From: p01nt3r <p01nt3r@sp00fed.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Bug in /usr/sbin/adduser
X-Send-Pr-Version: www-1.0

>Number:         43677
>Category:       misc
>Synopsis:       Bug in /usr/sbin/adduser
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 04 16:50:01 PDT 2002
>Closed-Date:    Wed Nov 20 04:08:55 PST 2002
>Last-Modified:  Wed Nov 20 04:08:55 PST 2002
>Originator:     p01nt3r
>Release:        FreeBSD 4.6.2 Release
>Organization:
Home
>Environment:
FreeBSD 4.6.2-RELEASE #0: Tue Oct 1 13:20:27 EEST 2002 root@:/usr/obj/usr/src/sys/GENERIC i386
>Description:
      When requested to enter username second time(such as Enter username[test]: ) - It just print
a message "Please enter a username". And it's looped.
>How-To-Repeat:
Just run the adduser, and add some user (test, for example).
After "Ok, Let's go!", when it requested "Enter username [test]:"
press the Enter, or type "test", and press the Enter.
>Fix:
      In the /usr/sbin/adduser program, in &new_users_name_valid
subprogram:
replace "if ($name eq $usernameregexp)
{ print "Please enter a username\a\n"; exit 0; }" to
"if ($name ne $usernameregexp)
{ print "Please enter a username\a\n"; exit 0; }"
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: tom 
State-Changed-When: Wed Nov 20 04:07:45 PST 2002 
State-Changed-Why:  
This is not a bug in adduser(8):  you are using the command incorrectly. 
If you see the line: 
"Enter username[test]:" 
you have entered "test" in response to the line: 
"Usernames must match regular expression:" 

Instead of typing "test" as a regular expression, hit return to accept 
the default, or enter ^[a-z0-9_][a-z0-9_-]*$ if your adduser.conf has 
been modified to use "test" as the default regular expression. 

The fix you supplied misunderstands how the command should work - you do 
not "enter username second time", you enter a regular expression that 
valid usernames must match first, then a username later on. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43677 
>Unformatted:
