main: Only unshare if we have to
That whole dance doesn't currently correctly set `$HOME` which
breaks a bit I'm working on that uses `podman login`.
@@ -9,13 +9,14 @@ export USER=${USER:-$(id -nu)}
# Ensure we've unshared our mount namespace so
# the later umount doesn't affect the host potentially
+if [ -e /sys/fs/selinux/status ]; then
if [ -z "${coreos_assembler_unshared:-}" ]; then
exec sudo -- env coreos_assembler_unshared=1 unshare -m -- runuser -u ${USER} -- $0 "$@"
-fi
+ else
# Work around https://github.com/containers/libpod/issues/1448
-if [ -e /sys/fs/selinux/status ]; then
sudo umount /sys/fs/selinux
fi
+fi
cmd=${1:-}
build_commands="init fetch build run clean"
