Your message dated Tue, 29 Dec 2020 18:46:17 +0100
with message-id <X+traaI/jFU9/[email protected]>
and subject line Re: Bug#978646: regression: %Y option fails to mark broken 
symlinks as "N"(nonexistent)
has caused the Debian Bug report #978646,
regarding regression: %Y option fails to mark broken symlinks as 
"N"(nonexistent)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
978646: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978646
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: findutils
Version: 4.6.0+git+20161106-2
Severity: important

Dear Maintainer,

This is a regression as it worked in Jessie and works again in Buster, but
fails in Stretch:
(note: i have a script to remove dangling symlinks that relied on
       'find ... -printf %Y' returning 'N' for broken symlinks that doesn't
       work because of this bug)

[Stretch]
(INcorrect behavior)
    $ lsb_release -cs
    stretch
    $ mkdir symlink-test
    $ cd symlink-test
    $ ln -sf /tmp fronk
    $ ln -sf /adfasdf blonk
    $ ln -sf spizzle spizzle
    $ find . -xdev -mindepth 1 -maxdepth 1 -type l -printf "%Y: %p  # ->%l \n"
    l: ./blonk  # ->/adfasdf 
** this symlink should be marked (N) Nonexistent, rather than l
    d: ./fronk  # ->/tmp 
    L: ./spizzle  # ->spizzle
** yay, 'find' identifies (self-referential) loops correctly

[Buster]
(correct behavior)

    $ lsb_release -cs
    buster
    $ mkdir symlink-test
    $ cd symlink-test
    $ ln -sf /tmp fronk
    $ ln -sf /adfasdf blonk
    $ ln -sf spizzle spizzle
    $ find . -xdev -mindepth 1 -maxdepth 1 -type l -printf "%Y: %p  # ->%l \n"
    L: ./spizzle  # ->spizzle 
    d: ./fronk  # ->/tmp 
    N: ./blonk  # ->/adfasdf
** this symlink is *correctly* marked (N) Nonexistent

[Jessie]
(correct behavior)
    $ mkdir symlink-test
    $ cd symlink-test
    $ ln -sf /tmp fronk
    $ ln -sf /adfasdf blonk
    $ ln -sf spizzle spizzle
    $ find . -xdev -mindepth 1 -maxdepth 1 -type l -printf "%Y: %p  # ->%l \n"
    L: ./spizzle  # ->spizzle 
    N: ./blonk  # ->/adfasdf 
** this symlink is *correctly* marked (N) Nonexistent
    d: ./fronk  # ->/tmp 

thanks,
--stephen

-- System Information:
Debian Release: 9.13
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-0.bpo.9-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE= 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages findutils depends on:
ii  libc6        2.24-11+deb9u4
ii  libselinux1  2.6-3+b3

findutils recommends no packages.

Versions of packages findutils suggests:
ii  mlocate  0.26-2

-- debconf-show failed

--- End Message ---
--- Begin Message ---
Version: 4.6.0+git+20180808-1

On 2020-12-29 Stephen Dowdy <[email protected]> wrote:
> Package: findutils
> Version: 4.6.0+git+20161106-2
> Severity: important

> Dear Maintainer,

> This is a regression as it worked in Jessie and works again in Buster, but
> fails in Stretch:
> (note: i have a script to remove dangling symlinks that relied on
>        'find ... -printf %Y' returning 'N' for broken symlinks that doesn't
>        work because of this bug)

> [Stretch]
> (INcorrect behavior)
>     $ lsb_release -cs
>     stretch
>     $ mkdir symlink-test
>     $ cd symlink-test
>     $ ln -sf /tmp fronk
>     $ ln -sf /adfasdf blonk
>     $ ln -sf spizzle spizzle
>     $ find . -xdev -mindepth 1 -maxdepth 1 -type l -printf "%Y: %p  # ->%l \n"
>     l: ./blonk  # ->/adfasdf 
> ** this symlink should be marked (N) Nonexistent, rather than l
[...]

This was fixed upstream with 
------------
7b7a19c95f236cd18f48e44b7cc6794d21c0369f
2018-07-20 10:07:13

    find: fix -printf %Y output to 'N' for broken links
    
    The format %Y shall output 'N' for broken links (ENOENT), 'L' for ELOOP,
    and '?' for any other error when stat()ing the symlink target.
    
    The %Y implementation implicitly fell back to lstat(); therefore it
    output 'l' for dangling symlinks.
    
      $ ln -s ENOENT DANGLE
      $ find -D stat DANGLE -printf '%y %Y %p\n'
      fallback_stat(): stat(DANGLE) failed; falling back on lstat()
      l l DANGLE
    
    * find/print.c (do_fprintf): For %Y, always follow links to determine
    the type of the symlink target.
    * find/testsuite/find.gnu/printf-symlink.exp: Add a test case for broken
    links and the ELOOP case ...
    * find/testsuite/find.gnu/printf-symlink.xo: ... with the expected output.
    * NEWS (Bug fixes): Mention the fix.
    
    Bug introduced in version v4.5.8 with commit '25e7c5fbf9'.
--------------
and 
--------------
ba6be2889642010c8f30affe403981aa2cc39631
2018-07-24 08:34:38

    find -printf %Y: handle ENOTDIR also as broken symlink

    The above command should output 'N' (for broken symlinks) not only in
    the ENOENT case, but also when an intermediate part of the symlink target
    file name is a file (ENOTDIR):

      $ touch file
      $ ln -s file/ENOTDIR link
      $ find link -printf '%Y %p\n'
      N link

    Previously, find output 'l' as for a resolvable symlink.

    * find/print.c (do_fprintf): Treat ENOTDIR the same as ENOENT to detect
    broken symlinks.
    * find/testsuite/find.gnu/printf-symlink.exp: Extend the test, and ...
    * find/testsuite/find.gnu/printf-symlink.xo: ... the expected output.
    * NEWS (Bug fixes, #54262): Explicitly mention that both ENOENT and ENOTDIR
    are used to detect broken symlinks.

    Suggested by Tavian Barnes.
--------------

cu Andreas

-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

--- End Message ---

Reply via email to