James Youngman wrote:
gnulib foliks, do you have test data which results in FTS_DC being
returned by fts_read? If not, have you tested in any other way that
ent->fts_cycle->fts_pathlen is in-bounds for this case?
The Gnulib tests for fts are minimal and don't use FTS_DC as far as I know.
I tested bleeding-edge findutils (commit
41dd17cb87a399c6359be3e8c56373a210f89354) successfully on Fedora 26 x86-64 using
a simple case involving a bind mount to create a hard-link loop. Something like
this:
mkdir /tmp/root
sudo mount -o bind / /tmp/root
valgrind ~/src/gnu/findutils/find/find / $(ls / |
sed '/tmp/d; s/.*/-name & -prune -o/') -name root -print
The last command output:
/home/eggert/src/gnu/findutils/find/find: File system loop detected; ‘/tmp/root’
is part of the same file system loop as ‘/’.
along with some "Permission denied" messages and a clean bill of health from
Valgrind. So, I couldn't reproduce the problem. Presumably the test case needs
to be hairier.