Signed-off-by: chengjinsong <chengjinsong2@huawei.com>
Change-Id: I9ac10355b1d8110929781714bff5b2d600280cef
This commit is contained in:
chengjinsong 2022-08-15 11:45:09 +08:00
parent 4f40470fd8
commit d3fd50bbcf
3 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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++;