Subject: Re: -x weirdness
From: "Gerrit P. Haase" <[email-masked]>
To: Benoit Rochefort <[email-masked]>
Cc: "Gerrit @ cygwin" <[email-masked]>
Date: Tue, 19 Aug 2003 01:32:52 +0200

Hallo Benoit,

Am Montag, 18. August 2003 um 23:50 schriebst du:

> 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?

I see, sorry.

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

>>> $ 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)

#gerrit@loreley /tmp/perl/perl-5.8.1
$ ls -al .patch
-rwx------    1 #gerrit  Domänen-Admins        6 Aug 15 18:51 .patch*

$ [ -x .patch ]; echo $?
0

$ /usr/bin/test -x .patch; echo $?
0

$ perl -e 'print -x ".patch" ? 0 : 1 , "\n"'
0

Hmm, the file is mine, I'm the domain-admin, I get '0', your file is
owned by Administrastor and domain user is the group, you're not
Administrator so you get 1 from this perl snippet, what is wrong about
this?

Well, you said you still can execute bash.exe, test reports it as
executable.  Since Windows ACLs are very fine grained you may have the
permission to execute it, regardless what Cygwin ls displays , there
is just a subset of the windows ACLs displayed, e.g. a file may be
accessed by several groups and you may set the ACL different for each
group.

What are the bash.exe permissions beyond what ls is displaying?  Which
Windows version do you use?  What says getfacl about your bash.exe?

If I login as another user I get '1' and it is consistently:

ismene2@loreley /tmp/perl/perl-5.8.1
$ id
uid=1008(ismene2) gid=513(Domänen-Benutzer) groups=513(Domänen-Benutzer),545(Benutzer),10513(Domänen-Benutzer)

$ ls -al .patch
-rwx------    1 #gerrit  Domänen-Admins        6 Aug 15 18:51 .patch

$ [ -x .patch ]; echo $?
1

$ /usr/bin/test -x .patch; echo $?
1

$ perl -e 'print -x ".patch" ? 0 : 1 , "\n"'
1

If I try to execute as the other user I get:
$ ./.patch
-bash: ./.patch: Permission denied

$ getfacl .patch
# file: .patch
# owner: #gerrit
# group: Domänen-Admins
user::rwx
group::---
mask:rwx
other:---

Gerrit
-- 
=^..^=

--
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/