未验证 提交 7f28fc37 编写于 作者: O openharmony_ci 提交者: Gitee

!1502 非musl库不使用dac校验

Merge pull request !1502 from Mupceet/master_not_checkdac_notmusl
......@@ -129,6 +129,9 @@ static int LoadOneParam_(const uint32_t *context, const char *name, const char *
auditData.name = name;
int ret = GetParamDacData(&auditData.dacData, value);
PARAM_CHECK(ret == 0, return -1, "Failed to get param info %d %s", ret, name);
if (INVALID_UID(auditData.dacData.gid) || INVALID_UID(auditData.dacData.uid)) {
PARAM_LOGW("Invalid dac for '%s' gid %d uid %d", name, auditData.dacData.gid, auditData.dacData.uid);
}
AddSecurityLabel(&auditData);
return 0;
}
......@@ -266,6 +269,9 @@ static int DacCheckParamPermission(const ParamSecurityLabel *srcLabel, const cha
if (ret != DAC_RESULT_PERMISSION) {
PARAM_LOGW("Param '%s' label gid:%d uid:%d mode 0%o", name, srcLabel->cred.gid, srcLabel->cred.uid, localMode);
PARAM_LOGW("Cfg label %d gid:%d uid:%d mode 0%o ", labelIndex, node->gid, node->uid, node->mode);
#ifndef __MUSL__
ret = DAC_RESULT_PERMISSION;
#endif
}
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册