From: Ken Brown <kbrown@cornell.edu>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Empty file without "x" permission is successfully executable on Cygwin
Date: Tue, 06 Aug 2019 19:35:00 -0000 [thread overview]
Message-ID: <310d0110-506f-37c0-e694-84d8bc7ee32e@cornell.edu> (raw)
In-Reply-To: <BL0PR0901MB430826D79AF2771A6A5C2A99A5D50@BL0PR0901MB4308.namprd09.prod.outlook.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1064 bytes --]
On 8/6/2019 3:09 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin wrote:
>> zero-sized? Irrelevant.
>
> It is actually very relevant. Because executing an empty script results in "success" (exit code 0) -- that creates a false-positive.
You were absolutely right on your first complaint, that Cygwin allows a script
without execute permission to be executed. Corinna has already fixed that:
https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=98669a24760a84bfef498fedeef7fa7ecc518e6c
But what's your basis for saying that an empty script shouldn't be executable?
As long as it has execute permission, you're asking the shell to do nothing. It
happily does nothing and reports success.
It works that way on Linux also:
$ touch dummy
$ chmod +x dummy
$ ./dummy
$ echo $?
0
Ken
\x03BKCB\x1cØ\x19[H\x1c\^[Ü\x1cÎ\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0eËØÞYÝÚ[ÛÛKÜ\x1cØ\x19[\Ë\x1d^[[\x03BTN\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0eËØÞYÝÚ[ÛÛKÙ\KÃB^[ØÝ[Y[\x18]\x1a[Û\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0eËØÞYÝÚ[ÛÛKÙ^[ØÜË\x1d^[[\x03B[ÝXØÜXH\x1a[Î\b\b\b\b\b\x1a\x1d\x1d\x1c\x0eËØÞYÝÚ[ÛÛKÛ[\vÈÝ[ÝXØÜXK\Ú[\^[\x19CBB
next prev parent reply other threads:[~2019-08-06 19:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 19:09 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-06 19:35 ` Ken Brown [this message]
2019-08-07 6:12 ` Houder
2019-08-24 10:13 ` Houder
-- strict thread matches above, loose matches on Subject: below --
2019-08-06 22:28 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-06 21:17 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-06 21:43 ` Vince Rice
2019-08-06 20:39 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-06 21:06 ` Vince Rice
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
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
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=310d0110-506f-37c0-e694-84d8bc7ee32e@cornell.edu \
--to=kbrown@cornell.edu \
--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).