[Pkg-shadow-devel] Why uppercase is not allowed in username by "useradd"?

Wangrui Shen wangrui.shen at windriver.com
Fri Oct 10 06:16:54 UTC 2014


Hi experts,
In libmisc/chkname.c, is_valid_name() only return ture if
the pattern [a-z_][a-z0-9_-]*[$] is matched. For example:
----------------------------
~# useradd nodeA123;
useradd: invalid user name 'nodeA123'
----------------------------

But in other repository, the pattern is replaced with [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-],
which means uppercase characters and additional character are also allowed, such as:
shadow-4.0.3-goodname.patch in ftp://195.220.108.108/linux/redhat/linux/enterprise/4/en/os/s390x/SRPMS/shadow-utils-4.0.3-41.1.src.rpm.

my questions is:
Are there some special concerns that don't allow uppercase to be used in username?

Thanks,
Wangrui



More information about the Pkg-shadow-devel mailing list