]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r281082: fts: Don't return FTS_SLNONE if it's not a symlink (if race).
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 19 Apr 2015 13:28:32 +0000 (13:28 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 19 Apr 2015 13:28:32 +0000 (13:28 +0000)
commitf27094d14e726359c313ff4bdbe5213864115fe1
tree6873b22b60c7f95629dd1e29400bc16a5f3c9453
parente1a4a3a2d2effcd4239e00c32b1899431d189cff
MFC r281082: fts: Don't return FTS_SLNONE if it's not a symlink (if race).

When following symlinks, fts returned FTS_SLNONE when fstatat(flag=0)
failed, but a subsequent fstatat(flag=AT_SYMLINK_NOFOLLOW) succeeded. This
incorrectly triggered if a filename existed to be read from the directory,
was deleted before the fstatat(flag=0) and created again after the
fstatat(flag=0).

Fix this by only returning FTS_SLNONE if the result from
fstatat(flag=AT_SYMLINK_NOFOLLOW) is actually a symlink. If it is not a
symlink, treat it as if fstatat(flag=0) succeeded.

PR: 196724

git-svn-id: svn://svn.freebsd.org/base/stable/10@281741 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/gen/fts.c