aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2026-10-02 08:55:54 +0200
committerStefano Brivio <sbrivio@redhat.com>2026-10-02 23:04:24 +0200
commita51d395de1daca9ddd3be4d5255e867cb4d470f9 (patch)
treef04a6eaa0d5d5fa61fc3aa31ac0211476feb6c35
parentf86196b822a64a14ac7f4ce8307d687135a486bd (diff)
downloadpasst-a51d395de1daca9ddd3be4d5255e867cb4d470f9.tar
passt-a51d395de1daca9ddd3be4d5255e867cb4d470f9.tar.gz
passt-a51d395de1daca9ddd3be4d5255e867cb4d470f9.tar.bz2
passt-a51d395de1daca9ddd3be4d5255e867cb4d470f9.tar.lz
passt-a51d395de1daca9ddd3be4d5255e867cb4d470f9.tar.xz
passt-a51d395de1daca9ddd3be4d5255e867cb4d470f9.tar.zst
passt-a51d395de1daca9ddd3be4d5255e867cb4d470f9.zip
util: Make setting uidmap and gidmap errors non-fatal
Starting from commit 7bf1595c9242 ("isolation: Don't create our userns as nobody"), we unconditionally set uidmap and gidmap in the detached user namespace. If passt is started from a detached PID namespace, but /proc hasn't been remounted to reflect this, we'll fail to write those entries. That's actually fine as uidmap and gidmap are something that, strictly speaking, we only need to write in pasta mode when a command is detached (it's now done in all cases for simplicity). Warn, because it's not the expected behaviour (/proc should probably be remounted first), but don't fail on that. Reported-by: Qiyu Yan <yanqiyu@fedoraproject.org> Link: https://github.com/containers/crun/issues/2283 Suggested-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index c02aea9..ff1f19f 100644
--- a/util.c
+++ b/util.c
@@ -1147,5 +1147,5 @@ void make_ugid_map(pid_t pid, uid_t uid, gid_t gid)
if (write_file(uidmap_path, uidmap) ||
write_file(setgroups_path, "deny") ||
write_file(gidmap_path, gidmap))
- die("Couldn't configure user mappings");
+ warn("Couldn't configure user mappings");
}