X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 	tests=AWL,BAYES_00,SPF_SOFTFAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4B721A11.8050108@byu.net>
Date: Tue, 09 Feb 2010 19:29:37 -0700
From: Eric Blake <ebb9@byu.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin@cygwin.com, Christopher.Cobb@ngc.com
Subject: Re: 1.7.1: dash/ash test -x broken?
References: <1265746240.20790.ezmlm@cygwin.com> <EADE84D0102AB145A5BEA7A5A00CD90101FB9DE1@XMBIL131.northgrum.com>
In-Reply-To: <EADE84D0102AB145A5BEA7A5A00CD90101FB9DE1@XMBIL131.northgrum.com>
Content-Type: multipart/signed; micalg=pgp-sha1;  protocol="application/pgp-signature";  boundary="------------enigA133BD49597DC7B9A026962B"
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

--------------enigA133BD49597DC7B9A026962B
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

According to Cobb, Christopher (Contr) (IS) on 2/9/2010 1:30 PM:
> I recently upgraded to 1.7.1.
>=20
> I have noticed that dash/ash shell scripts which test for the
> executability of files don't work.  For example, the maven build
> application comes with a 'mvn' script which contains this line:
>=20
>    if [ ! -x "$JAVACMD" ] ; then
>       print error message
>    fi

Works for me with all my testing so far:

$ touch f1 f2
$ chmod 000 f1
$ chmod 777 f2
$ bash -c 'test -x f1; echo $?'
1
$ bash -c 'test -x f2; echo $?'
0
$ dash -c 'test -x f1; echo $?'
1
$ dash -c 'test -x f2; echo $?'
0

For me to reproduce your failure, I would need more details.  I'm
wondering if it might be an ACL issue.  What do 'id', 'stat "$JAVACMD"',
and 'getfacl "$JAVACMD"' state about the permissions on that file and the
permissions you are supposed to be able to have?

That said, I haven't yet looked into the source code; if it IS an ACL
issue, then it is a question of dash using stat() instead of access() (or
even better, euidaccess/faccessat).

--=20
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net


--------------enigA133BD49597DC7B9A026962B
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktyGhQACgkQ84KuGfSFAYAGbACcCxDF6S4OsCw3+ld2slqARTte
9gQAnizXPNOVi74l8izFUvepy7rcfzrB
=WmEq
-----END PGP SIGNATURE-----

--------------enigA133BD49597DC7B9A026962B--
