Skip to content

Replace use of newns.c by unshare from util-linux [essential]

Olivier Gayot requested to merge ogayot/os-prober:unshare into master

In order to run os-prober in a more isolated mode, we introduced the newns.c source file a while ago. We build it to a binary and ship it in os-prober and os-prober-udeb.

The original idea was to run os-prober in a private mount namespace. Sadly, calling the unshare(CLONE_NEWNS) system call is only enough to create a new mount namespace. But it is not enough to make the new namespace private.

It would be possible to patch newns.c to make the new mount namespace private but since the unshare(1) tool can create the namespace and make it private for us, there seems to be no point building and shipping a separate tool.

See also:

https://github.com/util-linux/util-linux/commit/f0f22e9c6f109f8c1234caa3173368ef43b023eb

Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034485

Merge request reports

Loading