ryantimwilson / rpms / systemd

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