Executable bit check

Eric Blake eblake@redhat.com
Thu Nov 4 22:02:00 GMT 2010

On 11/04/2010 03:57 PM, Illia Bobyr wrote:
> $ ll abc
> -rw-r--r--+ 1 ibobyr Domain Users Nov 21  4 16:44 abc

See that +?  That means there are ACLs in play.

> $ test -x abc && echo Executable
> Executable

Likely, one of those ACLs is still making the file executable.

What does 'getfacl abc' say?

> $ ./abc
> Hm...

One other thing to point out.  This will happen on FAT and other
brain-dead filesystems that lack true execute bits, where chmod -x has
no effect (since there's no bit to disable), such that cygwin always
represents the file as executable on those file systems if it has a
she-bang (well, depending on your mount options).  But given that FAT
also doesn't support ACLs, it's not the problem you are facing.

> For me the most annoying part is that "test -x" says that I can execute 
> a file that I just did "chmod -x" on.

There's more to permissions than just the 9 unix mode bits.  You really
CAN execute the file if test -x says you can; the question should rather
be why 'chmod -x' didn't remove all execute permissions, and that
usually boils down to ACL settings.

Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20101104/3594f04e/attachment.sig>

More information about the Cygwin-developers mailing list