ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
152484
From 3c54c67a7fc65dc5b49b2452739c19b94eeb98a9 Mon Sep 17 00:00:00 2001
152484
From: David Tardon <dtardon@redhat.com>
152484
Date: Tue, 21 Dec 2021 10:46:17 +0100
152484
Subject: [PATCH] Treat EPERM as "not available" too
152484
152484
We need to do this because idmapped mounts habe been disabled in RHEL-9
152484
kernel: https://bugzilla.redhat.com/show_bug.cgi?id=2018141 .
152484
152484
RHEL-only
152484
152484
Fixes #55
152484
152484
Related: #2017035
152484
---
152484
 src/nspawn/nspawn.c | 2 +-
152484
 1 file changed, 1 insertion(+), 1 deletion(-)
152484
152484
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
152484
index 8f17ab8810..9225c8f162 100644
152484
--- a/src/nspawn/nspawn.c
152484
+++ b/src/nspawn/nspawn.c
152484
@@ -3780,7 +3780,7 @@ static int outer_child(
152484
             arg_uid_shift != 0) {
152484
 
152484
                 r = remount_idmap(directory, arg_uid_shift, arg_uid_range);
152484
-                if (r == -EINVAL || ERRNO_IS_NOT_SUPPORTED(r)) {
152484
+                if (IN_SET(r, -EINVAL, -EPERM) || ERRNO_IS_NOT_SUPPORTED(r)) {
152484
                         /* This might fail because the kernel or file system doesn't support idmapping. We
152484
                          * can't really distinguish this nicely, nor do we have any guarantees about the
152484
                          * error codes we see, could be EOPNOTSUPP or EINVAL. */