diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2020-09-22 22:43:32 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2020-09-22 22:43:32 +0000 |
commit | 6a9c72d901feeca0b0865be8954a3a29d8613b34 (patch) | |
tree | c8c085be5939744d571ab1d1cb3ae83b40a7c8f7 | |
parent | 07e7ad2b9845f5eaf08d62f644440c411c8a63f8 (diff) |
Notes
-rw-r--r-- | sys/kern/vfs_lookup.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 5ab3c4d2a3f3..e13888a4a3c0 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -178,11 +178,13 @@ static void nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) { struct nameicap_tracker *nt; + struct componentname *cnp; if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; - if ((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | NI_LCF_BENEATH_LATCHED)) == - NI_LCF_BENEATH_ABS) { + cnp = &ndp->ni_cnd; + if ((cnp->cn_flags & BENEATH) != 0 && + (ndp->ni_lcf & NI_LCF_BENEATH_LATCHED) == 0) { MPASS((ndp->ni_lcf & NI_LCF_LATCH) != 0); if (dp != ndp->ni_beneath_latch) return; @@ -593,8 +595,8 @@ namei(struct nameidata *ndp) namei_cleanup_cnp(cnp); } else cnp->cn_flags |= HASBUF; - if ((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | - NI_LCF_BENEATH_LATCHED)) == NI_LCF_BENEATH_ABS) { + if ((ndp->ni_lcf & (NI_LCF_LATCH | + NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) { NDFREE(ndp, 0); error = ENOTCAPABLE; } |