提交 1e532210 编写于 作者: X x00405909

适配musl库的参数dac检测

Signed-off-by: Nx00405909 <xionglei6@huawei.com>
Change-Id: Ic9f3185be28cd7342e927aaf4110cecec71fb49b
上级 3e78c220
...@@ -219,7 +219,7 @@ static int CheckParamPermission(const ParamSecurityLabel *srcLabel, const ParamA ...@@ -219,7 +219,7 @@ static int CheckParamPermission(const ParamSecurityLabel *srcLabel, const ParamA
{ {
#ifndef PARAM_SUPPORT_DAC_CHECK #ifndef PARAM_SUPPORT_DAC_CHECK
return DAC_RESULT_PERMISSION; return DAC_RESULT_PERMISSION;
#endif #else
int ret = DAC_RESULT_FORBIDED; int ret = DAC_RESULT_FORBIDED;
PARAM_CHECK(srcLabel != NULL && auditData != NULL && auditData->name != NULL, return ret, "Invalid param"); PARAM_CHECK(srcLabel != NULL && auditData != NULL && auditData->name != NULL, return ret, "Invalid param");
PARAM_CHECK((mode & (DAC_READ | DAC_WRITE | DAC_WATCH)) != 0, return ret, "Invalid mode %x", mode); PARAM_CHECK((mode & (DAC_READ | DAC_WRITE | DAC_WATCH)) != 0, return ret, "Invalid mode %x", mode);
...@@ -246,6 +246,7 @@ static int CheckParamPermission(const ParamSecurityLabel *srcLabel, const ParamA ...@@ -246,6 +246,7 @@ static int CheckParamPermission(const ParamSecurityLabel *srcLabel, const ParamA
auditData->dacData.gid, auditData->dacData.uid, auditData->dacData.mode); auditData->dacData.gid, auditData->dacData.uid, auditData->dacData.mode);
PARAM_LOGV("%s check %o localMode %o ret %d", auditData->name, mode, localMode, ret); PARAM_LOGV("%s check %o localMode %o ret %d", auditData->name, mode, localMode, ret);
return ret; return ret;
#endif
} }
PARAM_STATIC int RegisterSecurityDacOps(ParamSecurityOps *ops, int isInit) PARAM_STATIC int RegisterSecurityDacOps(ParamSecurityOps *ops, int isInit)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册