From owner-freebsd-hackers Fri Dec 27 9:35:53 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5E5237B401 for ; Fri, 27 Dec 2002 09:35:51 -0800 (PST) Received: from ren.sasknow.com (ren.sasknow.com [207.195.92.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19CF243EC5 for ; Fri, 27 Dec 2002 09:35:51 -0800 (PST) (envelope-from ryan@sasknow.com) Received: from earl.sasknow.net (earl.sasknow.net [207.195.92.130]) by ren.sasknow.com (8.11.6/8.11.6) with ESMTP id gBRHZjp79551 for ; Fri, 27 Dec 2002 11:35:45 -0600 (CST) (envelope-from ryan@sasknow.com) Received: from ren (ren.sasknow.com [207.195.92.131]) by earl.sasknow.net (8.12.6/8.12.6) with ESMTP id gBRHZj72008543 for ; Fri, 27 Dec 2002 11:35:45 -0600 (CST) (envelope-from ryan@sasknow.com) Date: Fri, 27 Dec 2002 11:35:45 -0600 (CST) From: Ryan Thompson To: freebsd-hackers@freebsd.org Subject: pw(8): $ (dollar sign) in username Message-ID: <20021227112033.N93884-100000@ren.sasknow.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Audit: Email processed by earl.sasknow.com filter Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi all, I've recently had the pleasure of configuring a FreeBSD machine as a Samba Primary Domain Controller. In smb.conf, one can specify an "add user script" directive to automate the creation of machine accounts. Otherwise, you have to manually create accounts for each machine on the network. See: http://us1.samba.org/samba/ftp/docs/htmldocs/Samba-PDC-HOWTO.html Problem is, smb requires a '$' at the end of the username, which our pw(8) doesn't allow. Allowing the $ is a one-character change to usr.sbin/pw/pw_user.c . Aside from the obvious pain of accidentally inserting shell variables as part of a username if the $ is not escaped, are there any specific problems with this change? Others would probably benefit from this. Is the change worth committing? Or would it be better to push this to pw.conf? --- usr.sbin/pw/pw_user.c.orig Sat Nov 16 21:55:28 2002 +++ usr.sbin/pw/pw_user.c Fri Dec 27 11:17:33 2002 @@ -1195,7 +1195,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 || - Ryan -- Ryan Thompson SaskNow Technologies - http://www.sasknow.com 901-1st Avenue North - Saskatoon, SK - S7K 1Y4 Tel: 306-664-3600 Fax: 306-244-7037 Saskatoon Toll-Free: 877-727-5669 (877-SASKNOW) North America To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message