From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31848 invoked by alias); 21 Feb 2014 21:37:19 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 31835 invoked by uid 89); 21 Feb 2014 21:37:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Feb 2014 21:37:17 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 56711520412; Fri, 21 Feb 2014 22:37:15 +0100 (CET) Date: Fri, 21 Feb 2014 21:37:00 -0000 From: Corinna Vinschen To: cygwin-apps@cygwin.com Subject: Re: HEADSUP: New getent tool to read passwd and group data Message-ID: <20140221213715.GG2246@calimero.vinschen.de> Reply-To: cygwin-apps@cygwin.com Mail-Followup-To: cygwin-apps@cygwin.com References: <20140220193814.GU2246@calimero.vinschen.de> <025d01cf2f2d$014b0040$03e100c0$@ieee.org> <20140221202745.GE2246@calimero.vinschen.de> <20140221211020.GF2246@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nBU79UIGV2yWqiI+" Content-Disposition: inline In-Reply-To: <20140221211020.GF2246@calimero.vinschen.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-02/txt/msg00047.txt.bz2 --nBU79UIGV2yWqiI+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1916 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 Ad= ministrator, which the user can set any which way in passwd. > > > So we lookup the SID (not the username) to get the uid (or gid). > >=20 > > 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? > >=20 > > > 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?=20 > >=20 > > 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: > >=20 > > $ getent passwd | grep ',S-1-5-32-544:' > >=20 > > $ getent group | grep ':S-1-5-18:' >=20 > 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: >=20 > $ 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/A= dministrators:/bin/bash Btw., ssh-host-config is using the value 544 to chgrp /var/empty for many years already, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --nBU79UIGV2yWqiI+ Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJTB8cLAAoJEPU2Bp2uRE+g9DYP/juLPxYplX6zapgW+ySMhv32 k9/xbDlHsJday6IyCdMXeQ6ZN60dnxGanOqEaj3xQ8HKKCC69Rg4rrTeWM6nItRt +4jaktXbplI5L+cDNHMDqZiVEUBqpbRGpCeqwXHQkb423yiGhIGuZ2Z+VOVPIMG0 8oE7+RurLvBgCCYpE+Pbd19NvBWuzYG7h5ID8FbRME7nWqzEZXv7vEl5LfR3YPO4 FBMvmxfnMSMzpPz4o8uHsWJm81wkpM2hxG3j8N0ONqTVSZZXWnMqZ5ytHsK3HZzS DwA+AvKpTFyApsaqqo0qu+8IX82/QoemXXng2/GMq1Rp8QYNJHavhMcE7boYubeZ Gk6P4s93zpyN/KE+Y+F2FelkbOuU+Z2dsU5kURM/H99fzfGBXXhSgWhB6LLqriRp 3WIhd/+RveHuv6ExBNK6M2TUQ/oZoshy3NGC6GeCTPkFGoEj6bH0NbiV+Jwadc/9 hk/ay4Im4I5CQPfM28IoXXmsGHNfyAQZBJTmhjhVjaA1g1lahIlOkKKG8uIxDUC0 XES7+x2bm/1o5/Y8b/HQFFb4jhK/p8z/X11osr9h6UYuKVK5PZMcMV+B+fuzeD1o pVMEOypViR2R1PHeOacEBTFurkWHuB52NC+Ar0fRBlaOT4Ld2GXXy02uosuwjVG9 37lqeN1wD6KY5b1iAW9Q =40nt -----END PGP SIGNATURE----- --nBU79UIGV2yWqiI+--