Bug 659385 - The useradd command does not reject usernames which are pure numerical
The useradd command does not reject usernames which are pure numerical
Product: Fedora
Classification: Fedora
Component: shadow-utils (Show other bugs)
Unspecified Unspecified
low Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2010-12-02 12:15 EST by Joachim Backes
Modified: 2011-01-04 09:01 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-01-04 09:01:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Joachim Backes 2010-12-02 12:15:44 EST
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):

How reproducible:

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

Expected results:

should be rejected

Additional info:
Comment 1 Joachim Backes 2010-12-03 01:38:17 EST
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 09:01:20 EST
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
 * 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.