7 ms·
Allowing purely numeric usernames seems like a terrible idea to me, because it creates ambiguity between what's a username and what's a UID. It's common for too
by dfranke 2y ago
Allowing purely numeric usernames seems like a terrible idea to me, because it creates ambiguity between what's a username and what's a UID. It's common for tools like ls or ps to display a username when one is found and fall back to displaying a UID if it isn't, and similarly tools like chown will accept either a UID or a username and disambiguate based on whether it's numeric or not. Now suppose there's a numeric username that doesn't match its own UID, but does match some other user's UID. It doesn't take a lot of imagination to see how this would lead to vulnerabilities.
- throw0101a 2y agoTalk to POSIX: > A string that is used to identify a user; see also User Database. To be portable across systems conforming to POSIX.1-2017, the value is composed of characters from the portable filename character set. The <hyphen-minus> character should not be used as the first character of a portable user name. * https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_437 https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1... The "portable filename character set" is defined as: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 . _ - * https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282 https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1... So only a hyphen as the first character is forbidden. Given that you can't necessarilly control where usernames come from (e.g., LDAP lookups), properly speaking your system has to handle everything anyway, even if you don't allow local creation.
- dfranke 2y agoYes, I'm aware, and POSIX has many such bugs that make command input or output unavoidably ambiguous if certain unexpected characters are present that they didn't think to prohibit. A lot of the revisions that went into POSIX 2024 were aimed at fixing some of these, such as standardizing find -print0 and xargs -0. The fact that this one got overlooked doesn't mean it's a good idea to make the situation worse and harder for future POSIX revisions to address.
- bluGill 2y agoIt is time for POSIX to get with the times. Computers are used in more than the US and Canada (for the most generous interpretation of American in ASCII I'm including Canada, their French speakers will not be happy with that, not to mention first nations of which I know nothing but imagine their written language needs more than ASCII). UTF8 has been standard for decades now, just state that as of POSIX 2025 all of UTF8 is allowed in all string contexts unless there is a specific list of exception characters for that context (that is they never do a list of allowed characters). They probably need to standardize on utf8 normalization functions and when they must be used in string comparisons. Probably also need some requirement that and alternate utf8 character entry scheme exist on all keyboards. The above is a lot of work and will probably take more than a year to put into the standard, much less implement, but anything less is just user hostile. Sometimes commettiees need to lead from the front not just write down existing practice.
- chikere232 2y agoSounds like lots of work and a lot of new bugs for no real value.
- throw0101a 2y ago> It is time for POSIX to get with the times. "Be the change that you wish to see in the world." — Mahatma Gandhi It's free to join: * https://www.opengroup.org/austin/lists.html https://www.opengroup.org/austin/lists.html * https://www.opengroup.org/austin/ https://www.opengroup.org/austin/
- 7bit 2y ago[flagged]
- throw0101a 2y ago> Most useless post so far Is GP willing to help out? To go through data structures and file formats (like pax[0][1] (née ustar (née tar))) to find places where things will need to be changed? It's easy to say "Someone else should fix things." [0] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_01 https://pubs.opengroup.org/onlinepubs/9699919799/utilities/p... [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_03 https://pubs.opengroup.org/onlinepubs/9699919799/utilities/p...
- NoMoreNicksLeft 2y ago> properly speaking your system has to handle everything anyway, even if you don't allow local creation. Honestly, I try not to be a pessimist, but this sounds like the opening narration to some dystopian doomsday movie. Titled something like You're Not Wrong, I suppose.
- macintux 2y agoAt the meatspace level, purely numeric usernames are problematic. I was working as a contractor at a Fortune 500 firm several years ago when they introduced a new ERP system which apparently encouraged the company to switch to numeric system IDs. Fortunately the technical teams, especially Linux support, objected and it was overruled, but I was just as worried about the communications problems that would result. When everyone has a system ID that matches a consistent pattern, like “YZ12345”, IDs are easy to recognize in documentation and data. An ID like “1234567” could be practically anything.
- PhilipRoman 2y agoI really like the concept of adding some redundancy to ids, like a prefix. It helps to disambiguate things (kind of like static typing). A good example is also bank numbers, which must be a multiple of 97 +1, enabling fast client-side validation against typos.
- cupantae 2y agoCould you give a reference on this 97 rule? I’m intrigued.
- az09mugen 2y agoI was also intrigued, so I searched and on wikipedia ( https://en.wikipedia.org/wiki/International_Bank_Account_Number https://en.wikipedia.org/wiki/International_Bank_Account_Num... ), in the section "Validating the IBAN" it is written : Interpret the string as a decimal integer and compute the remainder of that number on division by 97 If the remainder is 1, the check digit test is passed and the IBAN might be valid
- Spooky23 2y agoIt’s pretty common in places that handle Tax data. At the end of the day, pushing opinionated bullshit doesn’t belong in utilities. If there’s a security vulnerability, sell that and push for incorporation into NIST standards.
- hulitu 2y ago> Allowing purely numeric usernames seems like a terrible idea to me "I'm not a number, i am a free man. Ha ha ha ha ha"
- thephyber 2y agoI am also worried about more subtle bugs caused by usernames that are not strictly only-numeric, such as “10e2” or “0xDEADBEEF”.
- Ferret7446 2y agoIt shouldn't be a problem as long as the system disallows a numeric username to be the same as an existing UID (excepting the case where the matching UID is assigned to said username).
- nikisweeting 2y agostill makes historic data garbage, both users and pids can be created/destroyed over time.
- Spooky23 2y agoThere’s lots of dumb things that you can do. Where do the safety bumpers stop?
- pas 2y agowherever each community puts them?