tech-userlevel archive

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

Re: find(1) and group/user handling



On Sun, Jun 12, 2016 at 08:10:27PM +0800, Paul Goyette wrote:
 > In my opinion, the -user and -group primaries should work strictly with
 > _names_, and _never_ fallback to {u,g}id values;  we could easily add
 > new primaries -uid and -gid to search for the numeric values.  However,
 > this would make find(1) incompatible with existing versions.
 > 
 > Comments?

I agree; ambiguating what things do is usually not a good idea,
because eventually the result is that it does something you don't
expect and then you have to figure out both what it thought you meant
and what it did.

Maybe find . -user 123 should print "Warning: treating "123" as uid;
use -uid".

Usernames can't in practice begin with + and - because this conflicts
with the NIS "compat" syntax in the password file; also getty rejects
usernames beginning with - ever since someone discovered that logging
in as "-froot" would cause getty to exec "login -froot", and many
other programs that take usernames would interpret them as options
with unwanted results. So I wouldn't worry about that part.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index