Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
0507592d
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0507592d
编写于
8月 19, 2022
作者:
R
renwei
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of gitee.com:openharmony/startup_init_lite
Change-Id: I1f2bb81be915b8edcb8ba0db0dae95b0e20297c1
上级
426368f9
4507570f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
6 deletion
+9
-6
interfaces/innerkits/include/syspara/parameter.h
interfaces/innerkits/include/syspara/parameter.h
+0
-1
interfaces/innerkits/syspara/param_wrapper.cpp
interfaces/innerkits/syspara/param_wrapper.cpp
+1
-0
services/param/adapter/param_selinux.c
services/param/adapter/param_selinux.c
+3
-3
services/param/include/param_security.h
services/param/include/param_security.h
+5
-2
未找到文件。
interfaces/innerkits/include/syspara/parameter.h
浏览文件 @
0507592d
...
...
@@ -26,7 +26,6 @@ extern "C" {
#define PARAM_VALUE_LEN_MAX 96
#define PARAM_NAME_LEN_MAX 96
#define OS_FULL_NAME_LEN 128
#define MAX_VALUE_LEN 128
#define VERSION_ID_MAX_LEN 256
static
const
char
EMPTY_STR
[]
=
{
""
};
...
...
interfaces/innerkits/syspara/param_wrapper.cpp
浏览文件 @
0507592d
...
...
@@ -29,6 +29,7 @@
namespace
OHOS
{
namespace
system
{
static
constexpr
int
MAX_VALUE_LEN
=
128
;
bool
SetParameter
(
const
std
::
string
&
key
,
const
std
::
string
&
value
)
{
int
ret
=
SystemSetParameter
(
key
.
c_str
(),
value
.
c_str
());
...
...
services/param/adapter/param_selinux.c
浏览文件 @
0507592d
...
...
@@ -216,8 +216,7 @@ static int SelinuxCheckParamPermission(const ParamSecurityLabel *srcLabel, const
SelinuxSpace
*
selinuxSpace
=
&
GetParamWorkSpace
()
->
selinuxSpace
;
int
ret
=
DAC_RESULT_FORBIDED
;
// check
SrcInfo
info
=
{
0
};
struct
ucred
uc
;
SrcInfo
info
;
info
.
uc
.
pid
=
srcLabel
->
cred
.
pid
;
info
.
uc
.
uid
=
srcLabel
->
cred
.
uid
;
info
.
uc
.
gid
=
srcLabel
->
cred
.
gid
;
...
...
@@ -234,7 +233,8 @@ static int SelinuxCheckParamPermission(const ParamSecurityLabel *srcLabel, const
#endif
}
if
(
ret
!=
0
)
{
PARAM_LOGW
(
"Selinux check name %s pid %d uid %d %d result %d"
,
name
,
info
.
uc
.
pid
,
info
.
uc
.
uid
,
info
.
uc
.
gid
,
ret
);
PARAM_LOGW
(
"Selinux check name %s pid %d uid %d %d result %d"
,
name
,
info
.
uc
.
pid
,
info
.
uc
.
uid
,
info
.
uc
.
gid
,
ret
);
ret
=
DAC_RESULT_FORBIDED
;
}
else
{
ret
=
DAC_RESULT_PERMISSION
;
...
...
services/param/include/param_security.h
浏览文件 @
0507592d
...
...
@@ -25,6 +25,9 @@
#else
typedef
struct
ParamContextsList_
{
}
ParamContextsList
;
typedef
struct
SrcInfo
{
}
SrcInfo
;
#endif
#include "beget_ext.h"
...
...
@@ -97,7 +100,7 @@ typedef struct {
}
ParamSecurityOps
;
typedef
int
(
*
RegisterSecurityOpsPtr
)(
ParamSecurityOps
*
ops
,
int
isInit
);
typedef
int
(
*
SelinuxSetParamCheck
)(
const
char
*
paraName
,
const
char
*
destContext
,
int32_t
sockFd
,
struct
ucred
*
uc
);
typedef
int
(
*
SelinuxSetParamCheck
)(
const
char
*
paraName
,
const
char
*
destContext
,
const
SrcInfo
*
info
);
typedef
struct
SelinuxSpace_
{
void
*
selinuxHandle
;
void
(
*
setSelinuxLogCallback
)(
void
);
...
...
@@ -123,4 +126,4 @@ INIT_LOCAL_API int RegisterSecurityOps(int onlyRead);
}
#endif
#endif
#endif // BASE_STARTUP_PARAM_SECURITY_H
\ No newline at end of file
#endif // BASE_STARTUP_PARAM_SECURITY_H
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录