From owner-freebsd-current Wed Oct 22 05:48:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id FAA26604 for current-outgoing; Wed, 22 Oct 1997 05:48:05 -0700 (PDT) (envelope-from owner-freebsd-current) Received: from eclogite.eps.nagoya-u.ac.jp (eclogite.eps.nagoya-u.ac.jp [133.6.57.67]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id FAA26581; Wed, 22 Oct 1997 05:47:58 -0700 (PDT) (envelope-from kato@eclogite.eps.nagoya-u.ac.jp) Received: from gneiss.eps.nagoya-u.ac.jp (gneiss.eps.nagoya-u.ac.jp [133.6.57.99]) by eclogite.eps.nagoya-u.ac.jp (8.8.7/3.3W9) with ESMTP id VAA15665; Wed, 22 Oct 1997 21:50:25 +0900 (JST) Received: from marble.eps.nagoya-u.ac.jp (localhost [127.0.0.1]) by gneiss.eps.nagoya-u.ac.jp (8.8.7/3.5Wpl5) with ESMTP id VAA01644; Wed, 22 Oct 1997 21:47:53 +0900 (JST) Message-Id: <199710221247.VAA01644@gneiss.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 ] From: KATO Takenori In-Reply-To: Your message of "Wed, 22 Oct 1997 10:08:11 +0100" References: <9710221008.aa03556@salmon.maths.tcd.ie> X-Mailer: Mew version 1.70 on Emacs 19.28.1 / Mule 2.3 X-PGP-Fingerprint: 03 72 85 36 62 46 23 03 52 B1 10 22 44 10 0D 9E Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 22 Oct 1997 21:47:53 +0900 Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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 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) -------------------