mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
fts(3): be less strict when automount does its job under us walking autofs mount
Namely, allow the file id change if the resulting file belongs to automounted filesystem. If it is, remember the updated id. This allows the ids from the automounted volumes to change without restrictions, might be a further refinement would be to only allow such inconsistency once. PR: 284914 Reported and tested by: Lexi Winter <lexi@hemlock.eden.le-fay.org> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D49094
This commit is contained in:
parent
d40daefca6
commit
e59991206b
1 changed files with 10 additions and 3 deletions
|
|
@ -1132,6 +1132,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path)
|
|||
{
|
||||
int ret, oerrno, newfd;
|
||||
struct stat sb;
|
||||
struct statfs sf;
|
||||
|
||||
newfd = fd;
|
||||
if (ISSET(FTS_NOCHDIR))
|
||||
|
|
@ -1144,9 +1145,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path)
|
|||
goto bail;
|
||||
}
|
||||
if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
|
||||
errno = ENOENT; /* disinformation */
|
||||
ret = -1;
|
||||
goto bail;
|
||||
if (_fstatfs(newfd, &sf) != 0 ||
|
||||
(sf.f_flags & MNT_AUTOMOUNTED) == 0) {
|
||||
errno = ENOENT; /* disinformation */
|
||||
ret = -1;
|
||||
goto bail;
|
||||
}
|
||||
/* autofs might did the mount under us, accept. */
|
||||
p->fts_dev = sb.st_dev;
|
||||
p->fts_ino == sb.st_ino;
|
||||
}
|
||||
ret = fchdir(newfd);
|
||||
bail:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue