未验证 提交 8dbcb648 编写于 作者: O openharmony_ci 提交者: Gitee

!1688 调整使能seccomp的进程范围

Merge pull request !1688 from 夏不白/only_enable_sa
......@@ -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.
先完成此消息的编辑!
想要评论请 注册