aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKATO Takenori <kato@FreeBSD.org>1997-10-23 09:29:09 +0000
committerKATO Takenori <kato@FreeBSD.org>1997-10-23 09:29:09 +0000
commit1c1ff2947bf4d6734f7d7f768be4b4771e3f6d16 (patch)
treea7b09685606fbac50e5ebd792f79c0a128412dff /sys
parent5eec03280abf4ec3d7da88df931861a64e393d21 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_extattr.c9
-rw-r--r--sys/kern/vfs_syscalls.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 057e908f58ef..cafe82d4239d 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.76 1997/10/12 20:24:27 phk Exp $
+ * $Id: vfs_syscalls.c,v 1.77 1997/10/22 07:28:51 joerg Exp $
*/
/*
@@ -77,6 +77,10 @@
static int change_dir __P((struct nameidata *ndp, struct proc *p));
static void checkdirs __P((struct vnode *olddp));
+static int usermount = 0; /* if 1, non-root can mount fs. */
+
+SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "");
+
/*
* Virtual File System System Calls
*/
@@ -113,6 +117,9 @@ mount(p, uap, retval)
struct nameidata nd;
char fstypename[MFSNAMELEN];
+ if (usermount == 0 && (error = suser(p->p_ucred, &p->p_acflag)))
+ return (error);
+
/*
* Get vnode to be covered
*/
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 057e908f58ef..cafe82d4239d 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.76 1997/10/12 20:24:27 phk Exp $
+ * $Id: vfs_syscalls.c,v 1.77 1997/10/22 07:28:51 joerg Exp $
*/
/*
@@ -77,6 +77,10 @@
static int change_dir __P((struct nameidata *ndp, struct proc *p));
static void checkdirs __P((struct vnode *olddp));
+static int usermount = 0; /* if 1, non-root can mount fs. */
+
+SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "");
+
/*
* Virtual File System System Calls
*/
@@ -113,6 +117,9 @@ mount(p, uap, retval)
struct nameidata nd;
char fstypename[MFSNAMELEN];
+ if (usermount == 0 && (error = suser(p->p_ucred, &p->p_acflag)))
+ return (error);
+
/*
* Get vnode to be covered
*/