Klemens Nanni wrote: > On Thu, Nov 01, 2018 at 02:56:38PM -0400, Ted Unangst wrote: > > this looks to be in the wrong order. if 1000 is a username, that should be > > matched first before numeric lookup. > Preferring UIDs indeed clobbers usernames with the respective numerical > username. > > However, other parts in base such as getent(1) treat UIDs with higher > priority and behave like that already:
yes, there are inconsistencies, but that just means there's more to fix. :) i don't have the section handy, but i believe this is specced by posix. usernames are first priority, then if no match, numeric match is attempted. chown actually documents this: The owner may be either a numeric user ID or a user name. If a user name is also a numeric user ID, the operand is used as a user name. The group may be either a numeric group ID or a group name. If a group name is also a numeric group ID, the operand is used as a group name.