mirror of
https://gitee.com/openharmony/startup_init
synced 2024-12-02 16:06:31 +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)
|
||||
{
|
||||
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) {
|
||||
SECCOMP_LOGE("not support seccomp flag %u", filterFlag);
|
||||
return false;
|
||||
|
@ -92,7 +92,7 @@ static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit)
|
||||
security->flags[PARAM_SECURITY_SELINUX] = 0;
|
||||
PARAM_LOGV("InitLocalSecurityLabel");
|
||||
#if !(defined STARTUP_INIT_TEST || defined LOCAL_TEST)
|
||||
if (isInit) {
|
||||
if ((bool)isInit) {
|
||||
int ret = InitSelinuxOpsForInit(&GetParamWorkSpace()->selinuxSpace);
|
||||
PARAM_CHECK(ret == 0, return -1, "Failed to init selinux ops");
|
||||
} else {
|
||||
|
@ -105,7 +105,7 @@ static int CheckNeedInit(int onlyRead, const PARAM_WORKSPACE_OPS *ops)
|
||||
g_paramWorkSpace.ops.setfilecon = ops->setfilecon;
|
||||
#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)) {
|
||||
return 0;
|
||||
}
|
||||
@ -118,7 +118,7 @@ static int CheckNeedInit(int onlyRead, const PARAM_WORKSPACE_OPS *ops)
|
||||
}
|
||||
// for ut, do not init workspace
|
||||
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, '/');
|
||||
if (name != NULL) {
|
||||
name++;
|
||||
|
Loading…
Reference in New Issue
Block a user