lookup: Track last lookup component if it is directory.

This makes open("/a/../a", O_BENEATH) with cwd == "/a" work.

Reviewed by:	markj
Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D25886
This commit is contained in:
Konstantin Belousov 2020-09-22 21:59:18 +00:00
parent 44619a5e86
commit f9e46c9bf1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366016

View File

@ -1248,6 +1248,8 @@ lookup(struct nameidata *ndp)
goto bad2;
}
}
if (ndp->ni_vp != NULL && ndp->ni_vp->v_type == VDIR)
nameicap_tracker_add(ndp, ndp->ni_vp);
return (0);
bad2: