Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Apr 2015 21:59:25 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 196724] fts(3) returns invalid fts_info for edge case
Message-ID:  <bug-196724-8-37kiYLz4IM@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-196724-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-196724-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196724

Jilles Tjoelker <jilles@FreeBSD.org> changed:

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

--- Comment #1 from Jilles Tjoelker <jilles@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-196724-8-37kiYLz4IM>