Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 1997 21:47:53 +0900
From:      KATO Takenori <kato@migmatite.eps.nagoya-u.ac.jp>
To:        dwmalone@maths.tcd.ie
Cc:        current@freebsd.org, freebsd-stable@freebsd.org
Subject:   Re: Recursive mount [ was Re: -STABLE reboots ]
Message-ID:  <199710221247.VAA01644@gneiss.eps.nagoya-u.ac.jp>
In-Reply-To: Your message of "Wed, 22 Oct 1997 10:08:11 %2B0100"
References:  <9710221008.aa03556@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
> Could someone add a sysctl to current that makes
> mount a privilaged syscall?

How about following patch?

---------- BEGIN ----------
*** vfs_syscalls.c.ORIG	Wed Oct 22 20:24:15 1997
--- vfs_syscalls.c	Wed Oct 22 20:34:21 1997
***************
*** 77,82 ****
--- 77,86 ----
  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
   */
***************
*** 112,117 ****
--- 116,124 ----
  	u_long fstypenum;
  	struct nameidata nd;
  	char fstypename[MFSNAMELEN];
+ 
+ 	if (usermount == 0 && (error = suser(p->p_ucred, &p->p_acflag)))
+ 		return (error);
  
  	/*
  	 * Get vnode to be covered
---------- END ----------


----
KATO Takenori <kato@ganko.eps.nagoya-u.ac.jp>
Dept. Earth Planet. Sci., Nagoya Univ.,  Nagoya, 464-01, Japan
PGP public key: finger kato@eclogite.eps.nagoya-u.ac.jp
------------------- Powered by FreeBSD(98) -------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710221247.VAA01644>