From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78620 invoked by alias); 11 Sep 2015 15:18:24 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 78612 invoked by uid 89); 11 Sep 2015 15:18:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY autolearn=no 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, 11 Sep 2015 15:18:23 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id C11E6A80364; Fri, 11 Sep 2015 17:18:20 +0200 (CEST) Date: Fri, 11 Sep 2015 15:18:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Group Permissions on root folders problem (Windows 10 TP build 10061) Message-ID: <20150911151820.GH26699@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20150616155843.GE31537@calimero.vinschen.de> <20150905155916.8403bea8d4f631c1f7a314e3@nifty.ne.jp> <20150906114444.GA27066@calimero.vinschen.de> <20150911190414.e77404dc09587954644ab65d@nifty.ne.jp> <20150911111012.GF26699@calimero.vinschen.de> <20150911213346.669fe6bed769b79a4afea225@nifty.ne.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hAW+M2+FUO+onfmf" Content-Disposition: inline In-Reply-To: <20150911213346.669fe6bed769b79a4afea225@nifty.ne.jp> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-09/txt/msg00190.txt.bz2 --hAW+M2+FUO+onfmf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2418 On Sep 11 21:33, Takashi Yano wrote: > Hi Corinna, >=20 > On Fri, 11 Sep 2015 13:10:12 +0200 > Corinna Vinschen wrote: > > In theory, yes. The problem is just that checking the uid/gid equality > > is not safe, given that you can easily create that via passwd/group > > files. What I was thinking of is to convert the uid/gid values into > > SIDs using the `getent' tool and to compare those, along the lines of > >=20 > > uid=3D$(/usr/bin/stat -c '%u') > > user_sid=3D$(getent passwd -w $uid | awk -F: '{print $4}') > > gid=3D$(/usr/bin/stat -c '%g') > > grp_sid=3D$(getent group -w $gid | awk -F: '{print $4}') > > if [ "${user_sid}" =3D "${grp_sid}" ] > > ... > >=20 > > Can you check if that works in your env and perhaps create a new patch > > using the SIDs? >=20 > I have made a new patch and confirmed that it also works. >=20 >=20 > --- cygwin-service-installation-helper.sh.orig 2015-02-24 04:57:56.000000= 000 +0900 > +++ cygwin-service-installation-helper.sh 2015-09-11 21:30:08.539361900 += 0900 > @@ -2442,6 +2442,12 @@ > # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > _csih_setup() > { > + local uid > + local gid > + local user_sid > + local grp_sid > + local perms=3D"d..x..x..[xt]" > + > csih_stacktrace "${@}" > $_csih_trace > if [ "$_csih_setup_already_called" -eq 0 ] > @@ -2462,7 +2468,17 @@ > csih_error "Problem with LocalSystem or Adminstrator IDs" > fi >=20=20 > - if ! csih_check_dir_perms "${LOCALSTATEDIR}" "d..x..x..[xt]" > + uid=3D$(/usr/bin/stat -c '%u' ${LOCALSTATEDIR}) > + gid=3D$(/usr/bin/stat -c '%g' ${LOCALSTATEDIR}) > + user_sid=3D$(/usr/bin/getent -w passwd $uid | awk -F: '{print $4}') > + grp_sid=3D$(/usr/bin/getent -w group $gid | awk -F: '{print $4}') > + > + if [ "${user_sid}" =3D "${grp_sid}" ] > + then > + perms=3D"d..x.....[xt]" > + fi > + > + if ! csih_check_dir_perms "${LOCALSTATEDIR}" "${perms}" > then > csih_error "Problem with ${LOCALSTATEDIR} directory. Exiting." > fi Thank you, patch applied. Heading into vacation now. Have fun, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --hAW+M2+FUO+onfmf Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJV8vC8AAoJEPU2Bp2uRE+gbkMQAJi8zR1Jsutz5StN6pINzLxO +WJ6RlNSFEW+JwslfhOibOGr+29XDySRR/f3FCnmajY/yV5Udwgjb2kqs+OXLDve ++M0qlABlFS4ZqqrHkudQ9NMekiD6p1wIOUrYERcWHIgWjPz5JAmIMfGXFMOnmMI Ylgfqs2UeSc92cT8Tu8yOvUQsJqbJLuvlAn+BhVKxDR+9Tc62pmHxyBL9twIFADb rYfIyYK3Ek+Tembccnk2TBSFVSsRzZHKDJ3wN/u7tvngtoo/iIW7i+OOI/0BjLZ4 g40MKvNOptJQ/GFjkHWI5CgSowTLihKvqeGQdGbZvwUi0K1DbMNnjFVcpXy+qzrI +acoJgcH6Yhd/8z+PUHDERXHufmTP2ngtxTnkrG7iFG+RWOLd131hkNPfDZy7Lt6 WpbloDGupS29sBSGeSHl3Gd6u7V7qgO4QLG2+WGbyNJYx8zwphBcLJoLWsuprpDR /1/YEIwBSPjmkO66xYn2Zi2klC/IaGwyWU/CbZy1v3zUBn+1lhMzAYHMrWMkxbkM Dd+smTSLzL8T02D6EvJoINV9qq9Z6vhgL3d3eZa72fMAywn+aAQWqZc5LcRd/t04 dnvSglgMAc2LlswhNnI49/UcBLLrP0tlayGFdzj3VMvLvB4Hw268ukEbeJBdIszf l+x27MT7CURfAolTR646 =lW6c -----END PGP SIGNATURE----- --hAW+M2+FUO+onfmf--