[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adduser.8 [_-] in username undocumented - bug or Bad Idea(tm)?



Hey'

I notice the adduser prompt for username is: 
Enter username [a-z0-9_-]:

However the manpage states "Login names should contain only lowercase
characters or digits."  Perhaps the "should" is the operative word here
but adduser does allow "az_09-az", "_az_09-az", or even "az_09-az-" all
of which I created and was able to ssh to (in 3.2).  It does not allow
"-az_09-az": "Illegal username. Please use only lowercase characters or
digits".  
Perhaps it's a Bad Idea(tm) to use this but as long as it's advertised
in the prompt, it should probably be documented in the manpage.  I'm not
able to use sendbug BTW.  I searched the archives to see if this
suggestion is merely annoying but perhaps I missed it in the mountain of
adduser hits and uninformative subjects.  

So here's two separate patches.  The first simply documents [_-] in
usernames, while the second adds a warning.

Index: adduser.8
===================================================================
RCS file: /cvs/src/usr.sbin/adduser/adduser.8,v
retrieving revision 1.27
diff -u -r1.27 adduser.8
--- adduser.8   29 Jan 2003 16:53:36 -0000      1.27
+++ adduser.8   24 Feb 2003 13:45:14 -0000
@@ -216,7 +216,8 @@
 .Sh RESTRICTIONS
 .Bl -tag -width Ds
 .It Sy username
-Login names should contain only lowercase characters or digits.
+Login names should contain only lowercase characters, digits,
underscores
+or (except as the first character) hyphens.
 They should be no longer than 31 characters (see BUGS section of
 .Xr setlogin 2 ) .
 .\" The reasons for this limit are "Historical".

Index: adduser.8
===================================================================
RCS file: /cvs/src/usr.sbin/adduser/adduser.8,v
retrieving revision 1.27
diff -u -r1.27 adduser.8
--- adduser.8   29 Jan 2003 16:53:36 -0000      1.27
+++ adduser.8   24 Feb 2003 13:55:27 -0000
@@ -216,7 +216,9 @@
 .Sh RESTRICTIONS
 .Bl -tag -width Ds
 .It Sy username
-Login names should contain only lowercase characters or digits.
+Login names should contain only lowercase characters or digits. 
Underscores
+or (except as the first character) hyphens may also be used but this
may
+break some programs.
 They should be no longer than 31 characters (see BUGS section of
 .Xr setlogin 2 ) .
 .\" The reasons for this limit are "Historical".

--
Murphy