X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; q=dns; s=default; b=JI9azI8McVjNR9MmdLn57vbWyS/GO MzFt4E71C+PyV9l3gwKSVt58Uchh5xNaiwclBoNf7Gcwcjq3/XSdTI3I3VEc5vpx SAJEgiOQAGLLpBQuD/99z4zpxMVzgVk0cL/Gpg28VbVjGzF+UbvIapZj3T7jiTtq Usp/wv82p7b0wM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; s=default; bh=j41Hh2nFuKQAz1rGxLGBdwGyX7c=; b=QcQ OxytDommgR/BNaz6FZsJa09vaKNXksbl9rOnbMfqRVyDBcqMgNBCChGCmKAJ8wQE HqeXsMfhl15R5TIqMLNjN/XWqeuynW2wBhq9VifQYqCasfC54SMlUtOj8WuPKmzQ g+lrKRbXREnugNWiJeIdF/wAe2aU0dXapcBhyLNs= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: NAM02-SN1-obe.outbound.protection.outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L5MY5BPGrVWuFIpNSKysK473tZbKjBCGXWEajQDzUvsBcSz4f28dGDh4rb/6GZjyvLhM6xJMZgax8dPIPxoaTykOV5zuccCIiJdGBW1PUWPx5PE7DYAEvi+zhz0R+RKjUgxtY7Hs0DZGg8BcYMWrwsT5T+1BG8o9o+eR3D625dpzlVJiozpYGJC7yH4EBeY+h3lANvpkQzWdAR8Tfcs1NVXBCQt5pfgc6E740JTvZbO6yW3+iv289ho/edenwxwkBFki85tPUli/Z3QwMESnwZS0m07ihJqOFZQWb2wCuu8a4jy+G4HwpVIfk2Ih0gNqDkjDV8WrZvOCbLHT7hfuyw== 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=OwKYOwL0ivlFU/3mKszM/xracqzohpl6qdy4qvQpY9I=; b=AxvNT2FTwmR2C8SEZ3wKu/Xh9JPc5+Dy0M/tx+PvX9uUISNa4y9Up+Iq/4OpqZa9KOKHXYuYUhW38cBz6G68WqoA6SPuwB2UFS6k5VybBjO2SfBeRGQk3YHquSCHfYX6eXgmV/PHceFBM55NyfqTmEM+LtRIqMYdY0I8Y/exLTLYBHcdDBFHdX+MPpLKgk9NVGirntbg1pK/KpeZ5UapUhXlGlv84gE5WWRAU0oSjNfx2FUGtecxUPme5QJxEUf+AN3/3S/VGyvRM8G7E1JUh8Oyl1LlMYUHi+pZcbH+3lqLZbfWYfzDHaWbQE7hsAAK0M+hwzqOhOKuPdWOAEKmjg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OwKYOwL0ivlFU/3mKszM/xracqzohpl6qdy4qvQpY9I=; b=b6q6CPXY4NOvO7jFTcQW1y2ZXDbkL1Np9X9275ptK1/q+Cvxgz3f/hZ1svM4O0IgAJ4mOUsVqXRWV32x+fc5sDGbSskiSnaYN4FGH+KGcYkNXWg3NU98o+QOqL8Cx+/X0QZgzwlw43PysvkLdWOUi74w5SdDzwdf3wLuPkOlFTc= From: Ken Brown To: "cygwin AT cygwin DOT com" Subject: Re: Empty file without "x" permission is successfully executable on Cygwin Date: Tue, 6 Aug 2019 19:35:43 +0000 Message-ID: <310d0110-506f-37c0-e694-84d8bc7ee32e@cornell.edu> References: In-Reply-To: user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu; x-ms-exchange-purlcount: 1 x-ms-oob-tlc-oobclassifiers: OLM:3044; received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ksb2 AT cornell DOT edu X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x76JaaE5028166 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 -- 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