9fans archive / 1998 / 11 / 98 /    prev next

From: Roger Peppe rog@ohm...
Subject: [9fans] removing a name from the name space
Date: Thu, 19 Nov 98 15:53:34 GMT

> 	# create a sandbox
> 	mkdir sandbox/x
> 	mkdir sandbox/x/bin
> 	mkdir sandbox/dev
> 	> sandbox/dev/cons
> 	> sandbox/dev/mouse
> 	> sandbox/dev/time
> 	mkdir sandbox/tmp
>
> 	# bind things into it
> 	bind -c /386/safebin sandbox/x/bin
> 	bind -c /dev/cons sandbox/x/dev/cons
> 	bind -c /dev/mouse sandbox/x/dev/mouse
> 	bind -c /dev/time sandbox/x/dev/time
>
> 	# replace the root
> 	bind -c sandbox/x /
> 	magic call to turn off '#' access
>
> At this point you can exec a game and it will be hard
> pressed to get to things outside the original namespace
> though it can still change its namespace.

does this guarantee that if you cd to sandbox/x/bin/..
you will be in sandbox/x, not /386?

i found the semantics of ".." always seemed rather unobvious within
the plan 9 namespace (particularly with union directories...)

is there a simple way of understanding it?

  cheers,
    rog.