From 6a351122c4382fcdcec08002ee7950231c9bac8b Mon Sep 17 00:00:00 2001 From: yichengzhao Date: Thu, 5 May 2022 14:41:56 +0800 Subject: [PATCH] add acls Signed-off-by: yichengzhao Change-Id: I44e797fd2afab94b5d5088fcecd5c36ef7e7ef8f --- services/init/include/init_service.h | 1 + services/init/init_service_manager.c | 2 ++ services/init/standard/init_service.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/services/init/include/init_service.h b/services/init/include/init_service.h index 60748a05..cdcf6af2 100644 --- a/services/init/include/init_service.h +++ b/services/init/include/init_service.h @@ -142,6 +142,7 @@ typedef struct Service_ { char apl[MAX_APL_NAME + 1]; ServiceArgs capsArgs; ServiceArgs permArgs; + ServiceArgs permAclsArgs; Perms servPerm; ServiceArgs pathArgs; ServiceArgs extraArgs; diff --git a/services/init/init_service_manager.c b/services/init/init_service_manager.c index de2bda03..6e28b600 100644 --- a/services/init/init_service_manager.c +++ b/services/init/init_service_manager.c @@ -205,6 +205,7 @@ void ReleaseService(Service *service) FreeServiceArg(&service->writePidArgs); FreeServiceArg(&service->capsArgs); FreeServiceArg(&service->permArgs); + FreeServiceArg(&service->permAclsArgs); if (service->servPerm.caps != NULL) { free(service->servPerm.caps); @@ -809,6 +810,7 @@ int ParseOneService(const cJSON *curItem, Service *service) (void)GetServiceArgs(curItem, "writepid", MAX_WRITEPID_FILES, &service->writePidArgs); (void)GetServiceArgs(curItem, D_CAPS_STR_IN_CFG, MAX_WRITEPID_FILES, &service->capsArgs); (void)GetServiceArgs(curItem, "permission", MAX_WRITEPID_FILES, &service->permArgs); + (void)GetServiceArgs(curItem, "permission_acls", MAX_WRITEPID_FILES, &service->permAclsArgs); (void)GetStringItem(curItem, APL_STR_IN_CFG, service->apl, MAX_APL_NAME); (void)GetCpuArgs(curItem, CPU_CORE_STR_IN_CFG, service); ret = GetServiceSandbox(curItem, service); diff --git a/services/init/standard/init_service.c b/services/init/standard/init_service.c index 5e530aee..ef20a23e 100644 --- a/services/init/standard/init_service.c +++ b/services/init/standard/init_service.c @@ -151,8 +151,10 @@ void GetAccessToken(void) NativeTokenInfoParams nativeTokenInfoParams = { service->capsArgs.count, service->permArgs.count, + service->permAclsArgs.count, (const char **)service->capsArgs.argv, (const char **)service->permArgs.argv, + (const char **)service->permAclsArgs.argv, service->name, service->apl, }; -- GitLab