X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/94ff46dc2849db4d43eaaf144872decc522aafb4..c6bf4f310a33a9262d455ea4d3f0630b1255e3fe:/bsd/vfs/vfs_lookup.c?ds=sidebyside diff --git a/bsd/vfs/vfs_lookup.c b/bsd/vfs/vfs_lookup.c index 5fe5b737a..85d47741e 100644 --- a/bsd/vfs/vfs_lookup.c +++ b/bsd/vfs/vfs_lookup.c @@ -374,17 +374,23 @@ retry_copy: * we can release the icoount which we used to get our usecount. */ proc_fdlock(p); + if (!(fdp->fd_flags & FD_CHROOT)) { + ndp->ni_rootdir = rootvnode; + } else { + ndp->ni_rootdir = fdp->fd_rdir; + } - if ((ndp->ni_rootdir = fdp->fd_rdir) == NULLVP) { + if (!ndp->ni_rootdir) { if (!(fdp->fd_flags & FD_CHROOT)) { - ndp->ni_rootdir = rootvnode; + proc_fdunlock(p); + printf("rootvnode is not set\n"); } else { proc_fdunlock(p); /* This should be a panic */ - printf("proc is chrooted but does not have a root directory set\n"); - error = ENOENT; - goto error_out; + printf("fdp->fd_rdir is not set\n"); } + error = ENOENT; + goto error_out; } /*