Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
7fb8488f
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看板
未验证
提交
7fb8488f
编写于
7月 22, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
!951 修复代码静态检查(0719)
Merge pull request !951 from Mupceet/codex
上级
caa8b9a8
f2cc5cc4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
15 deletion
+24
-15
interfaces/innerkits/control_fd/control_fd_client.c
interfaces/innerkits/control_fd/control_fd_client.c
+3
-3
interfaces/innerkits/syspara/param_comm.c
interfaces/innerkits/syspara/param_comm.c
+5
-5
services/init/init_service_manager.c
services/init/init_service_manager.c
+11
-6
services/param/base/param_base.c
services/param/base/param_base.c
+1
-1
services/param/liteos/param_litedac.c
services/param/liteos/param_litedac.c
+3
-0
services/param/manager/param_manager.c
services/param/manager/param_manager.c
+1
-0
未找到文件。
interfaces/innerkits/control_fd/control_fd_client.c
浏览文件 @
7fb8488f
...
...
@@ -31,11 +31,11 @@ static void ProcessPtyWrite(const WatcherHandle taskHandle, int fd, uint32_t *ev
}
CmdAgent
*
agent
=
(
CmdAgent
*
)
context
;
char
rbuf
[
PTY_BUF_SIZE
]
=
{
0
};
in
t
rlen
=
read
(
fd
,
rbuf
,
PTY_BUF_SIZE
-
1
);
ssize_
t
rlen
=
read
(
fd
,
rbuf
,
PTY_BUF_SIZE
-
1
);
int
ret
=
fflush
(
stdin
);
BEGET_ERROR_CHECK
(
ret
==
0
,
return
,
"[control_fd] Failed fflush err=%d"
,
errno
);
if
(
rlen
>
0
)
{
in
t
wlen
=
write
(
agent
->
ptyFd
,
rbuf
,
rlen
);
ssize_
t
wlen
=
write
(
agent
->
ptyFd
,
rbuf
,
rlen
);
BEGET_ERROR_CHECK
(
wlen
==
rlen
,
return
,
"[control_fd] Failed write fifo err=%d"
,
errno
);
}
ret
=
fflush
(
stdout
);
...
...
@@ -51,7 +51,7 @@ static void ProcessPtyRead(const WatcherHandle taskHandle, int fd, uint32_t *eve
}
CmdAgent
*
agent
=
(
CmdAgent
*
)
context
;
char
buf
[
PTY_BUF_SIZE
]
=
{
0
};
int
readlen
=
read
(
fd
,
buf
,
PTY_BUF_SIZE
-
1
);
long
readlen
=
read
(
fd
,
buf
,
PTY_BUF_SIZE
-
1
);
if
(
readlen
>
0
)
{
fprintf
(
stdout
,
"%s"
,
buf
);
}
else
{
...
...
interfaces/innerkits/syspara/param_comm.c
浏览文件 @
7fb8488f
...
...
@@ -154,14 +154,14 @@ INIT_LOCAL_API const char *GetSerial_(void)
#ifdef LITEOS_SUPPORT
return
HalGetSerial
();
#else
static
char
*
ohos
_s
erial
=
NULL
;
if
(
ohos
_s
erial
==
NULL
)
{
BEGET_CHECK
((
ohos
_s
erial
=
(
char
*
)
calloc
(
1
,
PARAM_VALUE_LEN_MAX
))
!=
NULL
,
return
NULL
);
static
char
*
ohos
S
erial
=
NULL
;
if
(
ohos
S
erial
==
NULL
)
{
BEGET_CHECK
((
ohos
S
erial
=
(
char
*
)
calloc
(
1
,
PARAM_VALUE_LEN_MAX
))
!=
NULL
,
return
NULL
);
}
uint32_t
len
=
PARAM_VALUE_LEN_MAX
;
int
ret
=
SystemGetParameter
(
"ohos.boot.sn"
,
ohos
_s
erial
,
&
len
);
int
ret
=
SystemGetParameter
(
"ohos.boot.sn"
,
ohos
S
erial
,
&
len
);
BEGET_CHECK
(
ret
==
0
,
return
NULL
);
return
ohos
_s
erial
;
return
ohos
S
erial
;
#endif
}
...
...
services/init/init_service_manager.c
浏览文件 @
7fb8488f
...
...
@@ -862,6 +862,16 @@ void SetServicePathWithAsan(Service *service)
}
#endif
static
void
ParseOneServiceArgs
(
const
cJSON
*
curItem
,
Service
*
service
)
{
(
void
)
GetServiceArgs
(
curItem
,
"writepid"
,
MAX_WRITEPID_FILES
,
&
service
->
writePidArgs
);
(
void
)
GetServiceArgs
(
curItem
,
D_CAPS_STR_IN_CFG
,
MAX_WRITEPID_FILES
,
&
service
->
capsArgs
);
(
void
)
GetServiceArgs
(
curItem
,
"permission"
,
MAX_WRITEPID_FILES
,
&
service
->
permArgs
);
(
void
)
GetServiceArgs
(
curItem
,
"permission_acls"
,
MAX_WRITEPID_FILES
,
&
service
->
permAclsArgs
);
(
void
)
GetStringItem
(
curItem
,
APL_STR_IN_CFG
,
service
->
apl
,
MAX_APL_NAME
);
(
void
)
GetCpuArgs
(
curItem
,
CPU_CORE_STR_IN_CFG
,
service
);
}
int
ParseOneService
(
const
cJSON
*
curItem
,
Service
*
service
)
{
INIT_CHECK_RETURN_VALUE
(
curItem
!=
NULL
&&
service
!=
NULL
,
SERVICE_FAILURE
);
...
...
@@ -899,12 +909,7 @@ int ParseOneService(const cJSON *curItem, Service *service)
ret
=
GetServiceAttr
(
curItem
,
service
,
CONSOLE_STR_IN_CFG
,
SERVICE_ATTR_CONSOLE
,
NULL
);
INIT_ERROR_CHECK
(
ret
==
0
,
return
SERVICE_FAILURE
,
"Failed to get console for service %s"
,
service
->
name
);
(
void
)
GetServiceArgs
(
curItem
,
"writepid"
,
MAX_WRITEPID_FILES
,
&
service
->
writePidArgs
);
(
void
)
GetServiceArgs
(
curItem
,
D_CAPS_STR_IN_CFG
,
MAX_WRITEPID_FILES
,
&
service
->
capsArgs
);
(
void
)
GetServiceArgs
(
curItem
,
"permission"
,
MAX_WRITEPID_FILES
,
&
service
->
permArgs
);
(
void
)
GetServiceArgs
(
curItem
,
"permission_acls"
,
MAX_WRITEPID_FILES
,
&
service
->
permAclsArgs
);
(
void
)
GetStringItem
(
curItem
,
APL_STR_IN_CFG
,
service
->
apl
,
MAX_APL_NAME
);
(
void
)
GetCpuArgs
(
curItem
,
CPU_CORE_STR_IN_CFG
,
service
);
ParseOneServiceArgs
(
curItem
,
service
);
ret
=
GetServiceSandbox
(
curItem
,
service
);
INIT_ERROR_CHECK
(
ret
==
0
,
return
SERVICE_FAILURE
,
"Failed to get sandbox for service %s"
,
service
->
name
);
ret
=
GetServiceCaps
(
curItem
,
service
);
...
...
services/param/base/param_base.c
浏览文件 @
7fb8488f
...
...
@@ -34,7 +34,7 @@ static int WorkSpaceKeyCompare(const HashNode *node1, const void *key)
return
strcmp
(
workSpace1
->
fileName
,
(
char
*
)
key
);
}
static
int
GenerateKeyHasCode
(
const
char
*
buff
,
uint32
_t
len
)
static
int
GenerateKeyHasCode
(
const
char
*
buff
,
size
_t
len
)
{
int
code
=
0
;
for
(
size_t
i
=
0
;
i
<
len
;
i
++
)
{
...
...
services/param/liteos/param_litedac.c
浏览文件 @
7fb8488f
...
...
@@ -52,6 +52,9 @@ static int CheckFilePermission(const ParamSecurityLabel *localLabel, const char
static
int
DacCheckParamPermission
(
const
ParamSecurityLabel
*
srcLabel
,
const
char
*
name
,
uint32_t
mode
)
{
UNUSED
(
srcLabel
);
UNUSED
(
name
);
UNUSED
(
mode
);
#if defined(__LITEOS_A__)
uid_t
uid
=
getuid
();
return
uid
<=
SYS_UID_INDEX
?
DAC_RESULT_PERMISSION
:
DAC_RESULT_FORBIDED
;
...
...
services/param/manager/param_manager.c
浏览文件 @
7fb8488f
...
...
@@ -212,6 +212,7 @@ INIT_INNER_API int SysCheckParamExist(const char *name)
INIT_INNER_API
int
GetParamSecurityAuditData
(
const
char
*
name
,
int
type
,
ParamAuditData
*
auditData
)
{
UNUSED
(
type
);
ParamWorkSpace
*
paramSpace
=
GetParamWorkSpace
();
PARAM_CHECK
(
paramSpace
!=
NULL
,
return
-
1
,
"Invalid paramSpace"
);
PARAM_WORKSPACE_CHECK
(
paramSpace
,
return
-
1
,
"Invalid space"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录