Comment 2 for bug 1927078

Revision history for this message
Victor Tapia (vtapia) wrote :

I don't have a strong opinion either, but given that scripts would ignore the warnings and the resulting numeric users are going to face random, seemingly unrelated issues thanks to the interaction with systemd, I think I prefer the failure.

FWIW, I've prepared a test version in a PPA[1] which keeps the rules from Debian[2] but prevents the fully numeric names. This is what it looks like:

$ useradd 0
useradd: invalid user name '0'

$ echo $?
3

$ sudo useradd 0c0

$ sudo useradd 0 --badnames

$ cat /etc/passwd | grep ^0
0c0:x:1001:1001::/home/0c0:/bin/sh
0:x:1002:1002::/home/0:/bin/sh

[1] https://launchpad.net/~vtapia/+archive/ubuntu/sf305373
[2] https://salsa.debian.org/debian/shadow/-/blob/master/debian/patches/506_relaxed_usernames