Skip to content

Add unshare mode

Jelle van der Waa requested to merge github/fork/Forty-Bot/unshare into master

Created by: Forty-Bot

This adds support for "unshare" mode. The idea here is that we can create new namespaces with unshare() and then become root in that namespace. To do this, we need a new helper arch-unshare, as the unshare from util-linux is unsuitable; see commit 2 for details. Commands run with this helper will see themselves as the root user, but all actions they take will be done as a regular user.

I have left off documentation and completion updates because I would like to make sure I am taking the right approach first. But for example, you can now create a root tarball as a regular user:

$ mkdir mnt
$ arch-unshare pacstrap -u mnt
$ arch-unshare tar -C mnt -cvf arch.tar .
$ arch-unshare rm -rf mnt

You will also need to have added entries for your user to /etc/subuid and /etc/subgid.

Closes: #8 (closed)

Merge request reports