]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Only call become_root() if we need a full uid map
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 28 May 2024 12:51:32 +0000 (14:51 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 28 May 2024 12:55:56 +0000 (14:55 +0200)
If we only need to map the current user to root, bubblewrap will do
that for us and we don't need to call become_root() after forking.

mkosi/qemu.py

index 2653c496c65c725a3e6cfc52af8784b420edc399..95130e3a0d6daf164b31852cbed381ec0f71e916 100644 (file)
@@ -368,7 +368,7 @@ def start_virtiofsd(config: Config, directory: PathString, *, name: str, selinux
             # capabilities itself, we don't bother figuring out the exact set of capabilities it needs.
             user=uid if not scope else None,
             group=gid if not scope else None,
-            preexec_fn=become_root if not scope else None,
+            preexec_fn=become_root if not scope and not uidmap else None,
             env=scope_env() if scope else {},
             sandbox=config.sandbox(
                 binary=virtiofsd,