bug-coreutils
[Top][All Lists]
Advanced

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

RFC: change chown *not* to look up numeric user/group names


From: Jim Meyering
Subject: RFC: change chown *not* to look up numeric user/group names
Date: Thu, 19 Oct 2006 11:29:23 +0200

In <http://bugs.debian.org/393283>, Helge Hafting objected to the fact
that GNU chown performs a DB look-up for a numeric "user name", e.g., in
"chown 0 FILE".  chown does this deliberately, in case "0" is an actual
user *name*, that is associated potentially, with some numeric user ID.
That is the historical behavior, and it is required for POSIX conformance.

Yes, that does sound silly, if not downright wrong.  Who actually uses
numeric user or group names these days?  Of the systems that still allow
such names, how many actually require or even use that capability?

I propose to change GNU chown to perform that look-up of an all-numeric
"user" or "group" string only when the POSIXLY_CORRECT envvar is set.
Otherwise, (when POSIXLY_CORRECT is not set and a "name" is a valid user
ID or group ID), chown would use the value obtained from converting the
string with a function like strtoul.

For consistency, the same policy would apply to chgrp.

My motivation for making this change is mainly security.
The paranoid user of chown (usually root) should not have to imagine
that a numeric user name argument like "1000" might be interpreted as
a name and mapped to "0".

Can anyone present a case for *not* making this change?




reply via email to

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