delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/10/06/11:50:58

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B75A395441A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1601999407;
bh=PMoe1J7CjAurNSsgPslHnAO5d4IGhY7cYnU2kdQbrg0=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=yQXsWDgcHfz8H6EOJJWUXzA0hZiYPXkCP8VKerm0yTDw35hsz+AtfOLCzdI3lZkZm
/RoTgeHB1cMtXQW2L41MFeaLjo75jsbiY/g6IkN7h1mcRGjntKD8h2CeWsbid0fp5z
6HWqujKKwTfVeVSuJWoM5GseCp03kGGZYpkCd4jM=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B9DB1395441A
Date: Tue, 6 Oct 2020 18:46:06 +0300
X-Mailer: The Bat! (v6.8.8) Home
X-Priority: 3 (Normal)
Message-ID: <1279009444.20201006184606@yandex.ru>
To: Mario Emmenlauer <mario AT emmenlauer DOT de>, cygwin AT cygwin DOT com
Subject: Re: test -r or -x always return false on an NFS mount?
In-Reply-To: <d05f79db-5574-d408-28ce-7840cddff7ec@emmenlauer.de>
References: <d05f79db-5574-d408-28ce-7840cddff7ec AT emmenlauer DOT de>
MIME-Version: 1.0
X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT,
NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Andrey Repin via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Andrey Repin <anrdaemon AT yandex DOT ru>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

Greetings, Mario Emmenlauer!

> thanks for the awesome Cygwin, its really great!

> But since today I met a problem: I mounted a Linux NFSv3 share using
> the Windows 10 shipped NFS client. The user and group ID are mapped
> via registry settings AnonymousUid and AnonymousGid in the entry
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default

> Everything seems to work quite well, and in `ls -la` I can see the
> file permissions and user and group entries. But when using `test`
> to check for read (`test -r`) or execute permissions (`test -x`), it
> always returns false, even for readable files. `ls` on the other hand
> shows the permissions correctly, and `cat`ing the files works without
> problems.

> I've read https://cygwin.com/cygwin-ug-net/using-filemodes.html
> about the Cygwin file permissions for NFS, and also the NFS account
> mapping at https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nfs,
> but as far as I can see, they are both unrelated. Google turned up no
> useful hits for keywords "cygwin" "test" and "nfs", so I'm a bit at the
> end of my wit.

> Is this a known issue, and/or are there any workarounds? I'm currently
> using `test -e` in place of read or execute checks, but it basically
> breaks all my build scrips.

This is a known issue. For years known.
test only guess -r/-w/-x results based on permissions as it sees them.
But it do not actually try to read/write/execute the subject, which, as you
can imagine, may lead to all sorts of false positives/negatives on filesystems
with less than trivial access control setups.
In other words, don't test for rwx if you can avoid it. The results MAY be
wrong.


-- 
With best regards,
Andrey Repin
Tuesday, October 6, 2020 18:42:12

Sorry for my terrible english...

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019