From: Thomas Wolff <towo@towo.net>
To: cygwin@cygwin.com
Subject: Re: Empty file without "x" permission is successfully executable on Cygwin
Date: Mon, 05 Aug 2019 20:19:00 -0000 [thread overview]
Message-ID: <7d007c9f-e98d-f497-d706-dbf94bb563f2@towo.net> (raw)
In-Reply-To: <eeb8deb6-fc17-1ecd-fb9d-6c0882f75dc1@cornell.edu>
Am 05.08.2019 um 22:01 schrieb Ken Brown:
> On 8/5/2019 2:18 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin wrote:
>> Hi,
>>
>> Please consider the following shell session:
>>
>> $ cat dummy.c
>> #include <stdio.h>
>>
>> int main()
>> {
>> return 0;
>> }
>> $ gcc -o dummy dummy.c
>> $ mv dummy.exe dummy
>> $ ./dummy
>> $ echo $?
>> 0
>> $ chmod a-x dummy
>> $ ./dummy
>> -bash: ./dummy: Permission denied
>> $ rm dummy
>> $ touch dummy
>> $ ./dummy
>> $ echo $?
>> 0
>>
>> So Cygwin lets the shell to execute a zero-sized file regardless of the "x" perm
>> (non-empty files are not executable if they do not have "x", as shown above).
> I can't reproduce this on my system. Can you show the permissions and ACL of dummy?
>
>> There's more. If I put some rubbish in a file, Cygwin still tries to execute it even if the "x" is not there:
>>
>> $ rm dummy
>> $ echo "1" > dummy
>> $ ./dummy
>> ./dummy: line 1: 1: command not found
> Again I can't reproduce this.
I reproduce the behaviour:
> echo echo foo > bar
> ls -l bar
-rw-r--r-- 1 towo None 9Â 5. Aug 22:18 bar
> ./bar
foo
>
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2019-08-05 20:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 18:18 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-05 20:01 ` Ken Brown
2019-08-05 20:19 ` Thomas Wolff [this message]
2019-08-05 20:39 ` Ken Brown
2019-08-06 3:19 ` Ken Brown
2019-08-06 8:33 ` Corinna Vinschen
2019-08-06 9:01 ` Corinna Vinschen
2019-08-06 6:22 ` Houder
2019-08-06 19:09 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-06 19:35 ` Ken Brown
2019-08-07 6:12 ` Houder
2019-08-24 10:13 ` Houder
2019-08-06 20:39 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-06 21:06 ` Vince Rice
2019-08-06 21:17 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-06 21:43 ` Vince Rice
2019-08-06 22:28 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7d007c9f-e98d-f497-d706-dbf94bb563f2@towo.net \
--to=towo@towo.net \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).