DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 52VGYoaG1831931
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 52VGYoaG1831931
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=xAmM7Oap
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34ED9384389D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1743438888;
	bh=yBxzoSCkP4WE134k4HPK7G8oLsPvO2NxhH8yTHkFReE=;
	h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=xAmM7OapuT8y8QyBFlPKPBYcTqmQn9mzLyBEX1rBrEnh8syayrzJG/lLbr2x4HNDi
	 SyoqJR5NJ5ra4+MyJLwuFzoa5RJFnF3DOOJSd1zg7aGSQjnxpgKuV6QsH64db9CSoD
	 D6VEo1YlPIwQMtr7CYIgiZ+8khzgu8VMH05LCEo4=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C34313865C36
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C34313865C36
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743438736; cv=none;
 b=RHyK1LFx3+RazFNcUK7rVeh40LP+kPRxCPVWQie+Umb0rNuGma3A7bsnm6FKsUKt/52SElDn/Sl2utS1Y19osCMVHi572IIybebMe8F4Q3MgM0JUoUH+oPVCDSZofH10u856YW+N7P982DcDfnmwh/rxGcM2hQ451TS5BxIzccY=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1743438736; c=relaxed/simple;
 bh=dezo6P30lgKtvNOjsn23FwJcNhhU98A3CvukpXKg7sk=;
 h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From;
 b=RLxWa+T/W8KjlEwYv2fFIe4d+oHdfCN7ByD0Y1ubCxagZrj1wf+/1AndV20/sbA6FR9hwA0BTiEWqWXS/6V0KTKXWSAFy4Bm4sZXUJok6LVWcYr4MMCPzG163blcykGihuVIC6dNA/y43xkmem+ij4xtKdf3uIk23TO8spgyaKY=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C34313865C36
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu C22553C01085D
X-Virus-Scanned: amavis at mail.cs.ucla.edu
Message-ID: <37f0f8b7-4251-4acd-b448-2f0d7c30a988@cs.ucla.edu>
Date: Mon, 31 Mar 2025 09:32:14 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: symbolic link curiousity in 3.6.0
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigBrady.com>,
        Bruno Haible <bruno@clisp.org>, bug-gnulib@gnu.org, cygwin@cygwin.com,
        Coreutils <coreutils@gnu.org>
References: <Pine.BSF.4.63.2503250218240.74063@m0.truegem.net>
 <Z-aGVCUo0N1VSl5s@calimero.vinschen.de>
 <Z-aP1jhjXTUVvP-E@calimero.vinschen.de> <11037686.3WhfQktd6Z@nimes>
 <91c9d441-36e3-4dd5-b2ca-3cfd498d2260@draigBrady.com>
 <Z-fLulclFs13NfAm@calimero.vinschen.de>
 <a78f800c-0463-4efb-b431-c2c244bd13c7@cs.ucla.edu>
 <Z-k-ALeeYtJx7SqL@calimero.vinschen.de>
 <1c0fb53a-2a6d-4d9d-8dbe-d70cc9296d5d@draigBrady.com>
Content-Language: en-US
Organization: UCLA Computer Science Department
In-Reply-To: <1c0fb53a-2a6d-4d9d-8dbe-d70cc9296d5d@draigBrady.com>
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Paul Eggert via Cygwin <cygwin@cygwin.com>
Reply-To: Paul Eggert <eggert@cs.ucla.edu>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 52VGYoaG1831931

On 2025-03-30 07:26, Pádraig Brady wrote:
> On 30/03/2025 13:50, Corinna Vinschen wrote:
>> In terms of coreutils, I think either ls(1) gobble_file() or
>> file_has_aclinfo_cache() should still handle ENOENT from
>> file_has_aclinfo() and not print any error message.  After all, due to
>> the preconditions for building acl_get_link_np, we can't be sure
>> acl_get_link_np has really been built into file-has-acl.c, and the
>> problem persists.
> 
> I tend to agree. I'll apply this later:
> 
> 
> commit 88385a0d6d56197d3c180432c8a4bca07241e90b (HEAD -> master)
> Author: Pádraig Brady <P@draigBrady.com>
> Date:   Sun Mar 30 15:16:54 2025 +0100
> 
>      ls: suppress ENOENT errors when reading ACL info
> 
>      * src/ls.c (gobble_file): Indicating unknown ACL info with '?'
>      suffices for the edge case of a file being removed while reading,
>      or older cygwin when reading through dangling symlinks.
>      Reported by Corinna Vinschen.

Not sure this is a good idea, as a file being removed while getting its 
attributes indicates a serious issue that's worth bringing to the user's 
attention more directly.

How about if we instead use O_PATH on the file first, and then use fstat 
etc. on the result? That should fix the 
file-removed-while-getting-attributes situation, at least on platforms 
with /proc/self/fd (which I assume includes Cygnus). I realize that 
flistxattr etc. don't work on fds opened via O_PATH (why? this seems 
silly, but it's not my bailiwick) but /proc/self/fd works around that 
problem.

-- 
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

