Bug 138782 - $ cannot be in username, making samba machine names impossible
Summary: $ cannot be in username, making samba machine names impossible
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: 3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Eido Inoue
QA Contact: David Lawrence
URL:
Whiteboard:
: 140582 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-11 04:53 UTC by liz
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version: 4.0.3-41
Clone Of:
Environment:
Last Closed: 2004-11-16 23:34:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description liz 2004-11-11 04:53:40 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3)
Gecko/20040913 Firefox/0.10.1

Description of problem:
Samba requires machine names to be suffixed with a $
useradd has suddenly decided to stop accepting names with a $
This neccesitates the use of vipw or other item to do the adding,
which is a pain because samba has a machine script option, you could
just add a machine to a domain automatically.



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. /usr/sbin/useradd test$
2. /user/sbin/useradd tes$t

    

Actual Results:  first one says the username is invalid, second works
but strips everything after the $ so you get tes

Expected Results:  a user named test$ and a user named tes$t

Comment 1 Eido Inoue 2004-11-11 21:02:15 UTC
most of the howto-s expect you to add the "$" via vipw because "$" is
illegal on many other useradd's as well. There are very good reasons
to limit the legal characters in a username to what is specified by
posix. however, it would be nice to take advantage of 3.x's add
machine script option, so I'm thinking the best way to address this
issue is to allow a "--samba" option to useradd, which is put in the
script.

Samba's solution, to jam machine names into the passwd, is a
ascii-centric hack because it won't work for all cases (i.e. Windows
allows machine/user names way longer than the Linux internal 16 char
username/groupname limit and allows non-ascii unicode). A mapping
table is a better solution. Until that comes around though, we should
allow the "$" for legacy compatibility. Samba needs its i18n to get fixed.

Also, the reason "/usr/sbin/useradd tes$t" failed is because bash
pre-interpreted "$t" as a variable. need to surround it in quotes.
(this is also why posix recommends that user/group names not start
with a "-"... to avoid being interpreted as a command line option).

Comment 2 Eido Inoue 2004-11-24 05:16:49 UTC
*** Bug 140582 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.