X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: 1.7.1: dash/ash test -x broken? Date: Wed, 10 Feb 2010 15:37:18 +0000 (UTC) Lines: 50 Message-ID: References: <1265746240 DOT 20790 DOT ezmlm AT cygwin DOT com> <4B721A11 DOT 8050108 AT byu DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Cobb, Christopher (Contr) (IS ngc.com> writes: > $ dash -c "test -x '$JAVACMD';"' echo $?' > 1 > > $ ash -c "test -x '$JAVACMD';"' echo $?' > 1 dash and ash are identical. > $ getfacl.exe "$JAVACMD" > # file: /c/Program Files/Java/jdk1.5.0_18/bin/java > # owner: Administrators > # group: SYSTEM > user::rwx > group::rwx > group:Users:r-x > group:Power Users:rwx > mask:rwx > other:--- > > $ stat "$JAVACMD" > File: `/c/Program Files/Java/jdk1.5.0_18/bin/java' > Size: 53344 Blocks: 56 IO Block: 65536 regular file > Device: 548b6deeh/1418423790d Inode: 1407374883580908 Links: 1 > Access: (0770/-rwxrwx---) Uid: ( 544/Administrators) Gid: ( 18/ > SYSTEM) > Access: 2010-02-09 16:23:09.702221400 -0500 > Modify: 2009-02-25 01:47:30.000000000 -0500 > Change: 2009-11-19 15:03:03.707455600 -0500 > > $ id > uid=720693(cobbch) gid=10513(Domain_Users) > groups=0(root),544(Administrators),545(Users),1004(SophosUser) Yep - it's an ACL issue. Since you (cobbch) are not the owner (Administrators), and your group membership (root, Administrators, Users, SophosUser) does not include the group owner (SYSTEM), and since the mode does not grant any permissions to others, dash's use of stat() thinks you have no rights. But in reality, the ACLs state that anyone in group users (which includes you) has additional rights beyond what stat() can see, and hence euidaccess() (which bash uses) gives the correct answer. I've reported this upstream. Meanwhile, I guess that means its time for me to respin a dash package. Thanks for the report. -- Eric Blake volunteer cygwin dash maintainer -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple