perl -x doesn't recognize file as executable

Volker Quetschke quetschke@scytek.de
Mon Jun 6 00:19:00 GMT 2005


Hi!

>>$ test -x "/cygdrive/c/Programme/NSIS/NSIS.exe" && echo "executable"
>>executable
>
> coreutils have special logic for binaries with .exe suffix, which is why
> this works.
You mean special logic for windows file permissions (ACL?), not only
using the owner/group/other scheme?

>>$ perl -e 'if ( ! -x "/cygdrive/c/Programme/NSIS/NSIS.exe" ) {print "not
>>executable";}'
>>not executable
>
> Technically the file is not executable:
I beg to differ ;) Technically it depends how you define executable, if
you only know ugo permissions (or whatever this scheme is called)
then it it *not* executable.

If you decide to just test it and try to execute it you will see
that it executes quite well.

So IMHO it is executable, but technically some programs might not
see that because they are looking at the wrong place.

>>$ id -a
>>uid=1001(q) gid=513(none)
>>groups=0(root),513(none),544(Administratoren),545(Benutzer)
compare -------------------------------------------^^^^^^^^^^

$ getfacl /cygdrive/c/Programme/NSIS/NSIS.exe
# file: /cygdrive/c/Programme/NSIS/NSIS.exe
# owner: Administratoren
# group: none
user::rwx
group::---
group:SYSTEM:rwx
group:Benutzer:r-x
                  ^
with ------------|

So it is executable. But ugo rights do not show this


> The permissions on the file indicate that it is only executable by the
> owner (Administratoren) which is not the account you are running the
> command from.  If you add +x for the group or chown the file it should
> work.

I know that I can work around this, but Joe Average might not have
the rights to change the ownership of a file because he might not be in
the Admin group.

Volker

--
PGP/GPG key  (ID: 0x9F8A785D)  available  from  wwwkeys.de.pgp.net
key-fingerprint 550D F17E B082 A3E9 F913  9E53 3D35 C9BA 9F8A 785D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050606/669013a0/attachment.sig>


More information about the Cygwin mailing list