summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-03-25 05:08:28 +0000
committerpeter <peter@FreeBSD.org>1997-03-25 05:08:28 +0000
commit6c63b328f925904361277656b226e772108cbf9e (patch)
tree4e569b5b1955e51f71694065d2d77803e1cc8c05 /sys/nfsserver
parent91b3ba195c72fd813d420bef87f89b9697ef7c3f (diff)
downloadFreeBSD-src-6c63b328f925904361277656b226e772108cbf9e.zip
FreeBSD-src-6c63b328f925904361277656b226e772108cbf9e.tar.gz
The local fs interface does not allow link()/unlink() of directories,
do not allow a remote nfs client to cause local fs corruption either.
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_serv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 1f77e7b..9109442 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
- * $Id$
+ * $Id: nfs_serv.c,v 1.37 1997/02/22 09:42:38 peter Exp $
*/
/*
@@ -1711,9 +1711,10 @@ nfsrv_remove(nfsd, slp, procp, mrq)
}
if (!error) {
vp = nd.ni_vp;
- if (vp->v_type == VDIR &&
- (error = suser(cred, (u_short *)0)))
+ if (vp->v_type == VDIR) {
+ error = EPERM; /* POSIX */
goto out;
+ }
/*
* The root of a mounted filesystem cannot be deleted.
*/
@@ -1997,8 +1998,10 @@ nfsrv_link(nfsd, slp, procp, mrq)
nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft);
return (0);
}
- if (vp->v_type == VDIR && (error = suser(cred, (u_short *)0)))
+ if (vp->v_type == VDIR) {
+ error = EPERM; /* POSIX */
goto out1;
+ }
nd.ni_cnd.cn_cred = cred;
nd.ni_cnd.cn_nameiop = CREATE;
nd.ni_cnd.cn_flags = LOCKPARENT;
OpenPOWER on IntegriCloud