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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=kuJ+B7TUqtJeaMpW 6P7NgNvd9xDNvP7ceib3SUbO7YRuQc861ZjkBHJMNONGLGpe6OlWB6QMxnaS1653 0y0EceZ5J3egUL05n1VxNUyqsix4ZyHksnka0sYIXdyl8CcNwNW+U02V1TN9DqZC JoTkrvKwUuxgQCTyb4VUCF4kKzA= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=ghnHNAxO/28oZKwW0qjLss vnLF4=; b=MspfbLPo0T+paJyqgt7P2dtzcr3g1ftCec1/Qc91cxLow0o2Vb4n30 hVHGWssHmXbvRGv8Opzlg/RraOAphRG64Ky5cDQXysf7kKOo+nAeYvVILJjt/N7j yFgrIfpHWalkGSjHjWkV0WQvyc2v4pvRAntgpppGkslSMLcThvyNw= 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.8 required=5.0 tests=BAYES_50,FOREIGN_BODY,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=antivirus, auf, von, H*r:ip*192.168.0.3 X-HELO: mail-wr1-f53.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=Mse9Xx/eDTgB8ac/mYQ1/Uy8dsR+DhlO7I30kK6U6Vo=; b=lAx5zXAl3F/vYDcTQcXQo7ORja8hbw5RmlPaEu4ZnS8N8/O+LoO6X8iI+WvWf4J8yB 5Df3+Za+gl6MheabO04LgpBDaafjVIH2GtNVidQZDvjQUsqn+TTPHxUJmePgkn6vm6kb 61LZKKo2Uftcwnotjzn3z56allIA0A537gMRAlRpwEqyznYQrQARwFHVawCmtJNcD+nj YVzyYqF5kDLKIM4JNpDO00XDwaiW9M5q0DLXK/NLwf8UNhG9D0DU0QGzGt2DSX8Z/zRR 9O6tMZQBKQw66joju6a+Rq7uiHr30cOetFmAGFBCV4li+GPBfd9QaYqPmGPfee4hC5Is nGIg== Subject: Re: "test" producing unexpected results after "chmod" To: cygwin AT cygwin DOT com References: <5c1f242b DOT 1c69fb81 DOT 2721c DOT 076d AT mx DOT google DOT com> From: Marco Atzeri Message-ID: <18523ac3-2c1f-aaaa-7719-d97fe7794858@gmail.com> Date: Sun, 23 Dec 2018 07:15:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <5c1f242b.1c69fb81.2721c.076d@mx.google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Am 23.12.2018 um 06:59 schrieb Steven Penny: > With Linux, these commands produce expected results: > >    $ cd /tmp >    $ touch alpha.txt >    $ test -r alpha.txt; echo "$?" >    0 >    $ chmod -r alpha.txt >    $ test -r alpha.txt; echo "$?" >    1 >    $ chmod +r alpha.txt >    $ test -r alpha.txt; echo "$?" >    0 > > However with Cygwin, unexpected results are produced: > >    $ cd /tmp >    $ touch alpha.txt >    $ test -r alpha.txt; echo "$?" >    0 >    $ chmod -r alpha.txt >    $ test -r alpha.txt; echo "$?" >    0 > > It seems Cygwin is not able to produce non-readable files. > you are missing the point that the Windows filesystem has additional ACL permission as indicated by the "+" in the ls output. If you remove those permissions the test case replicate Linux results. $ mkdir pippo $ ls -l | grep pippo drwx------+ 1 Marco Kein 0 Dec 23 07:03 pippo ^ ACL additional permissions $ getfacl pippo/ # file: pippo/ # owner: Marco # group: Kein user::rwx group::--- other::--- default:user::rwx default:group::r-x default:other::r-x $ setfacl -k pippo $ ls -l |grep pippo drwx------ 1 Marco Kein 0 Dec 23 07:05 pippo $ getfacl pippo/ # file: pippo/ # owner: Marco # group: Kein user::rwx group::--- other::--- $ cd pippo $ touch alpha.txt $ test -r alpha.txt; echo "$?" 0 $ chmod -r alpha.txt $ test -r alpha.txt; echo "$?" 1 $ chmod +r alpha.txt $ test -r alpha.txt; echo "$?" 0 --- Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft. https://www.avast.com/antivirus -- 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