From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90164 invoked by alias); 11 Sep 2015 11:10:16 -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 90155 invoked by uid 89); 11 Sep 2015 11:10:16 -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 11:10:15 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id D12A0A80364; Fri, 11 Sep 2015 13:10:12 +0200 (CEST) Date: Fri, 11 Sep 2015 11:10:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Group Permissions on root folders problem (Windows 10 TP build 10061) Message-ID: <20150911111012.GF26699@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="f61P+fpdnY2FZS1u" Content-Disposition: inline In-Reply-To: <20150911190414.e77404dc09587954644ab65d@nifty.ne.jp> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-09/txt/msg00181.txt.bz2 --f61P+fpdnY2FZS1u Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2560 Hi Takashi, On Sep 11 19:04, Takashi Yano wrote: > Hi Corinna, >=20 > Regarding the first problem: > > > a) Group permissions on root folders >=20 > On Sun, 6 Sep 2015 13:44:44 +0200 > Corinna Vinschen wrote: > > The group permission problem is easy (and I'm wondering if it really was > > such a bright idea to let user SID =3D=3D group SID slip through in Cyg= win, > > rather tnan sticking to the former idea to change the group SID to > > "Users" in this case). csih needs a patch to not check for the group > > x bit if user SID =3D=3D group SID. >=20 > Do you intend a patch like this? I have confirmed that sshd > is successfully installed and works nicely with this patch > under a Microsoft Account. >=20 > --- cygwin-service-installation-helper.sh.orig 2015-02-24 04:57:56.000000= 000 +0900 > +++ cygwin-service-installation-helper.sh 2015-09-11 18:41:56.870882800 += 0900 > @@ -2442,6 +2442,8 @@ > # =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 perms=3D"d..x..x..[xt]" > + > csih_stacktrace "${@}" > $_csih_trace > if [ "$_csih_setup_already_called" -eq 0 ] > @@ -2462,7 +2464,13 @@ > csih_error "Problem with LocalSystem or Adminstrator IDs" > fi >=20=20 > - if ! csih_check_dir_perms "${LOCALSTATEDIR}" "d..x..x..[xt]" > + if [ `/usr/bin/stat -c '%g' ${LOCALSTATEDIR}` -eq \ > + `/usr/bin/stat -c '%u' ${LOCALSTATEDIR}` ] > + then > + perms=3D"d..x.....[xt]" > + fi > + > + if ! csih_check_dir_perms "${LOCALSTATEDIR}" "${perms}" > then > csih_error "Problem with ${LOCALSTATEDIR} directory. Exiting." > fi 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 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}" ] ... Can you check if that works in your env and perhaps create a new patch using the SIDs? Thanks a lot, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --f61P+fpdnY2FZS1u Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJV8raUAAoJEPU2Bp2uRE+g2I8P/1JHS7JVQFNp26P0+xrmCntf HhEP0jlC1OvEj1w9IU1NrU7l39tWm7Mqu7Q0e6zEaqJsmkEUgkXwbJlqZGnxoe9G wPQqXNwap9530q390zHuptq66lR/qfw/dUjaBNa4F00KzvwBQn9wlBn20WmRhcb3 cOd+X5HV2+TlXDQ4VKbQX9hkgFngDg0TJMhCjF79amZu5Q9DqHzYG1f5O+LeDMy/ pD8XH4DiUc3XOKL5j592ichODf0Z5L25TQveU7oYD8RAQ8aC9jmMvDn5L3CKEas5 keSleH/c58Cq9BfzTuRpeECs+Xa875rxHJcmnYmfVbSPQtSu4q+c6zfGGWYRpyOA pzMu5euwQIza5/Mvn6lLthY+COWlfp2aZHH+6pd7c/cZLxyn850QtyFtDTAoDZPj W0zqcAohJQ03Rw9nWg0bn/6tOYgNM4BKFJmz7HAC2P8LO6eLIHYbgXhr0uMdb290 Bacg//SNjYoy+CizZJtarx4Z8lZU7EXeACL1EMMIJSRQ1esnj7dD4vybDzoYhcME p0cmN8JsVc4iqqYcAa4KXgDHtJ1AJgjUQg5u6BLWqltj0SytXnzDeJyKS+3vqe4h wIpPCfWlX4IaoDNCBsicKiHSHhiLezq0zMm/ilM8GVgYDMUZsu42MpJaJgCsDw7b hL1YNwh0A3GCjLh2SmtH =G83a -----END PGP SIGNATURE----- --f61P+fpdnY2FZS1u--