mirror of
https://gitee.com/openharmony/startup_appspawn
synced 2025-02-18 19:18:12 +00:00
commit
0381991bfe
@ -54,7 +54,7 @@ void SetSelinuxCon(struct AppSpawnContent_ *content, AppSpawnClient *client)
|
||||
void SetUidGidFilter(struct AppSpawnContent_ *content)
|
||||
{
|
||||
#ifdef WITH_SECCOMP
|
||||
if (!SetSeccompPolicy(APPSPAWN)) {
|
||||
if (!SetSeccompPolicyWithName(APPSPAWN_NAME)) {
|
||||
APPSPAWN_LOGE("AppSpawnServer::Failed to set APPSPAWN seccomp filter");
|
||||
} else {
|
||||
APPSPAWN_LOGI("AppSpawnServer::Success to set APPSPAWN seccomp filter");
|
||||
@ -62,26 +62,21 @@ void SetUidGidFilter(struct AppSpawnContent_ *content)
|
||||
#endif
|
||||
}
|
||||
|
||||
int SetSeccompFilter(struct AppSpawnContent_ *content, AppSpawnClient *client)
|
||||
void SetSeccompFilter(struct AppSpawnContent_ *content, AppSpawnClient *client)
|
||||
{
|
||||
#ifdef WITH_SECCOMP
|
||||
#ifdef NWEB_SPAWN
|
||||
if (!SetSeccompPolicy(NWEBSPAWN)) {
|
||||
if (!SetSeccompPolicyWithName(NWEBSPAWN_NAME)) {
|
||||
APPSPAWN_LOGE("NwebspawnServer::Failed to set NWEBSPAWN seccomp filter");
|
||||
return -1;
|
||||
} else {
|
||||
APPSPAWN_LOGI("NwebspawnServer::Success to set NWEBSPAWN seccomp filter");
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
if (!SetSeccompPolicy(APP)) {
|
||||
if (!SetSeccompPolicyWithName(APP_NAME)) {
|
||||
APPSPAWN_LOGE("AppSpawnServer::Failed to set APP seccomp filter");
|
||||
return -1;
|
||||
} else {
|
||||
APPSPAWN_LOGI("AppSpawnServer::Success to set APP seccomp filter");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ int GetRenderProcessTerminationStatus(int32_t pid, int *status);
|
||||
void RecordRenderProcessExitedStatus(pid_t pid, int status);
|
||||
void LoadAppSandboxConfig(void);
|
||||
void SetUidGidFilter(struct AppSpawnContent_ *content);
|
||||
int SetSeccompFilter(struct AppSpawnContent_ *content, AppSpawnClient *client);
|
||||
void SetSeccompFilter(struct AppSpawnContent_ *content, AppSpawnClient *client);
|
||||
int32_t GetAppNamespaceFlags(const char *bundleName);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -100,9 +100,7 @@ int DoStartApp(struct AppSpawnContent_ *content, AppSpawnClient *client, char *l
|
||||
}
|
||||
|
||||
if (content->setSeccompFilter) {
|
||||
ret = content->setSeccompFilter(content, client);
|
||||
APPSPAWN_CHECK(ret == 0, NotifyResToParent(content, client, ret);
|
||||
return ret, "Failed to set setSeccompFilter");
|
||||
content->setSeccompFilter(content, client);
|
||||
}
|
||||
|
||||
if (content->setUidGid) {
|
||||
|
@ -82,7 +82,7 @@ typedef struct AppSpawnContent_ {
|
||||
#ifdef ASAN_DETECTOR
|
||||
int (*getWrapBundleNameValue)(struct AppSpawnContent_ *content, AppSpawnClient *client);
|
||||
#endif
|
||||
int (*setSeccompFilter)(struct AppSpawnContent_ *content, AppSpawnClient *client);
|
||||
void (*setSeccompFilter)(struct AppSpawnContent_ *content, AppSpawnClient *client);
|
||||
} AppSpawnContent;
|
||||
|
||||
typedef struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user