[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getpwent, user-full-name and utf-8

From: David Kastrup
Subject: Re: getpwent, user-full-name and utf-8
Date: Thu, 22 Mar 2007 08:40:07 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Jan Djärv <address@hidden> writes:

> David Kastrup skrev:
>> Eli Zaretskii <address@hidden> writes:
>>>> From: David Kastrup <address@hidden>
>>>> Date: Wed, 21 Mar 2007 10:58:08 +0100
>>>> I propose that we bite the bullet, assume a fixed external system
>>>> encoding of utf-8 for such strings, and recode accordingly.
>>> I'd rather assume that usernames are encoded in the locale's
>>> encoding, not necessarily in UTF-8.
>> That assumes that every user operates under the same locale, and that
>> this locale agrees with the locale of the system files.  In particular
>> on multi-user machines, that is not realistic.
> Since users themselves can set their full name,

Since when?

Well, I took a look at the manual page of passwd(1) on my GNU/Linux
system, and the description indeed says:

        passwd also changes account information, such as the full
        name of the user, the user's login shell, or his/her
        password expiry date and interval.

Amusingly, however, there is no option for doing any of that except
the password related stuff.

There is, however,

CHFN(1) -- 06/06/2006 -- User Commands

        chfn - change real user name and information


        chfn [-f full_name] [-r room_no] [-w work_ph] [-h home_ph]
                [-o other] [user]


        chfn changes user fullname, office number, office extension,
        and home phone number information for a user's account. This
        information is typically printed by finger(1) and similar
        programs. A normal user may only change the fields for her
        own account, subject to the restrictions in
        /etc/login.defs. (The default configuration is to prevent
        users from changing their fullname.) The super user may
        change any field for any account. Additionally, only the
        super user may use the -o option to change the undefined
        portions of the GECOS field.

        The only restriction placed on the contents of the fields is
        that no control characters may be present, nor any of comma,
        colon, or equal sign. The other field does not have this
        restriction, and is used to store accounting information
        used by other applications.

So with the default settings, a user can't change his settings.

> I'd think the user locale would be a good choice.

It is not the worst choice, but I consider it likely that a better way
would be something like a separate "system locale".  For lack of
better information, one could let it default to the user locale, but
it should be at least configurable separately.

Does anybody have access to the X/Open or Posix specs?  Maybe
something is said about this in there.

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]