From owner-freebsd-rc@FreeBSD.ORG Mon Nov 8 10:51:56 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 231D716A4CE for ; Mon, 8 Nov 2004 10:51:56 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5338A43D3F for ; Mon, 8 Nov 2004 10:51:55 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])iA8ApRI0026899 for ; Mon, 8 Nov 2004 12:51:39 +0200 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) iA8ApK42000977 for ; Mon, 8 Nov 2004 12:51:20 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)iA8ApKBE000976 for freebsd-rc@freebsd.org; Mon, 8 Nov 2004 12:51:20 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Mon, 8 Nov 2004 12:51:20 +0200 From: Giorgos Keramidas To: freebsd-rc@freebsd.org Message-ID: <20041108105120.GA952@orion.daedalusnetworks.priv> References: <20041108005007.GB57736@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041108005007.GB57736@gothmog.gr> Subject: Re: RFC (fwd) Re: 5.3 tmpfs mount permissions X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to /etc/rc.d design and implementation. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2004 10:51:56 -0000 On 2004-11-08 02:50, Giorgos Keramidas wrote: > Hi, > > Does the change outlined below seem like something I should commit? The patch posted previously had a few obvious bugs. Here's an updated version, which I have tested too :-) ----- tmpmfs-options.patch starts here --- Index: share/man/man5/rc.conf.5 =================================================================== RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v retrieving revision 1.232 diff -u -u -r1.232 rc.conf.5 --- share/man/man5/rc.conf.5 23 Oct 2004 18:35:35 -0000 1.232 +++ share/man/man5/rc.conf.5 8 Nov 2004 10:23:58 -0000 @@ -240,6 +240,12 @@ Controls the size of a created .Pa /tmp memory file system. +.It Va tmpoptions +Controls the +.Xr mount 8 +options of a created +.Pa /tmp +memory file system. .It Va varmfs Controls the creation of a .Pa /var @@ -3095,6 +3101,7 @@ .Xr kldxref 8 , .Xr lpd 8 , .Xr mdconfig 8 , +.Xr mount 8 , .Xr mountd 8 , .Xr moused 8 , .Xr mrouted 8 , Index: etc/rc.subr =================================================================== RCS file: /home/ncvs/src/etc/rc.subr,v retrieving revision 1.31 diff -u -u -r1.31 rc.subr --- etc/rc.subr 30 Jul 2004 17:19:35 -0000 1.31 +++ etc/rc.subr 8 Nov 2004 10:34:55 -0000 @@ -1290,11 +1290,15 @@ # $1 = size # $2 = mount point # $3 = (optional) bytes-per-inode +# $4 = (optional) extra mount options mount_md() { + if [ -n "$4" ]; then + opt="-o $4" + fi if [ -n "$3" ]; then bpi="-i $3" fi - /sbin/mdmfs $bpi -s $1 -M md $2 + /sbin/mdmfs $bpi $opt -s $1 -M md $2 } fi Index: etc/defaults/rc.conf =================================================================== RCS file: /home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.226 diff -u -u -r1.226 rc.conf --- etc/defaults/rc.conf 20 Oct 2004 16:58:27 -0000 1.226 +++ etc/defaults/rc.conf 8 Nov 2004 10:33:25 -0000 @@ -40,6 +40,7 @@ removable_interfaces="" # Removable network interfaces for /etc/pccard_ether. tmpmfs="AUTO" # Set to YES to always create an mfs /tmp, NO to never tmpsize="20m" # Size of mfs /tmp if created +tmpoptions="noexec,nosuid,nodev" # Extra mount options for the mfs /tmp varmfs="AUTO" # Set to YES to always create an mfs /var, NO to never varsize="32m" # Size of mfs /var if created populate_var="AUTO" # Set to YES to always (re)populate /var, NO to never Index: etc/rc.d/tmp =================================================================== RCS file: /home/ncvs/src/etc/rc.d/tmp,v retrieving revision 1.34 diff -u -u -r1.34 tmp --- etc/rc.d/tmp 7 Oct 2004 13:55:26 -0000 1.34 +++ etc/rc.d/tmp 8 Nov 2004 10:33:37 -0000 @@ -42,7 +42,7 @@ # case "${tmpmfs}" in [Yy][Ee][Ss]) - mount_md ${tmpsize} /tmp + mount_md ${tmpsize} /tmp '' ${tmpoptions} chmod 01777 /tmp ;; [Nn][Oo]) @@ -56,7 +56,7 @@ echo "dropping into shell, ^D to continue anyway." /bin/sh else - mount_md ${tmpsize} /tmp + mount_md ${tmpsize} /tmp '' ${tmpoptions} chmod 01777 /tmp fi fi ----- tmpmfs-options.patch ends here ---