Bug 493641 - useradd can't distinguish between groupname and groupid when the groupname is a number
Summary: useradd can't distinguish between groupname and groupid when the groupname is...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-02 13:32 UTC by epablo
Modified: 2009-05-18 10:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-18 10:11:14 UTC
Type: ---
Embargoed:


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

Description epablo 2009-04-02 13:32:25 UTC
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 10:10:06 UTC
Created attachment 344408 [details]
useradd -g look for a group name and then for group number

Comment 2 Peter Vrabec 2009-05-18 10:11:14 UTC
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.