1 Star 0 Fork 48

lxpzero/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0362-test-process-util-skip-several-verifications-when-ru.patch 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2021-06-16 16:46 . update to systemd-239-45.el8.src.rpm
From b550cc33e762fa209b0740f1874f75ef780b8d90 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Thu, 20 Sep 2018 16:08:38 +0900
Subject: [PATCH] test-process-util: skip several verifications when running in
unprivileged container
(cherry picked from commit 767eab47501b06327a0e6030e5c54860a3fc427f)
Resolves: #1823767
---
src/test/test-process-util.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c
index fd4d17408d..26e3247993 100644
--- a/src/test/test-process-util.c
+++ b/src/test/test-process-util.c
@@ -394,12 +394,17 @@ static void test_rename_process_now(const char *p, int ret) {
log_info("comm = <%s>", comm);
assert_se(strneq(comm, p, TASK_COMM_LEN-1));
- assert_se(get_process_cmdline(0, 0, false, &cmdline) >= 0);
+ r = get_process_cmdline(0, 0, false, &cmdline);
+ assert_se(r >= 0);
/* we cannot expect cmdline to be renamed properly without privileges */
if (geteuid() == 0) {
- log_info("cmdline = <%s>", cmdline);
- assert_se(strneq(p, cmdline, STRLEN("test-process-util")));
- assert_se(startswith(p, cmdline));
+ if (r == 0 && detect_container() > 0)
+ log_info("cmdline = <%s> (not verified, Running in unprivileged container?)", cmdline);
+ else {
+ log_info("cmdline = <%s>", cmdline);
+ assert_se(strneq(p, cmdline, STRLEN("test-process-util")));
+ assert_se(startswith(p, cmdline));
+ }
} else
log_info("cmdline = <%s> (not verified)", cmdline);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lxpzero/systemd.git
git@gitee.com:lxpzero/systemd.git
lxpzero
systemd
systemd
a8

搜索帮助