From owner-freebsd-current Sat Feb 3 9:49:34 2001 Delivered-To: freebsd-current@freebsd.org Received: from mobile.wemm.org (c1315225-a.plstn1.sfba.home.com [65.0.135.147]) by hub.freebsd.org (Postfix) with ESMTP id B761737B503 for ; Sat, 3 Feb 2001 09:49:16 -0800 (PST) Received: from netplex.com.au (localhost [127.0.0.1]) by mobile.wemm.org (8.11.1/8.11.1) with ESMTP id f13HmuW44694; Sat, 3 Feb 2001 09:48:56 -0800 (PST) (envelope-from peter@netplex.com.au) Message-Id: <200102031748.f13HmuW44694@mobile.wemm.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: Poul-Henning Kamp Cc: Warner Losh , Jordan Hubbard , John Indra , freebsd-current@FreeBSD.ORG Subject: Re: DEVFS newbie... In-Reply-To: <14457.981221808@critter> Date: Sat, 03 Feb 2001 09:48:56 -0800 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Poul-Henning Kamp wrote: > In message <200102031729.f13HTL960996@harmony.village.org>, Warner Losh write s: > >In message <82167.981191888@winston.osd.bsdi.com> Jordan Hubbard writes: > >: Couldn't you also do "mount -t devfs -o nonewdev devfs /home/jail/dev" > >: and then cd /home/jail/dev ; rm $devices_i_dont_want_in_my_jails ? It > >: seems that "read my lips: no new devices" should be an option you can > >: set from the very initial mount so that people can't also figure out > >: how to get root, remove a /dev entry and replace it with one of their > >: own. Come to think of it, there should also be a -o staticdev option > >: to disallow *any* changes after the initial mount. That would make > >: some of our more paranoid sysadmins happy. > > > >My concern is that I usually know what devices I want (/dev/null, > >/dev/zero, /dev/tty). That makes it harder to delete all of them not > >on the list. > > I have seriously been thinking about some way to say something like > mount -t devfs -o jailset /home/jail/dev > but an elegant implementation evades me at this moment. As bizzare as it sounds, I like Julian's hack for populating this stuff... ie: use a hard link to propagate nodes to the jailed /dev. eg: mount -t devfs -o empty /home/jail/dev ln /dev/null /home/jail/dev/null ln /dev/zero /home/jail/dev/zero ... mount -u -o ro /home/jail/dev It solves several problems, but is kinda odd as it involves a cross-filesystem hard link. This is another way oround the "oops, I didn't mean to rm /dev/null" - ie: mount -t devfs /mnt ln /mnt/null /dev umount /mnt The VOP_LINK() stuff has access to the source and destination, so it doesn't have to guess what do do on incomplete information (eg: fake major number). On the other hand... Suppose whiteouts were implemented... mount -t devfs -o empty /home/jail/dev cd /home/jail/dev rm -W null zero log .... mount -u -o ro /home/jail/dev ie: start with the initial state as "whiteouts on everything" and then selectively remove the whiteout for things you actually want... Then freeze it by flipping on the readonly bit. > And again, it hinges on an extensible set of mount options. Yeah. Maybe pass in arbitary strins "empty" instead of trying to convert everything to a flag bit? I've been bothered about this for a while. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message