Re: [RCF] [PATCH] unprivileged mount/umount

Miklos Szeredi
2005-05-11T21:34:55Z

> Still easy.
>
> To keep persistent named namespaces in /var/namespaces, thus:
>
> # Just once please!
> mount -t tmpfs none /var/namespaces
>
> # Make a named namespace.
> NSNAME='fred'
> mkdir /var/namespaces/$NSNAME
> run_in_new_namespace mount -t bind / /var/namespaces/$NSNAME

That's not going to work, since the mount will only affect the new
namespace. You'd need clone(), and then in the original namespace

mount --bind /proc/CHILDPID/root /var/namespace/$NSNAME

and then child process can safely exit.

Miklos