提交 3c779896 编写于 作者: L laiguizhong

修改selinux log

Signed-off-by: Nlaiguizhong <laiguizhong@huawei.com>
上级 bb44ec42
......@@ -50,8 +50,6 @@ static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit)
g_selinuxSpace.setSelinuxLogCallback = (void (*)())dlsym(handle, "SetSelinuxLogCallback");
PARAM_CHECK(g_selinuxSpace.setSelinuxLogCallback != NULL,
return -1, "Failed to dlsym setSelinuxLogCallback %s", dlerror());
// log
g_selinuxSpace.setSelinuxLogCallback();
}
if (g_selinuxSpace.setParamCheck == NULL) {
g_selinuxSpace.setParamCheck = (SelinuxSetParamCheck)dlsym(handle, "SetParamCheck");
......@@ -75,6 +73,10 @@ static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit)
PARAM_CHECK(g_selinuxSpace.destroyParamList != NULL,
return -1, "Failed to dlsym destroyParamList %s", dlerror());
}
if (isInit) {
// log
g_selinuxSpace.setSelinuxLogCallback();
}
#endif
PARAM_LOGV("Load sulinux lib success.");
return 0;
......@@ -133,7 +135,7 @@ static int SelinuxCheckParamPermission(const ParamSecurityLabel *srcLabel, const
if (mode == DAC_WRITE) {
ret = g_selinuxSpace.setParamCheck(name, &uc);
} else {
ret = g_selinuxSpace.readParamCheck(name);
ret = 0;
}
if (ret != 0) {
PARAM_LOGI("Selinux check name %s pid %d uid %d %d result %d", name, uc.pid, uc.uid, uc.gid, ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册