summaryrefslogtreecommitdiffstats
path: root/src/test/test-condition.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:28:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:28:16 +0000
commit6341b7a467c18d6e03bf56e32d516ed3dca6e80c (patch)
tree84262c0a568a2d869b75c0cf165969b6b0e6ca27 /src/test/test-condition.c
parentAdding debian version 256.5-2. (diff)
downloadsystemd-6341b7a467c18d6e03bf56e32d516ed3dca6e80c.tar.xz
systemd-6341b7a467c18d6e03bf56e32d516ed3dca6e80c.zip
Merging upstream version 256.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test-condition.c')
-rw-r--r--src/test/test-condition.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/test-condition.c b/src/test/test-condition.c
index be83690..76b2af9 100644
--- a/src/test/test-condition.c
+++ b/src/test/test-condition.c
@@ -1003,6 +1003,13 @@ TEST(condition_test_group) {
condition_free(condition);
free(gid);
+ /* In an unprivileged user namespace with the current user mapped to root, all the auxiliary groups
+ * of the user will be mapped to the nobody group, which means the user in the user namespace is in
+ * both the root and the nobody group, meaning the next test can't work, so let's skip it in that
+ * case. */
+ if (in_group(NOBODY_GROUP_NAME) && in_group("root"))
+ return (void) log_tests_skipped("user is in both root and nobody group");
+
groupname = (char*)(getegid() == 0 ? NOBODY_GROUP_NAME : "root");
condition = condition_new(CONDITION_GROUP, groupname, false, false);
assert_se(condition);