teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

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

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