提交 209f6961 编写于 作者: X xiacong 提交者: 夏不白

fixed 6f29f8fc from https://gitee.com/xia-bubai/startup_init_lite/pulls/1688

<fix>
HDF进程与守护进程关闭使能seccomp
只有系统服务相关进程使能seccomp
Signed-off-by: Nxiacong <xiacong4@huawei.com>
Change-Id: Id5c085bb37160e5098740235eac0fa8af64e19e0
上级 25a0f32f
......@@ -53,6 +53,7 @@
#ifdef WITH_SECCOMP
#define APPSPAWN_NAME ("appspawn")
#define NWEBSPAWN_NAME ("nwebspawn")
#define SA_MAIN_PATH ("/system/bin/sa_main")
#endif
#ifndef TIOCSCTTY
......@@ -73,7 +74,8 @@ static void SetSystemSeccompPolicy(const Service *service)
{
#ifdef WITH_SECCOMP
if (strncmp(APPSPAWN_NAME, service->name, strlen(APPSPAWN_NAME)) \
&& strncmp(NWEBSPAWN_NAME, service->name, strlen(NWEBSPAWN_NAME))) {
&& strncmp(NWEBSPAWN_NAME, service->name, strlen(NWEBSPAWN_NAME))
&& !strncmp(SA_MAIN_PATH, service->pathArgs.argv[0], strlen(SA_MAIN_PATH))) {
PluginExecCmdByName("SetSeccompPolicy", "start");
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册