Re: allowing dots in user names
* Steinar H. Gunderson:
> On Sat, Nov 27, 2004 at 02:38:32PM +0100, Marc Haber wrote:
>> Is there any valid reason why I should refrain from doing so?
>
> I guess many people still use "chown foo.bar" (instead of chown foo:bar),
> which will probably get confused by dots in "foo".
Fortunately, parse_user_spec in recent corutils versions seems to do
the right thing:
/* Extract from NAME, which has the form "[user][:.][group]",
a USERNAME, UID U, GROUPNAME, and GID G.
Either user or group, or both, must be present.
If the group is omitted but the ":" separator is given,
use the given user's login group.
If SPEC_ARG contains a `:', then use that as the separator, ignoring
any `.'s. If there is no `:', but there is a `.', then first look
up the entire SPEC_ARG as a login name. If that look-up fails, then
try again interpreting the `.' as a separator.
Reply to: