1 Star 0 Fork 49

happy_orange/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0389-seccomp-fix-__NR__sysctl-usage.patch 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2021-06-16 16:46 . update to systemd-239-45.el8.src.rpm
From 65a066aae68744e889c114cee56dff5b48d872df Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Thu, 4 Jun 2020 16:55:52 +0200
Subject: [PATCH] seccomp: fix __NR__sysctl usage
Loosely based on
https://github.com/systemd/systemd/pull/14032 and
https://github.com/systemd/systemd/pull/14268.
Related: #1843871
---
src/test/test-seccomp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c
index 4021a06e0e..009a2e1922 100644
--- a/src/test/test-seccomp.c
+++ b/src/test/test-seccomp.c
@@ -237,14 +237,14 @@ static void test_protect_sysctl(void) {
assert_se(pid >= 0);
if (pid == 0) {
-#if __NR__sysctl > 0
+#if defined __NR__sysctl && __NR__sysctl >= 0
assert_se(syscall(__NR__sysctl, NULL) < 0);
assert_se(errno == EFAULT);
#endif
assert_se(seccomp_protect_sysctl() >= 0);
-#if __NR__sysctl > 0
+#if defined __NR__sysctl && __NR__sysctl >= 0
assert_se(syscall(__NR__sysctl, 0, 0, 0) < 0);
assert_se(errno == EPERM);
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/happy_orange/systemd.git
git@gitee.com:happy_orange/systemd.git
happy_orange
systemd
systemd
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385