Bug 47594

Summary: [patch] passwd(5) incorrectly states allowed username and group syntax
Product: Documentation Reporter: Fernando Schapachnik <fernando>
Component: Books & ArticlesAssignee: Warren Block <wblock>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
file.diff
none
passwd.txt none

Description Fernando Schapachnik 2003-01-28 14:40:08 UTC
passwd(5) incorrectly states the allowed syntax.

Fix: The attached patch (in two flavours, for 4.7-R, and -CURRENT) explicitly lists
disallowed chars in the username and group fields.

I suggest that a reminder is put in pw/pw_user.c, so that the code in pw_checkname
is kept in sync with the man page.

Please somebody check the spelling and grammar, as I'm not a native speaker.

The patch also accounts for the changes made in 1.53 in response to
bin/28773 and bin/46890.


Patch for 4.7-R:

Patch for -CURRENT:
Comment 1 Remko Lodder freebsd_committer freebsd_triage 2008-01-17 13:16:50 UTC
Responsible Changed
From-To: freebsd-doc->remko

I'll look into this.
Comment 2 Remko Lodder freebsd_committer freebsd_triage 2012-09-27 08:37:52 UTC
Responsible Changed
From-To: remko->freebsd-doc

reassign to the pool, i have held this locked too long
Comment 3 Sevan Janiyan 2014-05-26 07:19:31 UTC
Attached is a diff which applies to -HEAD (r266021)
Checked contents of badchars in pw_checkname(), usr.sbin/pw/pw_user.c to 
see if the list is still correct.
Comment 4 Warren Block freebsd_committer freebsd_triage 2014-05-26 17:02:00 UTC
Responsible Changed
From-To: freebsd-doc->wblock

Take.
Comment 5 dfilter service freebsd_committer freebsd_triage 2014-05-29 03:26:16 UTC
Author: wblock (doc committer)
Date: Thu May 29 02:26:12 2014
New Revision: 266828
URL: http://svnweb.freebsd.org/changeset/base/266828

Log:
  Correct the description of characters allowed.  Based on pw_checkname in
  usr.sbin/pw/pw_user.c.  Modified version of patch submitted by
  venture37.
  
  PR:		docs/47594
  Submitted by:	Fernando Schapachnik <fernando@mecon.gov.ar>, venture37 <venture37@geeklan.co.uk>
  Reviewed by:	allanjude, bcr, brueffer (on phabricator)
  MFC after:	1 week

Modified:
  head/share/man/man5/passwd.5

Modified: head/share/man/man5/passwd.5
==============================================================================
--- head/share/man/man5/passwd.5	Thu May 29 01:42:22 2014	(r266827)
+++ head/share/man/man5/passwd.5	Thu May 29 02:26:12 2014	(r266828)
@@ -125,19 +125,29 @@ Routines
 that manipulate these files will often return only one of the multiple
 entries, and that one by random selection.
 .Pp
-The login name must never begin with a hyphen
-.Pq Ql - ;
-also, it is strongly
-suggested that neither upper-case characters or dots
-.Pq Ql \&.
-be part
-of the name, as this tends to confuse mailers.
+The login name must not begin with a hyphen
+.Pq Ql \&- ,
+and cannot contain 8-bit characters, tabs or spaces, or any of these
+symbols:
+.Ql \&,:+&#%^\&(\&)!@~*?<>=|\e\\&/" .
+The dollar symbol
+.Pq Ql \&$
+is allowed only as the last character for use with Samba.
 No field may contain a
 colon
 .Pq Ql \&:
 as this has been used historically to separate the fields
 in the user database.
 .Pp
+Case is significant.
+Login names
+.Ql Lrrr
+and
+.Ql lrrr
+represent different users.
+Be aware of this when interoperating with systems that do not have
+case-sensitive login names.
+.Pp
 In the
 .Nm master.passwd
 file,
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 6 Warren Block freebsd_committer freebsd_triage 2014-05-29 03:26:40 UTC
State Changed
From-To: open->closed

Modified version of patch committed, thanks!