I need to create accounts whose usernames contain uppercase characters (example : UpperCasedName). useradd UpperCasedName tells me : useradd: invalid user name 'UpperCasedName' I can change it 'by hand' in the password file. But not easy to script, and sounds dangerous :-P Reproducible: Always Steps to Reproduce: 1. useradd UpperCasedName Actual Results: invalid user name 'UpperCasedName' And the system refuses to create the account Expected Results: It should have created the account. Similar to bug #22920
Created attachment 321566 [details, diff] Patch to allow user to create a username with UpperCase. Patch allows users to create a username with UpperCase.
Created attachment 321568 [details, diff] Patch to add my patch to shadow-4.1.4.3 This adds an extra two lines to the ebuild so that the shadow-4.0.3-chkname.patch to be used.
Whoops, mistook the descriptions.
PASSWD(5): account:password:UID:GID:GECOS:directory:shell The field are as follows: account the name of the user on the system. It should not contain capital letters. I suppose you could ask Linus.
The workaround for the problem you are trying to solve might be to use (part of) GECOS.
I've migrated from mandriva 2010, and the passwd file was created with it. After migrating, i couldn't even delete the users without editing the file itself. Is this the normal behavior? Also, in FreeBSD man 5 passwd login isn't restricted at all.
(In reply to comment #6) > I've migrated from mandriva 2010, and the passwd file was created with it. > After migrating, i couldn't even delete the users without editing the file > itself. > Is this the normal behavior? > Also, in FreeBSD man 5 passwd login isn't restricted at all. As a proof, here is this short log: [root@BatMan ~]$ useradd TeSt.USeR\$ [root@BatMan ~]$ tail -n1 /etc/passwd TeSt.USeR$:x:10004:10005::/home/TeSt.USeR$:/bin/bash [root@BatMan ~]$ cat /etc/release Mandriva Linux release 2010.0 (Official) for x86_64 [root@BatMan ~]$ uname -a Linux BatMan.XNet 2.6.38.1-1 #2 SMP Tue Mar 29 14:14:09 MSD 2011 x86_64 Intel(R) Atom(TM) CPU D510 @ 1.66GHz GNU/Linux
that we've been running for more than a decade and no one has asked for this functionality is a bit telling you could submit your patch here if you like: http://pkg-shadow.alioth.debian.org/getinvolved.php while i can't see the bother of adding new users with upper case letters, i tend to agree that the delete code paths should be more tolerant of garbage. if it's in the passwd file (and even if it contains invalid characters), it'd probably be a good thing if the deluser code path could clean up.
If it works flawlessly, why not make it at least optional?Like via USE flags... Or, if needed, we could notify the upstream to add this functionality globally.
(In reply to comment #9) because it's less effort to not maintain a patch. you're the first to ask for this which means most people don't care or have their own system. i added a call to epatch_user so you can keep that patch in /etc/portage/patches/ and have it applied automatically.
As a final note, manpages in BSD and the shadow itself(in the source, ./man/passwd.5.xml) say that login name is not restricted. Therefore, Jeroen Roovers was wrong in comment #4. Going to notify the upstream.
I need this feature too. Author of this application, releases a patch for Debian. SVN here: http://anonscm.debian.org/viewvc/pkg-shadow/debian/tags/debian/4.1.5.1-1/debian/patches/506_relaxed_usernames?revision=3748&view=markup It says "POSIX indicate that usernames are composed of characters from the portable filename character set [A-Za-z0-9._-], and that the hyphen should not be used as the first character of a portable user name." Patch is well-maintained. Many other distros use that patch. I tested FreeBSD6, FreeBSD8, Debian6 and RHEL6. I can post proof, if you want. Adding such a patch will not limit Gentoo compatibility, but improove it.