www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/18/17:52:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
From: Benoit Rochefort <Benoit DOT Rochefort AT gerad DOT ca>
MIME-Version: 1.0
Message-ID: <16193.19010.57678.857942@scicily.montreal.ad-opt.com>
Date: Mon, 18 Aug 2003 17:50:58 -0400
To: "Gerrit @ cygwin" <cygwin AT cygwin DOT com>
Cc: Benoit Rochefort <Benoit DOT Rochefort AT gerad DOT ca>, benoitr AT ad-opt DOT com
Subject: Re: -x weirdness
In-Reply-To: <197-1578450001.20030818232842@familiehaase.de>
References: <16193 DOT 14627 DOT 802702 DOT 855384 AT scicily DOT montreal DOT ad-opt DOT com>
<197-1578450001 DOT 20030818232842 AT familiehaase DOT de>
Reply-To: benoitr AT ad-opt DOT com
X-OriginalArrivalTime: 18 Aug 2003 21:51:00.0107 (UTC) FILETIME=[CFD7CDB0:01C365D2]
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h7ILqAp30717

But you tested on *YOUR* /usr/bin/bash, what is your id and
the permissions setted on your /usr/bin/bash program? Read
carefully the output I sent (especially file
mode/owner/group). May be you can make a similar test on
another program that you set the permissions/owner/group as
I have?

As pointed out, that doesn't explain the matter with
/usr/bin/test which is also reporting /usr/bin/bash as
beeing non-executable.

To help you help me:

###############################################################################
$ perl -v

This is perl, v5.8.0 built for cygwin-multi-64int

Copyright 1987-2002, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
###############################################################################

This is the latest perl I got from "setup" on cygwin.com.
ftp%3a%2f%2farchive.progeny.com%2fcygwin/release/perl/perl-5.8.0-3.tar.bz2


Gerrit P. Haase wrote:
 > Hallo Benoit,
 > 
 > you wrote:
 > > When I installed cygwin, permissions on all the distribution looks like:
 > 
 > > ###############################################################################
 > > $ ls -al /usr/bin/bash
 > > -rwx------+   1 Administ Domain U   531968 Mar 13 04:29 /usr/bin/bash*
 > > ###############################################################################
 > 
 > > As you can see, even if I am:
 > 
 > > ###############################################################################
 > > $ id 
 > > uid=17199(benoitr) gid=10513(Domain Users) groups=10513(Domain Users),11121(Exceed Users)
 > > ###############################################################################
 > 
 > > I can however run bash and every other programs. I suppose
 > > it is a Windoze weirdness. But, what is interesting is "How
 > > can I know if a program can be executed"? Often, I write
 > > scripts where the flow of control depend on the availability
 > > of a particular program.
 > 
 > > So check this out:
 > 
 > > ###############################################################################
 > > $ [ -x /usr/bin/bash ]; echo $?
 > > 0
 > > $ /usr/bin/test -x /usr/bin/bash; echo $?
 > > 1
 > > $ perl -e 'print -x "/usr/bin/bash" ? 0 : 1 , "\n"'
 > > 1
 > > ###############################################################################
 > 
 > > I guess only bash is correct...
 > 
 > > Looking at the source code of bash (in test.c), we discover
 > > what seems to be the "correct" way of guessing if a program
 > > can be executed:
 > 
 > >     case 'x':                   /* File is executable? */
 > >       return (EACCESS (arg, X_OK) == 0);
 > 
 > > where EACCESS is:
 > 
 > > #if defined (AFS) || defined (__CYGWIN__)
 > > #  define EACCESS(path, mode)   access(path, mode)
 > > #else
 > > #  define EACCESS(path, mode)   test_eaccess(path, mode)
 > > #endif /* AFS */
 > 
 > 
 > > I'd like to know if:
 > 
 > > Someone will notice and eventually correct the bug
 > 
 > > - or -
 > 
 > > I'm wrong, this is not a bug
 > 
 > > - or -
 > 
 > > Tell me a way to interprete these results.
 > 
 > > Do I have to mail this problem to a perl mailing list?
 > 
 > Nope. Seems to be a bug in your perl version.  Which version are you
 > using right now?  I consider the 5.8.0 series will be removed from the
 > mirrors soon, I was not very happy with it.  5.6.1-2 will stay and
 > eventually be updated to use cygwin-1.5.2 and probably also some day
 > in future there will be a 5.6.2 release, I'll look into this issue if
 > it is a bug in 5.6.x, and my 5.8.1-tobe snapshot with cygwin 1.5.2
 > does it the correct way: 
 > 
 > $ perl -e 'print -x "/usr/bin/bash" ? 0 : 1 , "\n"'
 > 0
 > $ perl -e 'print -x "/usr/bin/bash.exe" ? 0 : 1 , "\n"'
 > 0
 > $ perl -v
 > 
 > This is perl, v5.8.1 built for cygwin-multi-64int
 > (with 1 registered patch, see perl -V for more detail)
 > ...
 > 
 > 
 > Gerrit
 > -- 
 > =^..^=

-- 
           *º¤., ¸¸,.¤º*¨¨¨*¤  Benoit Rochefort  *º¤., ¸¸,.¤º*¨¨¨*¤


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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