www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/03/28/08:04:00

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 52SC3x1f3999758
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 52SC3x1f3999758
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=B0Kkb1UA
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 961D8382E2B0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1743163437;
bh=B/EWn0sgl5yWegLujj9lHvlWUgsPO4A5AmajMFnEyxA=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=B0Kkb1UApYQDj0RwXy7Q3lH8CuyYY9GxsJQzojkIrT6uda3JgdrWKsMt+P2D8zYjs
vqSr7VX6OySTd8pqsJzpChPmJXylwQiR11VG1XXJ4cOplfW3X/h6caONa63M+QF874
8B1bo/wVQdGprHjKc6eqW152o0ZHtOW5UmumL2Ko=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4EC88382E293
Date: Fri, 28 Mar 2025 13:02:30 +0100
To: Bruno Haible <bruno AT clisp DOT org>
Subject: Re: symbolic link curiousity in 3.6.0
Message-ID: <Z-aP1jhjXTUVvP-E@calimero.vinschen.de>
Mail-Followup-To: Bruno Haible <bruno AT clisp DOT org>, cygwin AT cygwin DOT com
References: <Pine DOT BSF DOT 4 DOT 63 DOT 2503250218240 DOT 74063 AT m0 DOT truegem DOT net>
<Z-J95wRzwkj8RLeT AT calimero DOT vinschen DOT de>
<8758454b-bd9f-427b-9cc7-854ffd9b9596 AT maxrnd DOT com>
<Z-UtUsdcnKf4cf-F AT calimero DOT vinschen DOT de>
<Z-ZzCHWkcsvBApLK AT calimero DOT vinschen DOT de>
<Z-aGVCUo0N1VSl5s AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <Z-aGVCUo0N1VSl5s@calimero.vinschen.de>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
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: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>, cygwin AT cygwin DOT com
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

Hi Bruno,

I found the problem, it's in a gnulib header. See below.

On Mar 28 12:21, Corinna Vinschen via Cygwin wrote:
> On Mar 28 10:59, Corinna Vinschen via Cygwin wrote:
> > [Adding Bruno Haible]
> > 
> > Hi Bruno,
> > 
> > can you please take a look?  To reiterate, with coreutils 9.6:
> > 
> >   $ ln -s foo bar
> >   $ ls -l bar
> >   ls: bar: Not supported
> >   lrwxrwxrwx 1 corinna vinschen 3 Mar 27 10:20 bar -> foo
> > 
> > The introducing commit in coreutils is apparently commit
> > b58e321c8d5dd ("ls: suppress "Permission denied" errors on NFS")
> > 
> > The reason this works as expected on Linux but not on Cygwin is that the
> > underlying gnulib function file_has_aclinfo() differs between Linux and
> > Cygwin.  On Cygwin, it's basically just a call to acl_get_file() since
> > Cygwin has the POSIX.1e functions but none of the extensions of Linux
> > or FreeBSD/NetBSD.
> > 
> > As a result, when calling file_has_aclinfo("bar",...), the symlink
> > "bar" is always followed and file_has_aclinfo() returns with errno
> > set to ENOENT.
> > 
> > See below for the rest of the story.
> > 
> > Two questions:
> > 
> > - Would you place the problem inside gnulib:file_has_aclinfo() or
> >   coreutils:gobble_file()?
> > 
> >   Personally I think this is a coreutils problem rather than a
> >   gnulib problem in that it fails to take ENOENT on symlinks into
> >   account.
> > 
> > - Would it make sense to implement the FreeBSD/NetBSD functions
> >   acl_get_fd_np() and acl_get_link_np() in Cygwin?  Theoretically
> >   this should fix the problem without having to fix coreutils,
> >   but I think coreutils really should take systems into account
> >   which only have the documented POSIX.1e functions.
> > 
> > What do you think?
> 
> Ok, there's something fishy going on.
> 
> Cygwin has acl_extended_file/acl_extended_file_nofollow.
> 
> And after configure, gnulib's config.h contains this:
> 
>   #define USE_ACL 1
>   #define HAVE_ACL_GET_FILE 1
>   #define HAVE_ACL_EXTENDED_FILE 1
> 
> But for some reason I still have to figure out the coreutils 9.6 build
> doesn't use acl_extended_file/acl_extended_file_nofollow, but
> acl_get_file.
> 
> Hmm...

Gnulib's acl-internal.h contains this:

  /* Linux-specific */
  /* Cygwin >= 2.5 implements this function, but it returns 1 for all
     directories, thus is unusable.  */
   #  if !defined HAVE_ACL_EXTENDED_FILE || defined __CYGWIN__
   #   undef HAVE_ACL_EXTENDED_FILE
   #   define HAVE_ACL_EXTENDED_FILE false
   #   define acl_extended_file(name) (-1)
   #  endif

This is simply not true.  Cygwin's acl_extended_file only returns
1 on dirs, if they actually contain more than the 3 default entries
to emulate POSIX access.  I just tried it and it works exactly
as required.

Can this be fixed, please?


Thanks,
Corinna

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