nspawn: only remount /usr/ with idmap when --volatile=yes
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 6 Sep 2024 04:18:59 +0000 (13:18 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 8 Oct 2024 15:39:12 +0000 (16:39 +0100)
commit8f31e8ca8441eef357556a82c498c7ea227f1f6a
tree55460ff48c62fc4c327d051b82b3b7d4618d3af1
parent8c31367d23b091c5ea423cf47f6e2b9a0ea65c93
nspawn: only remount /usr/ with idmap when --volatile=yes

The root directory is already mounted with a picked UID shift, hence
it is not necessary to remount with idmap. However, /usr/ is a bind-mount,
hence it must be remounted with idmap.

With this change, now '-U --volatile=yes' works fine.

Fixes #34254.

(cherry picked from commit 025be2361b3ee7cc3732fb3963d36b8583842064)
src/nspawn/nspawn.c