Bug 150770 (IT_68362) - [PATCH] Useradd will not add use with '$' (for Samba Machine Accounts)
Summary: [PATCH] Useradd will not add use with '$' (for Samba Machine Accounts)
Alias: IT_68362
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: shadow-utils   
(Show other bugs)
Version: 4.0
Hardware: i386
OS: Linux
Target Milestone: ---
: ---
Assignee: Peter Vrabec
QA Contact: David Lawrence
: 169868 (view as bug list)
Depends On:
Blocks: 156322
TreeView+ depends on / blocked
Reported: 2005-03-10 13:32 UTC by Dean Landry
Modified: 2007-11-30 22:07 UTC (History)
7 users (show)

Fixed In Version: RHBA-2005-309
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-05 12:41:39 UTC
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 12:01 UTC, Bastien Nocera
no flags Details | Diff
shadow-utils-allow-dollar-name.patch (815 bytes, patch)
2005-03-11 12:08 UTC, Bastien Nocera
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:309 qe-ready SHIPPED_LIVE shadow-utils bug fix update 2005-10-05 04:00:00 UTC

Description Dean Landry 2005-03-10 13:32:44 UTC
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 12:01:45 UTC
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 12:08:13 UTC
Created attachment 111881 [details]

And the same patch with the comment actually matching the code.

Comment 6 Bastien Nocera 2005-03-14 12:56:56 UTC
Test packages uploaded to:

Comment 10 Matt Phillips 2005-06-28 16:03:27 UTC
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 07:23:05 UTC
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 12:41:39 UTC
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 07:35:25 UTC
*** 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.