Bug 150770 - (IT_68362) [PATCH] Useradd will not add use with '$' (for Samba Machine Accounts)
[PATCH] Useradd will not add use with '$' (for Samba Machine Accounts)
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: shadow-utils (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
: 169868 (view as bug list)
Depends On:
Blocks: 156322
  Show dependency treegraph
Reported: 2005-03-10 08:32 EST by Dean Landry
Modified: 2007-11-30 17:07 EST (History)
7 users (show)

See Also:
Fixed In Version: RHBA-2005-309
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-05 08:41:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
shadow-utils-allow-dollar-name.patch (816 bytes, patch)
2005-03-11 07:01 EST, Bastien Nocera
no flags Details | Diff
shadow-utils-allow-dollar-name.patch (815 bytes, patch)
2005-03-11 07:08 EST, Bastien Nocera
no flags Details | Diff

  None (edit)
Description Dean Landry 2005-03-10 08:32:44 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Description of problem:
Samba uses a command like this to add machine accounts:

add machine script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u

This creates an account with a '$' (dollar sign) at the end of it.  useradd doesn't allow a username with this symbol (the error "useradd: invalid user name 'test$'").  

To create machine accounts, I have to add the user without the '$' and then modify /etc/passwd.

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

How reproducible:

Steps to Reproduce:
1. /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M test$

Actual Results:  useradd: invalid user name 'test$'

Expected Results:  Account should have been created.

Additional info:

I believe some versions of adduser had a switch to allow non-standard characters like '$'.
Comment 1 Bastien Nocera 2005-03-11 07:01:45 EST
Created attachment 111880 [details]

This patch simply adds "$" as an allowed character in a username, as long as it
isn't the first character.
Comment 2 Bastien Nocera 2005-03-11 07:08:13 EST
Created attachment 111881 [details]

And the same patch with the comment actually matching the code.
Comment 6 Bastien Nocera 2005-03-14 07:56:56 EST
Test packages uploaded to:
Comment 10 Matt Phillips 2005-06-28 12:03:27 EDT
These packages work for me and solve this problem with Samba.  Any word on 
if/when this will be officially released as an update for RHEL4? 
Comment 13 Milan Kerslager 2005-09-07 03:23:05 EDT
RHEL4 Beta channel has shadow-utils with $ patch inside according to the
changelog. I did not tested it yet as it requires newer audit-libs. You may try
to subscribe to RHEL4 Beta channel through RHN and then do "up2date -u
shadow-utils" (and then unsubscribe from Beta channel).

I'm using package from comment #6 with no problem.
Comment 14 Red Hat Bugzilla 2005-10-05 08:41:39 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Comment 15 Peter Vrabec 2005-10-06 03:35:25 EDT
*** Bug 169868 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.