Hi all,

Il giorno dom, 24/11/2024 alle 13.20 +0100, Iustin Pop ha scritto:
> [...]
> I still don't understand the need for username to be very
> representative of one's name. OTOH, my name can be fully written
> using
> ASCII, so maybe I miss something. But I've also had to use accounts
> like
> abc745, which didn't bother me much over the duration of a semester
> or
> year.

It is true that user account name and user (display) name are
different, of course. But still, when you log in, you use the user
account name to the access system; this is the text shown in file
ownership listing and almost everywhere in the system.
I think that user (display) name, that may be put in gecos field, are
not widely used. Moreover, adduser man page on Debian stable, states
that gecos fields will be removed after bookworm.

So, having a good account user name is an important thing. And we have
to chose if it should be "good" for the computer (like in: unique,
lowercase, short, US-ASCII, etc.) or if it should be "good" for the
real user. In the latter case, I would accept a broader class of
strings for the very simple reason that it should be left to user
preference.

I checked what other systems do:

Windows[0] accept any characters, except " / \ [ ] : ; | = , + * ? < >,
and allow for 64 characters (or bytes, I am unsure on this).

SunOS has these restrictions[1] "a string of no more than thirty-two
bytes consisting of characters from the set of alphabetic characters,
numeric characters, period (.), underscore (_), and hyphen (-). The
first character should be alphabetic and the field should contain at
least one lowercase alphabetic character"

In LDAP[2] the uid field is a "Directory String"[3], so any non zero
length UTF8 text. There is a note: Servers and clients MUST be prepared
to receive arbitrary UCS code points, including code points outside the
range of printable ASCII and code points not presently assigned to any
character.

FreeBSD[4] suggest to "use user names that consist of eight or fewer,
all lower case characters in order to maintain backwards compatibility
with applications." But the real syntax[5] is: login name must not
begin with a hyphen (`-'), and cannot contain 8-bit characters, tabs or
spaces, or any of these symbols: `,:+&#%^()!@~*?<>=|\/";'. The dollar
symbol (`$') is allowed only as the last character for use with Samba.
No field may contain a colon (`:') as this has been used historically
to separate the fields in the user database.

IBM AIX has these rules[6]: must not begin with a hyphen (-), plus sign
(+), at sign (@), or tilde (~). Additionally, do not use any of the
following characters within a user-name string: :"#,=\/?'`
Finally, the login parameter cannot contain any space, tab, or newline
characters.

On HP-UX user names are restricted[8] to eight characters and group
names to 16 character ut you may change limits up to 254 characters.
Anyway, it must start with a letter.

Kerberos syntax for principal[9] is GeneralString constrained to
contain only characters in IA5String (so, basically US-ASCII 7 bits),
with this note: US-ASCII control characters should not be used.

So, I think any sequence of unicode "printable" letters should be
allowed. It may be encoded in UTF-8 or other encoding, but I think UTF-
8 is the best encoding since in includes the US-ASCII 7 bit chars.
About the meaning of "printable", probably this means a few unicode
categories[7] should be included: lowercase letter, uppercase letter,
decimal number, plus a few symbols (hyphen, period, plus, at sign, and
underscore at minimum).

Bye,
Giuseppe

[0]https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/bb726984(v=technet.10)?redirectedfrom=MSDN
[1]https://docs.oracle.com/cd/E88353_01/html/E37852/passwd-5.html#REFMAN5passwd-5
[2]https://www.rfc-editor.org/rfc/rfc4519#section-2.39
[3]https://docs.ldap.com/specs/rfc4517.txt
[4]https://docs.freebsd.org/en/books/handbook/basics/#users-synopsis
[5]https://man.freebsd.org/cgi/man.cgi?query=passwd&sektion=5&format=html
[6]https://www.ibm.com/docs/en/aix/7.2?topic=u-useradd-command
[7]https://www.compart.com/en/unicode/category
[8]https://support.hpe.com/hpesc/public/docDisplay?docId=c01922594&docLocale=en_US
[9]https://www.rfc-editor.org/rfc/rfc4120#section-5.2.1

Reply via email to