适配musl库的参数dac检测

Signed-off-by: x00405909 <xionglei6@huawei.com>
Change-Id: Ic9f3185be28cd7342e927aaf4110cecec71fb49b
This commit is contained in:
x00405909 2022-01-26 20:42:49 +08:00
parent 3e78c22066
commit 1e532210f5

View File

@ -219,7 +219,7 @@ static int CheckParamPermission(const ParamSecurityLabel *srcLabel, const ParamA
{
#ifndef PARAM_SUPPORT_DAC_CHECK
return DAC_RESULT_PERMISSION;
#endif
#else
int ret = DAC_RESULT_FORBIDED;
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);
@ -246,6 +246,7 @@ static int CheckParamPermission(const ParamSecurityLabel *srcLabel, const ParamA
auditData->dacData.gid, auditData->dacData.uid, auditData->dacData.mode);
PARAM_LOGV("%s check %o localMode %o ret %d", auditData->name, mode, localMode, ret);
return ret;
#endif
}
PARAM_STATIC int RegisterSecurityDacOps(ParamSecurityOps *ops, int isInit)