mirror of
https://github.com/flatpak/flatpak.git
synced 2026-09-20 04:08:56 -04:00
When --device=all is *not* passed to Flatpak, --dev is passed to bwrap, which causes it to use an intermediate user namespace to mount devpts because it can only be mounted as UID 0. Therefore, when expose-pids is used, Flatpak will pass both --userns *and* --userns2 to handle the presence of the intermediate namespace. However, when --device=all *is* passed, there is no intermediate namespace. Thus, setns(userns2) will fail with EINVAL. In order to handle this, --userns2 is no longer passed if the namespace is identical to that passed via --userns. Fixes #3722.