GNU bug report logs - #63931
ls colors one symlink too much as non-broken in symlink chain

Previous Next

Package: coreutils;

Reported by: Martin Schulte <gnu <at> schrader-schulte.de>

Date: Tue, 6 Jun 2023 17:25:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>, Martin Schulte <gnu <at> schrader-schulte.de>, 63931 <at> debbugs.gnu.org
Subject: bug#63931: ls colors one symlink too much as non-broken in symlink chain
Date: Tue, 6 Jun 2023 15:10:49 -0700
On 6/6/23 13:32, Pádraig Brady wrote:
> I'll think a bit more about it and add a test before applying.

I wouldn't test that the 'ls' output exactly matches the 'cat' output. 
For example, it should be OK for stat_for_mode to pass the parent 
directory fd (instead of AT_FDCWD) to statx, for efficiency, and in that 
case the number of symbolic links traversed by 'ls' won't match the 
number traversed by 'cat', because the full name might traverse symlinks 
that statx (dirfd, ...) won't.

And it's OK if these two numbers don't match, as users shouldn't assume 
that the ELOOP limit is a constant.

With that in mind, the code change you proposed is reasonably innocuous, 
although it slows things down a bit in the usual case. Not sure it's 
worth doing (I guess it does fix a race but there are other unfixable 
races in this area....).




This bug report was last modified 1 year and 348 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.