mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Fix several bugs in devfs_lookupx(). When we check the nameiop to
make sure it's a correct operation for devfs, do it only in the ISLASTCN case. If we don't, we are assuming that the final file will be in devfs, which is not true if another partition is mounted on top of devfs or with special filenames (like /dev/net/../../foo). Reviewed by: phk
This commit is contained in:
parent
2c6c9ea2bd
commit
8eee3a3d58
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96356
@ -276,7 +276,7 @@ devfs_lookupx(ap)
|
||||
|
||||
*vpp = NULLVP;
|
||||
|
||||
if (nameiop == RENAME)
|
||||
if ((flags & ISLASTCN) && nameiop == RENAME)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
if (dvp->v_type != VDIR)
|
||||
@ -290,7 +290,7 @@ devfs_lookupx(ap)
|
||||
return (error);
|
||||
|
||||
if (cnp->cn_namelen == 1 && *pname == '.') {
|
||||
if (nameiop != LOOKUP)
|
||||
if ((flags & ISLASTCN) && nameiop != LOOKUP)
|
||||
return (EINVAL);
|
||||
*vpp = dvp;
|
||||
VREF(dvp);
|
||||
@ -298,7 +298,7 @@ devfs_lookupx(ap)
|
||||
}
|
||||
|
||||
if (flags & ISDOTDOT) {
|
||||
if (nameiop != LOOKUP)
|
||||
if ((flags & ISLASTCN) && nameiop != LOOKUP)
|
||||
return (EINVAL);
|
||||
VOP_UNLOCK(dvp, 0, td);
|
||||
de = TAILQ_FIRST(&dd->de_dlist); /* "." */
|
||||
|
Loading…
Reference in New Issue
Block a user