mirror of
https://gitee.com/openharmony/startup_init
synced 2024-12-03 00:16:47 +00:00
codex
Signed-off-by: chengjinsong <chengjinsong2@huawei.com> Change-Id: I9ac10355b1d8110929781714bff5b2d600280cef
This commit is contained in:
parent
4f40470fd8
commit
d3fd50bbcf
@ -33,7 +33,7 @@
|
|||||||
static bool IsSupportFilterFlag(unsigned int filterFlag)
|
static bool IsSupportFilterFlag(unsigned int filterFlag)
|
||||||
{
|
{
|
||||||
errno = 0;
|
errno = 0;
|
||||||
int ret = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, filterFlag, NULL);
|
long ret = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, filterFlag, NULL);
|
||||||
if (ret != -1 || errno != EFAULT) {
|
if (ret != -1 || errno != EFAULT) {
|
||||||
SECCOMP_LOGE("not support seccomp flag %u", filterFlag);
|
SECCOMP_LOGE("not support seccomp flag %u", filterFlag);
|
||||||
return false;
|
return false;
|
||||||
|
@ -92,7 +92,7 @@ static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit)
|
|||||||
security->flags[PARAM_SECURITY_SELINUX] = 0;
|
security->flags[PARAM_SECURITY_SELINUX] = 0;
|
||||||
PARAM_LOGV("InitLocalSecurityLabel");
|
PARAM_LOGV("InitLocalSecurityLabel");
|
||||||
#if !(defined STARTUP_INIT_TEST || defined LOCAL_TEST)
|
#if !(defined STARTUP_INIT_TEST || defined LOCAL_TEST)
|
||||||
if (isInit) {
|
if ((bool)isInit) {
|
||||||
int ret = InitSelinuxOpsForInit(&GetParamWorkSpace()->selinuxSpace);
|
int ret = InitSelinuxOpsForInit(&GetParamWorkSpace()->selinuxSpace);
|
||||||
PARAM_CHECK(ret == 0, return -1, "Failed to init selinux ops");
|
PARAM_CHECK(ret == 0, return -1, "Failed to init selinux ops");
|
||||||
} else {
|
} else {
|
||||||
|
@ -105,7 +105,7 @@ static int CheckNeedInit(int onlyRead, const PARAM_WORKSPACE_OPS *ops)
|
|||||||
g_paramWorkSpace.ops.setfilecon = ops->setfilecon;
|
g_paramWorkSpace.ops.setfilecon = ops->setfilecon;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
PARAM_LOGI("InitParamWorkSpace %p %x", &g_paramWorkSpace, g_paramWorkSpace.flags);
|
PARAM_LOGI("InitParamWorkSpace %x", g_paramWorkSpace.flags);
|
||||||
if (PARAM_TEST_FLAG(g_paramWorkSpace.flags, WORKSPACE_FLAGS_INIT)) {
|
if (PARAM_TEST_FLAG(g_paramWorkSpace.flags, WORKSPACE_FLAGS_INIT)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ static int CheckNeedInit(int onlyRead, const PARAM_WORKSPACE_OPS *ops)
|
|||||||
}
|
}
|
||||||
// for ut, do not init workspace
|
// for ut, do not init workspace
|
||||||
char path[PATH_MAX] = { 0 };
|
char path[PATH_MAX] = { 0 };
|
||||||
(void)readlink("/proc/self/exe", path, sizeof(path));
|
(void)readlink("/proc/self/exe", path, sizeof(path) - 1);
|
||||||
char *name = strrchr(path, '/');
|
char *name = strrchr(path, '/');
|
||||||
if (name != NULL) {
|
if (name != NULL) {
|
||||||
name++;
|
name++;
|
||||||
|
Loading…
Reference in New Issue
Block a user