teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0658-test-seccomp-accept-ENOSYS-from-sysctl-2-too.patch

b8c242
From 8c15742d1194e0db9a2555553e4d77ebb441b3dc Mon Sep 17 00:00:00 2001
b8c242
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
b8c242
Date: Tue, 22 Sep 2020 19:05:17 +0200
b8c242
Subject: [PATCH] test-seccomp: accept ENOSYS from sysctl(2) too
b8c242
b8c242
It seems that kernel 5.9 started returning that.
b8c242
b8c242
(cherry picked from commit 0af05e485a3a88f454c714901eb6109307dc893e)
b8c242
b8c242
Related: #2017033
b8c242
---
b8c242
 src/test/test-seccomp.c | 2 +-
b8c242
 1 file changed, 1 insertion(+), 1 deletion(-)
b8c242
b8c242
diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c
b8c242
index 5eb1c78b8b..6ec04c4c55 100644
b8c242
--- a/src/test/test-seccomp.c
b8c242
+++ b/src/test/test-seccomp.c
b8c242
@@ -239,7 +239,7 @@ static void test_protect_sysctl(void) {
b8c242
         if (pid == 0) {
b8c242
 #if defined __NR__sysctl &&  __NR__sysctl >= 0
b8c242
                 assert_se(syscall(__NR__sysctl, NULL) < 0);
b8c242
-                assert_se(errno == EFAULT);
b8c242
+                assert_se(IN_SET(errno, EFAULT, ENOSYS));
b8c242
 #endif
b8c242
 
b8c242
                 assert_se(seccomp_protect_sysctl() >= 0);