Poul-Henning Kamp wrote:
> In message <[EMAIL PROTECTED]>, Warner Losh write
> >In message <[EMAIL PROTECTED]> 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.

"All of this is for nothing if we don't go to the stars" - JMS/B5

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to