Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File::Find does not call dangling_symlinks if follow => 0 #12933

Closed
p5pRT opened this issue Apr 28, 2013 · 7 comments
Closed

File::Find does not call dangling_symlinks if follow => 0 #12933

p5pRT opened this issue Apr 28, 2013 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 28, 2013

Migrated from rt.perl.org#117789 (status was 'open')

Searchable as RT117789$

@p5pRT
Copy link
Author

p5pRT commented Apr 28, 2013

From @jmdh

Created by @jmdh

This is a bug report for perl from dom@​earth.li,
generated with the help of perlbug 1.39 running under perl 5.17.12.

-----------------------------------------------------------------
From <http​://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591242>​:

"when using the find method of File​::Find, it seems that the
dangling_symlink callback is only called if follow => 1. This is not
reflected in the manpage, and there are valid use cases for follow =>0
and dangling_symlinks."

#!/usr/bin/perl

use File​::Find;

find({
  wanted => sub { print "found​: " . $File​::Find​::name . "\n"; },
  dangling_symlinks => sub { print "dangling​: " . $_[0] . "\n"; },
}, qw(dir_to_search));

$ ls -l dir_to_search/
total 0
-rw-r--r-- 1 dom dom 0 Apr 28 18​:49 bar
-rw-r--r-- 1 dom dom 0 Apr 28 18​:49 foo
lrwxrwxrwx 1 dom dom 5 Apr 28 18​:49 hanging -> undef
lrwxrwxrwx 1 dom dom 3 Apr 28 18​:49 wibble -> bar

Reproduced with current blead.

Perl Info

Flags:
    category=library
    severity=low
    module=File::Find

Site configuration information for perl 5.17.12:

Configured by dom at Sun Apr 28 17:39:32 BST 2013.

Summary of my perl5 (revision 5 version 17 subversion 12) configuration:
  Commit id: 8b3945e7b7b7ae6fd2369864ebe169bd9a91cf4e
  Platform:
    osname=linux, osvers=3.2.0-4-686-pae, archname=i686-linux-thread-multi-64int
    uname='linux callisto 3.2.0-4-686-pae #1 smp debian 3.2.41-2 i686 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Dldflags=-Wl,-z,relro -Dlddlflags=-shared -Wl,-z,relro -Dcccdlflags=-fPIC -Duse64bitint -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -des -Dusedevel'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='4.7.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-z,relro -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/i386-linux-gnu /lib/../lib /usr/lib/i386-linux-gnu /usr/lib/../lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.13'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/local/lib/perl5/5.17.12/i686-linux-thread-multi-64int/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -Wl,-z,relro -L/usr/local/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.17.12:
    lib
    /usr/local/lib/perl5/site_perl/5.17.12/i686-linux-thread-multi-64int
    /usr/local/lib/perl5/site_perl/5.17.12
    /usr/local/lib/perl5/5.17.12/i686-linux-thread-multi-64int
    /usr/local/lib/perl5/5.17.12
    .


Environment for perl 5.17.12:
    HOME=/home/dom
    LANG=en_GB.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/home/dom/working/perl:
    LOGDIR (unset)
    PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Apr 28, 2013

From @jkeenan

On Sun Apr 28 11​:00​:18 2013, dom wrote​:

This is a bug report for perl from dom@​earth.li,
generated with the help of perlbug 1.39 running under perl 5.17.12.

-----------------------------------------------------------------
From <http​://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591242>​:

"when using the find method of File​::Find, it seems that the
dangling_symlink callback is only called if follow => 1. This is not
reflected in the manpage, and there are valid use cases for follow =>0
and dangling_symlinks."

Could you elaborate a bit on what those use cases are?

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Apr 28, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Apr 29, 2013

From @jmdh

On Sun, Apr 28, 2013 at 04​:21​:57PM -0700, James E Keenan via RT wrote​:

On Sun Apr 28 11​:00​:18 2013, dom wrote​:

From <http​://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591242>​:

"when using the find method of File​::Find, it seems that the
dangling_symlink callback is only called if follow => 1. This is not
reflected in the manpage, and there are valid use cases for follow =>0
and dangling_symlinks."

Could you elaborate a bit on what those use cases are?

Hi Joachim,

Could you provide a bit more information about this to the upstream
bug report? It should be enough to reply-all to this message.

Thanks!
Dominic.

--
Dominic Hargreaves | http​://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)

@p5pRT
Copy link
Author

p5pRT commented May 1, 2013

From @nomeata

Hi,

Am Montag, den 29.04.2013, 22​:17 +0100 schrieb Dominic Hargreaves​:

On Sun, Apr 28, 2013 at 04​:21​:57PM -0700, James E Keenan via RT wrote​:

On Sun Apr 28 11​:00​:18 2013, dom wrote​:

From <http​://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591242>​:

"when using the find method of File​::Find, it seems that the
dangling_symlink callback is only called if follow => 1. This is not
reflected in the manpage, and there are valid use cases for follow =>0
and dangling_symlinks."

Could you elaborate a bit on what those use cases are?

Hi Joachim,

Could you provide a bit more information about this to the upstream
bug report? It should be enough to reply-all to this message.

that was a long time ago, I don’t recall the exact use case. But maybe
it was just cleaning out dangling symlinks from a tree with symlinks
where I do not want to follow them.

Greetings,
Joachim

--
Joachim "nomeata" Breitner
Debian Developer
  nomeata@​debian.org | ICQ# 74513189 | GPG-Keyid​: 4743206C
  JID​: nomeata@​joachim-breitner.de | http​://people.debian.org/~nomeata

@jkeenan
Copy link
Contributor

jkeenan commented Oct 29, 2023

There has been no further discussion in this ticket since 2013. @jmdh, @ntyni, does Debian have further concerns in this area? (Otherwise, I think the ticket should be closed.)

@jkeenan jkeenan added Closable? We might be able to close this ticket, but we need to check with the reporter and removed distro-Linux labels Oct 29, 2023
@jkeenan
Copy link
Contributor

jkeenan commented Nov 20, 2023

There has been no further discussion in this ticket since 2013. @jmdh, @ntyni, does Debian have further concerns in this area? (Otherwise, I think the ticket should be closed.)

No responses; closing.

@jkeenan jkeenan closed this as completed Nov 20, 2023
@jkeenan jkeenan removed the Closable? We might be able to close this ticket, but we need to check with the reporter label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants