HEADSUP: New getent tool to read passwd and group data

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Feb 21 21:37:00 GMT 2014


On Feb 21 22:10, Corinna Vinschen wrote:
> On Feb 21 21:27, Corinna Vinschen wrote:
> > On Feb 21 12:47, Pierre A. Humblet wrote:
> > > For packages such as exim we need to find the uid of System and of Administrator, which the user can set any which way in passwd.
> > > So we lookup the SID (not the username) to get the uid (or gid).
> > 
> > The SID of the administrator or the SID of the administrors group?
> > The SID of the local administrator makes only marginal sense to me.
> > What do you need it for?
> > 
> > > Is there an equivalent mechanism using getent ?
> > > Else, could Cygwin disregard the passwd entries for these 2 users and use only the fixed values determined by the mapping from Windows? 
> > 
> > You should not have to expect a name change for the SYSTEM and the
> > Administrators account.  It should be entirely sufficient to check for
> > the user Administrator and the user SYSTEM or +SYSTEM.  If you really
> > want to check by SID, feel free to enumerate all accounts by just
> > omitting the username and scan for the SID you're looking for:
> > 
> >   $ getent passwd | grep ',S-1-5-32-544:'
> > 
> >   $ getent group | grep ':S-1-5-18:'
> 
> Btw., the uids and gids are fixed values in the new model and they are
> probably never changed by most users of /etc/passwd and /etc/group
> either.  I think it's perfectly sensible to check for uid 18 when
> looking for system, for instance:
> 
>   $ getent passwd 18
>   +SYSTEM:*:18:18:U-NT AUTHORITY\SYSTEM,S-1-5-18:/home/SYSTEM:/bin/bash
>   $ getent passwd 544
>   +Administrators:*:544:513:U-BUILTIN\Administrators,S-1-5-32-544:/home/Administrators:/bin/bash

Btw., ssh-host-config is using the value 544 to chgrp /var/empty
for many years already,


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20140221/98002e52/attachment.sig>


More information about the Cygwin-apps mailing list