Bug 493641 - useradd can't distinguish between groupname and groupid when the groupname is a number
useradd can't distinguish between groupname and groupid when the groupname is...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: shadow-utils (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-02 09:32 EDT by epablo
Modified: 2009-05-18 06:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-18 06:11:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
useradd -g look for a group name and then for group number (1.20 KB, patch)
2009-05-18 06:10 EDT, Peter Vrabec
no flags Details | Diff

  None (edit)
Description epablo 2009-04-02 09:32:25 EDT
Description of problem:
For the sake of sanity in our environment (I work in the phone business) I have to create usernames and groups that are numbers (phone numbers).

useradd can't distinguish between a groupname and a groupnumber even if the group name starts with a number.  There is no option do this.

How reproducible:
Anywhere 

Steps to Reproduce:
1. useradd -s /sbin/nologin 0555555
2. useradd -s /sbin/nologin -d /home/0555555 -g 0555555 0555555-2
useradd: unknown group 0555555
  
Actual results:
Step 1 creates the user and the group 0555555 but step 2 can't breaks up.
I tried using simple and double quotes (', "), but it just doesn't work

Expected results:
There should be an additional option to handle this case and / or at least explicit documentation.


Additional info:
I know that the idea of usernames and groupnames is not to have to learn the numbers and make it easier, but their should be a work around
Comment 1 Peter Vrabec 2009-05-18 06:10:06 EDT
Created attachment 344408 [details]
useradd -g look for a group name and then for group number
Comment 2 Peter Vrabec 2009-05-18 06:11:14 EDT
I'm sorry but I'm afraid I can't fix this issue :( The reason is that I don't want shadow-utils package to diverge from upstream. Shadow-utils upstream does not allow number as a first character of username. This is Fedora/RedHat extension.

I'm sending a patch for shadow-utils-4.1.4(rawhide) that might help you. It's changing the behaviour in a way that useradd -g look for the name at first and if it doesn't find it will look for number.

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