Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
04eabb53
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
1 年多 前同步成功
通知
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看板
提交
04eabb53
编写于
5月 11, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: dump错误
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
7785b779
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
2 deletion
+16
-2
services/param/BUILD.gn
services/param/BUILD.gn
+4
-1
services/param/manager/param_manager.c
services/param/manager/param_manager.c
+10
-0
services/param/manager/param_trie.c
services/param/manager/param_trie.c
+2
-1
未找到文件。
services/param/BUILD.gn
浏览文件 @
04eabb53
...
...
@@ -201,7 +201,10 @@ if (defined(ohos_lite)) {
]
include_dirs = param_include_dirs
defines = [ "_GNU_SOURCE" ]
defines = [
"_GNU_SOURCE",
"INIT_AGENT",
]
if (build_selinux) {
sources += [ "adapter/param_selinux.c" ]
defines += [
...
...
services/param/manager/param_manager.c
浏览文件 @
04eabb53
...
...
@@ -213,6 +213,16 @@ int ReadParamWithCheck(const char *name, uint32_t op, ParamHandle *handle)
*
handle
=
-
1
;
int
ret
=
CheckParamPermission
(
&
g_paramWorkSpace
.
securityLabel
,
name
,
op
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Forbid to access parameter %s"
,
name
);
#ifdef PARAM_SUPPORT_SELINUX
if
(
ret
==
DAC_RESULT_PERMISSION
)
{
const
char
*
label
=
GetSelinuxContent
(
name
);
if
(
label
!=
NULL
)
{
AddWorkSpace
(
label
,
1
,
PARAM_WORKSPACE_DEF
);
}
else
{
AddWorkSpace
(
WORKSPACE_NAME_DEF_SELINUX
,
1
,
PARAM_WORKSPACE_DEF
);
}
}
#endif
WorkSpace
*
space
=
GetWorkSpace
(
name
);
PARAM_CHECK
(
space
!=
NULL
,
return
PARAM_CODE_INVALID_PARAM
,
"Invalid workSpace"
);
ParamTrieNode
*
node
=
FindTrieNode
(
space
,
name
,
strlen
(
name
),
NULL
);
...
...
services/param/manager/param_trie.c
浏览文件 @
04eabb53
...
...
@@ -105,6 +105,7 @@ int InitWorkSpace(WorkSpace *workSpace, int onlyRead, uint32_t spaceSize)
}
workSpace
->
compareTrieNode
=
CompareParamTrieNode
;
workSpace
->
allocTrieNode
=
AllocateParamTrieNode
;
workSpace
->
area
=
NULL
;
int
ret
=
InitWorkSpace_
(
workSpace
,
spaceSize
,
onlyRead
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Failed to init workspace %s"
,
workSpace
->
fileName
);
PARAMSPACE_AREA_INIT_LOCK
(
workSpace
);
...
...
@@ -397,7 +398,7 @@ void SaveIndex(uint32_t *index, uint32_t offset)
ParamTrieNode
*
FindTrieNode
(
WorkSpace
*
workSpace
,
const
char
*
key
,
uint32_t
keyLen
,
uint32_t
*
matchLabel
)
{
PARAM_CHECK
(
workSpace
!=
NULL
,
return
NULL
,
"Invalid workSpace"
);
PARAM_CHECK
(
workSpace
!=
NULL
&&
workSpace
->
area
!=
NULL
,
return
NULL
,
"Invalid workSpace"
);
ParamTrieNode
*
node
=
NULL
;
PARAMSPACE_AREA_RD_LOCK
(
workSpace
);
node
=
FindTrieNode_
(
workSpace
,
key
,
keyLen
,
matchLabel
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录