Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Wed, 5 Mar 2003 19:45:56 -0500 From: "Pierre A. Humblet" To: cygwin AT cygwin DOT com Subject: Re: bash 'test -x' gives incorrect results with group permissions? Message-ID: <20030306004556.GA442795@hpn5170x> Mail-Followup-To: "Pierre A. Humblet" , cygwin AT cygwin DOT com References: <003d01c2e35b$ad5e4240$0101a8c0 AT newt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003d01c2e35b$ad5e4240$0101a8c0@newt> User-Agent: Mutt/1.4i On Wed, Mar 05, 2003 at 04:10:35PM -0500, Eric Tiffany wrote: > > I encountered a perplexing situation with file permissions. I am running > cygwin 1.3.20 and bash 2.05b.0(8). > > I have an executable with the following permissions: > > $ ls -ln /c/j2sdk1.4.1_01/bin/java > > -rwxrwx---+ 1 544 18 24672 Sep 30 03:08 > /c/j2sdk1.4.1_01/bin/java > > And here is my user info: > > $ id > > uid=1006(Eric Tiffany) gid=513(None) > groups=513(None),544(Administrators),545(Users) > > If I run getfacl, I see the following: > > $ getfacl.exe -a /c/j2sdk1.4.1_01/bin/java > getfacl.exe -a /c/j2sdk1.4.1_01/bin/java > # file: /c/j2sdk1.4.1_01/bin/java > # owner: Administrators > # group: SYSTEM > user::rwx > group::rwx > group:Users:r-x > mask:rwx > other:--- > > I can execute the file from the command line. > > However, if I say 'test -x /c/j2sdk1.4.1_01/bin/java' in a script, it > returns false. This seems wrong just based on the fact that I actually can > exec the file. However, it also seems to contradict the permissions set for > the file, if I am interpreting the results of getfacl correctly. > > Is this a bug? or a feature? I know of no POSIX call that can reliably detect that situation. access() on Cygwin will bend POSIX a little and do it. So, as Igor wrote, this issue will be fixed but it will be necessary to also patch /bin/test and bash. Pierre -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/