[Bug 196724] fts(3) returns invalid fts_info for edge case

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Apr 1 21:59:25 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196724

Jilles Tjoelker <jilles at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jilles at FreeBSD.org
             Status|New                         |Open

--- Comment #1 from Jilles Tjoelker <jilles at FreeBSD.org> ---
When following symlinks, fts returns FTS_SLNONE when stat() fails, but a
subsequent lstat() succeeds (in recent versions fstatat() without and with
AT_SYMLINK_NOFOLLOW). This incorrectly triggers if a filename exists to be read
from the directory, is deleted before the stat and created again after the
stat.

Clearly, the code should only return FTS_SLNONE if S_ISLNK(sbp->st_mode). What
it should do otherwise is less clear. We could go back to stat() and try some
number of times for stat() and lstat() to become consistent, or we could return
FTS_NS immediately.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list