www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/10/10:40:20

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 <ebb9 AT byu DOT net>
Subject: Re: 1.7.1: dash/ash test -x broken?
Date: Wed, 10 Feb 2010 15:37:18 +0000 (UTC)
Lines: 50
Message-ID: <loom.20100210T163251-908@post.gmane.org>
References: <1265746240 DOT 20790 DOT ezmlm AT cygwin DOT com> <EADE84D0102AB145A5BEA7A5A00CD90101FB9DE1 AT XMBIL131 DOT northgrum DOT com> <4B721A11 DOT 8050108 AT byu DOT net> <EADE84D0102AB145A5BEA7A5A00CD90101FB9DE2 AT XMBIL131 DOT northgrum DOT com>
Mime-Version: 1.0
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: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <Christopher.Cobb <at> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019