From howardjp@well.com  Fri Jul  6 10:28:00 2001
Return-Path: <howardjp@well.com>
Received: from smtp.well.com (smtp.well.com [208.178.101.27])
	by hub.freebsd.org (Postfix) with ESMTP id AC9C037B406
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  6 Jul 2001 10:28:00 -0700 (PDT)
	(envelope-from howardjp@well.com)
Received: from well.com (howardjp@well.com [208.178.101.2])
          by smtp.well.com (8.8.5/8.8.4) with ESMTP
	  id KAA15490 for <FreeBSD-gnats-submit@freebsd.org>; Fri, 6 Jul 2001 10:28:14 -0700 (PDT)
Received: (from howardjp@localhost) by well.com (8.8.5/8.8.5) id KAA06528 for FreeBSD-gnats-submit@freebsd.org; Fri, 6 Jul 2001 10:27:42 -0700 (PDT)
Message-Id: <200107061727.KAA06528@well.com>
Date: Fri, 6 Jul 2001 10:27:42 -0700 (PDT)
From: James Howard <howardjp@well.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] Bug in pw, no $ in username

>Number:         28773
>Category:       bin
>Synopsis:       [PATCH] Bug in pw, no $ in username
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gad
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 06 10:30:02 PDT 2001
>Closed-Date:    Mon Jan 27 17:31:28 PST 2003
>Last-Modified:  Mon Jan 27 17:31:28 PST 2003
>Originator:     James P. Howard II
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
Wavix Incorporated
>Environment:
System: FreeBSD gonzo.wavix.lan 4.3-STABLE FreeBSD 4.3-STABLE #0: Tue Jul 3 17:54:34 GMT 2001 howardjp@gonzo.wavix.lan:/usr/src/sys/compile/GONZO i386


>Description:

Part of the Samba documentation says pw(8) on FreeBSD will not create usernames with
a $ in them.  This can be problematic for Samba users because machine's need accounts
with the usernname equal to machinename$.  This REALLY simple patch removes the $
and a character which can invalidate a username.

>How-To-Repeat:

pw user add foobar$

>Fix:

--- pw_user.c.orig	Fri Jul  6 13:13:30 2001
+++ pw_user.c	Fri Jul  6 13:15:28 2001
@@ -1211,7 +1211,7 @@
 pw_checkname(u_char *name, int gecos)
 {
 	int             l = 0;
-	char const     *notch = gecos ? ":!@" : " ,\t:+&#%$^()!@~*?<>=|\\/\"";
+	char const     *notch = gecos ? ":!@" : " ,\t:+&#%^()!@~*?<>=|\\/\"";
 
 	while (name[l]) {
 		if (strchr(notch, name[l]) != NULL || name[l] < ' ' || name[l] == 127 ||
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: gad 
State-Changed-When: Mon Jan 27 17:27:26 PST 2003 
State-Changed-Why:  
I have just committed more extensive changes to pw_user which will 
allow the '$' character as the last character in a user or group name. 
I have only installed the change in the freebsd-current branch.  Let 
me know if you really need it in the freebsd-stable branch.  I figure 
that in -stable most people are using the version of adduser which 
was written in perl, and AFAIK that version does not have this problem. 


Responsible-Changed-From-To: freebsd-bugs->gad 
Responsible-Changed-By: gad 
Responsible-Changed-When: Mon Jan 27 17:27:26 PST 2003 
Responsible-Changed-Why:  
I've committed a change for this issue. 

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