From nobody@FreeBSD.org  Sat Jul 31 15:03:32 2004
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 1A45016A4CF
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 31 Jul 2004 15:03:32 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EFEA543D46
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 31 Jul 2004 15:03:31 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i6VF3EDr013667
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 31 Jul 2004 15:03:14 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i6VF3DqE013666;
	Sat, 31 Jul 2004 15:03:13 GMT
	(envelope-from nobody)
Message-Id: <200407311503.i6VF3DqE013666@www.freebsd.org>
Date: Sat, 31 Jul 2004 15:03:13 GMT
From: Weichuan Lin <linweichuan@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: the usename has to be writed as "/****/" by using the adduser
X-Send-Pr-Version: www-2.3
X-GNATS-Notify: vs

>Number:         69846
>Category:       bin
>Synopsis:       the usename has to be writed as "/****/" by using the 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:   Sat Jul 31 15:10:23 GMT 2004
>Closed-Date:    Thu Nov 04 13:56:21 GMT 2004
>Last-Modified:  Thu Nov 04 13:56:21 GMT 2004
>Originator:     Weichuan Lin
>Release:        4.10
>Organization:
Zhejiang University China
>Environment:
FreeBSD Release 4.10      
>Description:
when the root uses the "adduser" to add a new user to system ,  he has to name the user as the format of /username/,or the program  doesn't continue to realy add a user to system. It will tell you  "Please enter a username" and ask you "Enter username" again and again until you add the "/" at both ends of the username you just entered. later you have to login to the system with the username of "/username/".      
>How-To-Repeat:
simply execute the adduser program withou any parameter.
>Fix:
modify the source code of the adduser at the line of 323,the if  sentence like follow
if ($name eq $usernameregexp) 
and rewrite it as follow 
if ($name eq /$usernameregexp/)
then the bug will disappear. 
>Release-Note:
>Audit-Trail:
To me it looks like you somehow entered the username of the new user when in fact
'adduser' was prompting you in it's first-run setup phase for the regex which new
user should match. When you run it the first time, it queries some defaults and only
after you've filled them out, you proceed to the actual setup. See the transcript
below:

Usernames must match regular expression:
[^[a-z0-9_][a-z0-9_-]*$]: foo
Enter your default shell: bash csh date no sh tcsh zsh [bash]:
Your default shell is: bash -> /usr/local/bin/bash
Enter your default HOME partition: [/home]:
Copy dotfiles from: /usr/share/skel no [no]:
Do not copy dotfiles.
Send message from file: /etc/adduser.message no [no]:
Do not send message
Use passwords (y/n) [y]:

Write your changes to /etc/adduser.conf? (y/n) [n]:

Ok, let's go.
Don't worry about mistakes. I will give you the chance later to correct any input.
Enter username [foo]: foo
Please enter a username
Enter username [foo]: /foo/
Enter full name []: ^C

If I do not accept the default regexp, I observe exactly the same behaviour you
described. You might want to consider removing /etc/adduser.conf or editing to
fix the regexp. I'm not sure why 'adduser' accepts the /foo/, though.
Does this fix your problem?
-- Volker

State-Changed-From-To: open->feedback 
State-Changed-By: vs 
State-Changed-When: Wed Nov 3 08:51:32 GMT 2004 
State-Changed-Why:  
Ask for more details; suggest workaround. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=69846 

From: "linweichuan" <linweichuan@hotmail.com>
To: <freebsd-gnats-submit@FreeBSD.org>, <linweichuan@hotmail.com>
Cc:  
Subject: Re: bin/69846: the usename has to be writed as "/****/" by using the adduser
Date: Thu, 4 Nov 2004 21:40:56 +0800

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_0013_01C4C2B6.F76DA150
 Content-Type: text/plain;
 	charset="gb2312"
 Content-Transfer-Encoding: base64
 
 WWVzLg0KVGhlIHByb2JsZW0gaXMgZml4ZWQgbm93Lg0KDQpCVFcsaXQgc2hvdWxkIGF0dHJpYnV0
 ZSB0byBteSBjYXJlbGVzc25lc3Mgd2hlbiBpIHJhbiB0aGUgJ2FkZHVzZXInIGZpcnN0IHRpbWUs
 DQoNCmJ1dCBJIGFtIGFsc28gY3VyaW91cyBhYm91dCB3aHkgJ2FkZHVzZXInIGFjY2VwdCB0aGUg
 L2Zvby8u
 
 ------=_NextPart_000_0013_01C4C2B6.F76DA150
 Content-Type: text/html;
 	charset="gb2312"
 Content-Transfer-Encoding: base64
 
 PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
 L0VOIj4NCjxIVE1MPjxIRUFEPg0KPE1FVEEgaHR0cC1lcXVpdj1Db250ZW50LVR5cGUgY29udGVu
 dD0idGV4dC9odG1sOyBjaGFyc2V0PWdiMjMxMiI+DQo8TUVUQSBjb250ZW50PSJNU0hUTUwgNi4w
 MC4yODAwLjExMDYiIG5hbWU9R0VORVJBVE9SPg0KPFNUWUxFPjwvU1RZTEU+DQo8L0hFQUQ+DQo8
 Qk9EWSBiZ0NvbG9yPSNmZmZmZmY+DQo8RElWPjxGT05UIHNpemU9Mj5ZZXMuPC9GT05UPjwvRElW
 Pg0KPERJVj48Rk9OVCBzaXplPTI+VGhlIHByb2JsZW0gaXMgZml4ZWQgbm93LjwvRk9OVD48L0RJ
 Vj4NCjxESVY+PEZPTlQgc2l6ZT0yPjwvRk9OVD4mbmJzcDs8L0RJVj4NCjxESVY+PEZPTlQgc2l6
 ZT0yPkJUVyxpdCBzaG91bGQmbmJzcDthdHRyaWJ1dGUgdG8gbXkgY2FyZWxlc3NuZXNzIHdoZW4g
 DQppJm5ic3A7cmFuIHRoZSZuYnNwOydhZGR1c2VyJyZuYnNwO2ZpcnN0IHRpbWUsPC9GT05UPjwv
 RElWPg0KPERJVj48Rk9OVCBzaXplPTI+PC9GT05UPiZuYnNwOzwvRElWPg0KPERJVj48Rk9OVCBz
 aXplPTI+YnV0IEkgYW0gYWxzbyZuYnNwO2N1cmlvdXMgYWJvdXQgd2h5Jm5ic3A7J2FkZHVzZXIn
 IGFjY2VwdCB0aGUgDQovZm9vLy48L0ZPTlQ+PC9ESVY+PC9CT0RZPjwvSFRNTD4NCg==
 
 ------=_NextPart_000_0013_01C4C2B6.F76DA150--
State-Changed-From-To: feedback->closed 
State-Changed-By: ceri 
State-Changed-When: Thu Nov 4 13:55:27 GMT 2004 
State-Changed-Why:  
The submitter's last response decodes to: 

Yes. 
The problem is fixed now. 

BTW,it should attribute to my carelessness when i ran the 'adduser' 
first time, 

but I am also curious about why 'adduser' accept the /foo/. 

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