Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
7785b779
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看板
提交
7785b779
编写于
5月 11, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: load错误
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
2820d5ac
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
3 deletion
+10
-3
services/param/adapter/param_selinux.c
services/param/adapter/param_selinux.c
+1
-1
services/param/manager/param_manager.c
services/param/manager/param_manager.c
+9
-2
未找到文件。
services/param/adapter/param_selinux.c
浏览文件 @
7785b779
...
...
@@ -104,7 +104,7 @@ static int SelinuxGetAllLabel(int readOnly)
node
=
node
->
next
;
count
++
;
}
g_selinuxSpace
.
destroyParamList
(
&
head
);
int
ret
=
AddWorkSpace
(
WORKSPACE_NAME_DEF_SELINUX
,
readOnly
,
PARAM_WORKSPACE_MAX
);
PARAM_CHECK
(
ret
==
0
,
return
-
1
,
"Failed to add selinux workspace %s %s"
,
node
->
info
.
paraName
,
node
->
info
.
paraContext
);
...
...
services/param/manager/param_manager.c
浏览文件 @
7785b779
...
...
@@ -214,6 +214,7 @@ int ReadParamWithCheck(const char *name, uint32_t op, ParamHandle *handle)
int
ret
=
CheckParamPermission
(
&
g_paramWorkSpace
.
securityLabel
,
name
,
op
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Forbid to access parameter %s"
,
name
);
WorkSpace
*
space
=
GetWorkSpace
(
name
);
PARAM_CHECK
(
space
!=
NULL
,
return
PARAM_CODE_INVALID_PARAM
,
"Invalid workSpace"
);
ParamTrieNode
*
node
=
FindTrieNode
(
space
,
name
,
strlen
(
name
),
NULL
);
if
(
node
!=
NULL
&&
node
->
dataIndex
!=
0
)
{
*
handle
=
GetParamHandle
(
space
,
node
->
dataIndex
,
name
);
...
...
@@ -407,6 +408,7 @@ int AddSecurityLabel(const ParamAuditData *auditData)
PARAM_WORKSPACE_CHECK
(
&
g_paramWorkSpace
,
return
-
1
,
"Invalid space"
);
PARAM_CHECK
(
auditData
!=
NULL
&&
auditData
->
name
!=
NULL
,
return
-
1
,
"Invalid auditData"
);
WorkSpace
*
workSpace
=
GetWorkSpace
(
WORKSPACE_NAME_DAC
);
PARAM_CHECK
(
workSpace
!=
NULL
,
return
PARAM_CODE_INVALID_PARAM
,
"Invalid workSpace"
);
int
ret
=
CheckParamName
(
auditData
->
name
,
1
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Illegal param name
\"
%s
\"
"
,
auditData
->
name
);
...
...
@@ -501,6 +503,7 @@ int SystemTraversalParameter(const char *prefix, TraversalParamPtr traversalPara
context
.
prefix
=
(
char
*
)
prefix
;
}
#ifdef PARAM_SUPPORT_SELINUX
// open all workspace
OpenPermissionWorkSpace
();
#endif
WorkSpace
*
workSpace
=
GetFristWorkSpace
();
...
...
@@ -602,7 +605,10 @@ void SystemDumpParameters(int verbose)
if
(
ret
!=
PARAM_CODE_NOT_FOUND
&&
ret
!=
0
&&
ret
!=
PARAM_CODE_NODE_EXIST
)
{
PARAM_CHECK
(
ret
==
0
,
return
,
"Forbid to dump parameters"
);
}
#ifdef PARAM_SUPPORT_SELINUX
// open all workspace
OpenPermissionWorkSpace
();
#endif
PARAM_DUMP
(
"Dump all paramters begin ...
\n
"
);
if
(
verbose
)
{
PARAM_DUMP
(
"Local sercurity information
\n
"
);
...
...
@@ -660,7 +666,7 @@ int AddWorkSpace(const char *name, int onlyRead, uint32_t spaceSize)
free
(
workSpace
);
}
WORKSPACE_RW_UNLOCK
(
g_paramWorkSpace
);
PARAM_LOGI
(
"AddWorkSpace %s
success"
,
name
);
PARAM_LOGI
(
"AddWorkSpace %s
%s"
,
name
,
ret
==
0
?
"success"
:
"fail"
);
return
ret
;
}
...
...
@@ -816,6 +822,7 @@ int GetParamSecurityAuditData(const char *name, int type, ParamAuditData *auditD
uint32_t
labelIndex
=
0
;
// get from dac
WorkSpace
*
space
=
GetWorkSpace
(
WORKSPACE_NAME_DAC
);
PARAM_CHECK
(
space
!=
NULL
,
return
-
1
,
"Invalid workSpace"
);
FindTrieNode
(
space
,
name
,
strlen
(
name
),
&
labelIndex
);
ParamSecruityNode
*
node
=
(
ParamSecruityNode
*
)
GetTrieNode
(
space
,
labelIndex
);
PARAM_CHECK
(
node
!=
NULL
,
return
DAC_RESULT_FORBIDED
,
"Can not get security label %d"
,
labelIndex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录