diff options
author | mux <mux@FreeBSD.org> | 2002-05-10 15:41:14 +0000 |
---|---|---|
committer | mux <mux@FreeBSD.org> | 2002-05-10 15:41:14 +0000 |
commit | 5bb8b3f421d30613dd6565a866bfbe2a5acb6491 (patch) | |
tree | fee7445ce555b356984506b5b80f5894177ac5fb /sys | |
parent | 4a83d37d7569da9c6755f382c7491c8ca784c187 (diff) | |
download | FreeBSD-src-5bb8b3f421d30613dd6565a866bfbe2a5acb6491.zip FreeBSD-src-5bb8b3f421d30613dd6565a866bfbe2a5acb6491.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 39857a9..3ec9fb5 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -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); /* "." */ |