[Rpm-maint] Verify when two usernames use the same UID

Michael Schroeder mls at suse.de
Mon Jun 23 12:53:57 UTC 2014


[Back from vacation...]

On Fri, Jun 06, 2014 at 11:19:40AM +0300, Panu Matilainen wrote:
> Come to think of it, in the scenario described in the ticket doing the 
> exact opposite (looking up expected UID based on the username from package 
> and comparing with on-disk UID) would do the right thing.
>
> But when there are multiple UIDs with same name, that would get unreliable 
> results whereas the current "algorithm" gets it right.

Having multiple UIDs with the same name never was supported, but
multiple users sharing some uid used to be a supported setup.

Thus tools like 'screen' do a getpwnam on the $LOGNAME (and then
verify that the uid matches) to get the correct password entry
instead of doing a getpwuid on the uid of the process.

Cheers,
  Michael.

-- 
Michael Schroeder                                   mls at suse.de
SUSE LINUX Products GmbH,  GF Jeff Hawn, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}


More information about the Rpm-maint mailing list