Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
603117bc
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
8 个月 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
603117bc
编写于
1月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!272 适配musl库的参数检查
Merge pull request !272 from 熊磊/0126
上级
f8bc2afc
1e532210
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
5 deletion
+11
-5
services/param/BUILD.gn
services/param/BUILD.gn
+6
-0
services/param/adapter/param_dac.c
services/param/adapter/param_dac.c
+4
-0
services/param/watcher/BUILD.gn
services/param/watcher/BUILD.gn
+1
-5
未找到文件。
services/param/BUILD.gn
浏览文件 @
603117bc
...
...
@@ -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 = [
...
...
services/param/adapter/param_dac.c
浏览文件 @
603117bc
...
...
@@ -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
)
...
...
services/param/watcher/BUILD.gn
浏览文件 @
603117bc
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录