This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Empty file without "x" permission is successfully executable on Cygwin
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Mon, 5 Aug 2019 20:39:48 +0000
- Subject: Re: Empty file without "x" permission is successfully executable on Cygwin
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cornell.edu;dmarc=pass action=none header.from=cornell.edu;dkim=pass header.d=cornell.edu;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oIpte+XrIhvqFDWyEUiM6r8H59KZnr9tIxpr+xSvT/M=; b=GHoYCBkKYnKsIoM3BzJvC9GmrBLY8qRkwVkxtIYpuByChyoYQQ0U9sI+c5Bba3C1XofhNfigeF4qNMQze/tM6gwIbAiPQ3lpMT0PTLd8rZPpHaSqm8LaQopjn+LziVtU3ymzyg8kZmDsLKzOPLJi8aBbuTl4b7eH5DnDbKJjnpNgSgwYj1BLYJg2lhQP2L3LYoEbZ12qq8XakVnmsMQOlidUm313Y7nHXJRSkx+ldOpDiSVVUToUxoYaEvjcDUhKiEI9YXTiClZaB1wAY1vz8e96NPLBMRYmrEP40SRfXFqVzq4VjcWwlS5skAnCWAd6XEpPqHXOG1wqhUWBuTtDJA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PvfwBNcmBNvf4loawbJKfwlKvwIM/57c5dcABC9MQzdkWjBMlPHVBQhmgDnazKLwevRt3+BtNKd+rqkB6dDLGjnkovxQRY/tn4ovAoc7pQ4O5fXCUr45B1pf3skH1uqfZftDtNQlTOjEjEf6/DSyf8rpt4DpuH5B3YaYnoSo+FvfZ+OKECarKUJa5a9pPo5PAM6EV3Q7GhWC85+FsM+4KUxA0uLWLytBjPT+eaGUGJ98CHk89pPK0Aw9Qm5ILpW95Ba6JWXCwOTeeUhkK5SazIw5eDfphkYTJZaaidONxelVu7IwosKn3jUZI5EVJtUkzTuPhNO+bN0ce2UOonr9hA==
- References: <BL0PR0901MB43081893EE588BDED05886BFA5DA0@BL0PR0901MB4308.namprd09.prod.outlook.com> <eeb8deb6-fc17-1ecd-fb9d-6c0882f75dc1@cornell.edu> <7d007c9f-e98d-f497-d706-dbf94bb563f2@towo.net>
On 8/5/2019 4:19 PM, Thomas Wolff wrote:
>
> 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
You're right. I was careless in my test. Sorry for the noise.
Ken
--
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