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

!275 fix :bugs

Merge pull request !275 from 熊磊/week127
......@@ -27,6 +27,7 @@ net_bw_acct:x:3007:
readproc:x:3009:
wakelock:x:3010:
uhid:x:3011:
ddms:x:3012:
access_token:x:3020:
misc:x:9998:
app:x:10000:
......@@ -198,6 +198,7 @@
"mkdir /data/service/el0 0711 root root",
"mkdir /data/service/el1 0711 root root",
"mkdir /data/service/el1/public 0711 root root",
"mkdir /data/service/el1/public/AbilityManagerService 0711 system system",
"mkdir /data/service/el2 0711 root root",
"mkdir /data/chipset 0711 root root",
"mkdir /data/chipset/el1 0711 root root",
......
......@@ -27,6 +27,7 @@ net_bw_acct:x:3007:3007:::/bin/false
readproc:x:3009:3009:::/bin/false
wakelock:x:3010:3010:::/bin/false
uhid:x:3011:3011:::/bin/false
ddms:x:3012:3012:::/bin/false
access_token:x:3020:3020:::/bin/false
misc:x:9998:9998:::/bin/false
app:x:10000:10000:::/bin/false
......@@ -52,6 +52,9 @@ ohos_static_library("param_service") {
} else {
sources += [ "adapter/param_dac.c" ]
defines += [ "PARAM_SUPPORT_DAC" ]
if (use_musl) {
defines += [ "PARAM_SUPPORT_DAC_CHECK" ]
}
}
deps = [
......@@ -93,6 +96,9 @@ ohos_shared_library("param_client") {
} else {
sources += [ "adapter/param_dac.c" ]
defines += [ "PARAM_SUPPORT_DAC" ]
if (use_musl) {
defines += [ "PARAM_SUPPORT_DAC_CHECK" ]
}
}
deps = [
......
......@@ -217,6 +217,9 @@ static int CheckUserInGroup(gid_t groupId, uid_t uid)
static int CheckParamPermission(const ParamSecurityLabel *srcLabel, const ParamAuditData *auditData, uint32_t mode)
{
#ifndef PARAM_SUPPORT_DAC_CHECK
return DAC_RESULT_PERMISSION;
#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);
......@@ -243,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)
......
......@@ -13,11 +13,7 @@
import("//build/ohos.gni")
ohos_prebuilt_etc("param_watcher.rc") {
if (use_musl) {
source = "etc/param_watcher.cfg"
} else {
source = "etc/param_watcher.rc"
}
source = "etc/param_watcher.cfg"
relative_install_dir = "init"
part_name = "init"
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册