Bug 659385 - The useradd command does not reject usernames which are pure numerical
Summary: The useradd command does not reject usernames which are pure numerical
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: 14
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-02 17:15 UTC by Joachim Backes
Modified: 2011-01-04 14:01 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-01-04 14:01:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Joachim Backes 2010-12-02 17:15:44 UTC
Description of problem:
The useradd command should reject pure numerical usernames - otherwise it is difficult in some commands to differentiate bewtween alphanumerical usernames and numerical userids.

Version-Release number of selected component (if applicable):
shadow-utils-4.1.4.2-8.fc14.i686

How reproducible:
always

Steps to Reproduce:
1. useradd 123456789 
2.
3.
  
Actual results:
is not rejected

Expected results:

should be rejected

Additional info:

Comment 1 Joachim Backes 2010-12-03 06:38:17 UTC
Example: Changing the ownership of some file afterwards can lead to a misunderstanding, if there a are different users with the same username resp. userid (user #1: username=12345,userid=500; user #2: username=aaaa,userid=12345). chown 12345 /tmp/xxxxx. Which user is meant? 12345 or aaaa?

Comment 2 Peter Vrabec 2011-01-04 14:01:20 UTC
yes I agree with you Joachim. This might lead to a misunderstanding if admin creates pure numerical usernames. shadow-utils upstream version allows names that match [a-z_][a-z0-9_-]*[$] too.

But I must say I'm not very open to idea of changing current behaviour. 
 * We have been using pattern [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]? for a long time and I don't want to make other people unhappy.
 * the intention is to follow posix as much as possible
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_426
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_276
 * we are not the only one who allow numerical usernames, see FreeBSD

I'm closing this bz report as NOTABUG now. If you think that useradd behaviour should be changed, please start a public discussion about this issue.


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