This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: Executable bit check
On 11/4/2010 5:02 PM, Eric Blake wrote:
> 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?
$ getfacl abc
# file: abc
# owner: ibobyr
# group: Domain Users
user::rw-
group::r--
group:SYSTEM:rwx
group:Administrators:rwx
group:Users:r-x
mask:rwx
other:r--
>> $ ./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.
I'm on NTFS. So, it is not that one.
"chmod +x" and "chmod -x" do have visible effect:
$ ll abc
-rw-r--r--+ 1 ibobyr Domain Users Nov 21 4 16:44 abc
$ chmod +x abc
$ ll abc
-rwxr-xr-x+ 1 ibobyr Domain Users Nov 21 4 16:44 abc*
$ chmod -x abc
$ ll abc
-rw-r--r--+ 1 ibobyr Domain Users Nov 21 4 16:44 abc
A newly created file is executable even without "chmod +x":
$ echo "echo Hm... =)" > cba
$ ./cba
Hm... =)
>> 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.