]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-seccomp: do not fail when already MemoryDenyWriteExecute= is enabled
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 Dec 2025 00:24:57 +0000 (09:24 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 7 Dec 2025 00:09:03 +0000 (09:09 +0900)
src/test/test-seccomp.c

index 0a34584cff23cf9ebdd6b12a6586ba0c30e45716..e81355abdd3e61cbd015fdccea43e0dd2a8ffd81 100644 (file)
@@ -611,7 +611,10 @@ TEST(memory_deny_write_execute_shmat) {
                 void *p;
 
                 p = shmat(shmid, NULL, 0);
-                assert_se(p != MAP_FAILED);
+                if (p == MAP_FAILED) {
+                        log_tests_skipped_errno(errno, "shmat() is already disabled");
+                        _exit(EXIT_SUCCESS);
+                }
                 assert_se(shmdt(p) == 0);
 
                 p = shmat(shmid, NULL, SHM_EXEC);