Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
e2401191
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看板
提交
e2401191
编写于
6月 23, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
0623codex
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
ab0b3090
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
18 deletion
+22
-18
interfaces/innerkits/service_control/service_control.c
interfaces/innerkits/service_control/service_control.c
+3
-0
services/begetctl/shell/shell_bas.c
services/begetctl/shell/shell_bas.c
+1
-0
services/init/init_service_manager.c
services/init/init_service_manager.c
+8
-8
services/param/manager/param_manager.c
services/param/manager/param_manager.c
+10
-10
未找到文件。
interfaces/innerkits/service_control/service_control.c
浏览文件 @
e2401191
...
...
@@ -49,15 +49,18 @@ static int StartProcess(const char *name, const char *extArgv[], int extArgc)
}
if
(
strncat_s
(
nameValue
,
len
,
name
,
strlen
(
name
))
!=
0
)
{
BEGET_LOGE
(
"Failed strncat_s name err=%d"
,
errno
);
free
(
nameValue
);
return
-
1
;
}
for
(
int
j
=
0
;
j
<
extArgc
;
j
++
)
{
if
(
strncat_s
(
nameValue
,
len
,
"|"
,
1
)
!=
0
)
{
BEGET_LOGE
(
"Failed strncat_s
\"
|
\"
err=%d"
,
errno
);
free
(
nameValue
);
return
-
1
;
}
if
(
strncat_s
(
nameValue
,
len
,
extArgv
[
j
],
strlen
(
extArgv
[
j
]))
!=
0
)
{
BEGET_LOGE
(
"Failed strncat_s err=%d"
,
errno
);
free
(
nameValue
);
return
-
1
;
}
}
...
...
services/begetctl/shell/shell_bas.c
浏览文件 @
e2401191
...
...
@@ -175,6 +175,7 @@ static void BShellEnvParseParam(BShellEnv *shell)
quotes
=
quotes
?
0
:
1
;
}
if
(
record
==
1
)
{
BSH_CHECK
(
shell
->
argc
<
BSH_PARAMETER_MAX_NUMBER
,
return
,
"argc out of range"
);
shell
->
args
[
shell
->
argc
++
]
=
shell
->
buffer
+
i
;
record
=
0
;
}
...
...
services/init/init_service_manager.c
浏览文件 @
e2401191
...
...
@@ -76,9 +76,9 @@ static void DumpServiceSocket(const Service *service)
ServiceSocket
*
sockopt
=
service
->
socketCfg
;
while
(
sockopt
!=
NULL
)
{
printf
(
"
\t\t
socket name: %s
\n
"
,
sockopt
->
name
);
printf
(
"
\t\t
socket type: %
d
\n
"
,
sockopt
->
type
);
printf
(
"
\t\t
socket uid: %
d
\n
"
,
sockopt
->
uid
);
printf
(
"
\t\t
socket gid: %
d
\n
"
,
sockopt
->
gid
);
printf
(
"
\t\t
socket type: %
u
\n
"
,
sockopt
->
type
);
printf
(
"
\t\t
socket uid: %
u
\n
"
,
sockopt
->
uid
);
printf
(
"
\t\t
socket gid: %
u
\n
"
,
sockopt
->
gid
);
sockopt
=
sockopt
->
next
;
}
}
...
...
@@ -100,11 +100,11 @@ void DumpOneService(const Service *service)
#endif
printf
(
"
\t
service pid: [%d]
\n
"
,
service
->
pid
);
printf
(
"
\t
service crashCnt: [%d]
\n
"
,
service
->
crashCnt
);
printf
(
"
\t
service attribute: [%
d
]
\n
"
,
service
->
attribute
);
printf
(
"
\t
service attribute: [%
u
]
\n
"
,
service
->
attribute
);
printf
(
"
\t
service importance: [%d]
\n
"
,
service
->
importance
);
printf
(
"
\t
service startMode: [%s]
\n
"
,
startModeMap
[
service
->
status
].
name
);
printf
(
"
\t
service status: [%s]
\n
"
,
statusMap
[
service
->
status
].
name
);
printf
(
"
\t
service perms uID [%
d
]
\n
"
,
service
->
servPerm
.
uID
);
printf
(
"
\t
service perms uID [%
u
]
\n
"
,
service
->
servPerm
.
uID
);
DumpServiceArgs
(
"path arg"
,
&
service
->
pathArgs
);
DumpServiceArgs
(
"writepid file"
,
&
service
->
writePidArgs
);
DumpServiceJobs
(
service
);
...
...
@@ -112,11 +112,11 @@ void DumpOneService(const Service *service)
printf
(
"
\t
service perms groupId %d
\n
"
,
service
->
servPerm
.
gIDCnt
);
for
(
int
i
=
0
;
i
<
service
->
servPerm
.
gIDCnt
;
i
++
)
{
printf
(
"
\t\t
service perms groupId %
d
\n
"
,
service
->
servPerm
.
gIDArray
[
i
]);
printf
(
"
\t\t
service perms groupId %
u
\n
"
,
service
->
servPerm
.
gIDArray
[
i
]);
}
printf
(
"
\t
service perms capability %
d
\n
"
,
service
->
servPerm
.
capsCnt
);
printf
(
"
\t
service perms capability %
u
\n
"
,
service
->
servPerm
.
capsCnt
);
for
(
int
i
=
0
;
i
<
(
int
)
service
->
servPerm
.
capsCnt
;
i
++
)
{
printf
(
"
\t\t
service perms capability %
d
\n
"
,
service
->
servPerm
.
caps
[
i
]);
printf
(
"
\t\t
service perms capability %
u
\n
"
,
service
->
servPerm
.
caps
[
i
]);
}
}
...
...
services/param/manager/param_manager.c
浏览文件 @
e2401191
...
...
@@ -122,21 +122,21 @@ static int DumpTrieDataNodeTraversal(const WorkSpace *workSpace, const ParamTrie
return
0
;
}
if
(
verbose
)
{
PARAM_DUMP
(
"
\t
Trie node info [%u,%u,%u] data: %u label: %u key length:%
d
\n\t
key: %s
\n
"
,
PARAM_DUMP
(
"
\t
Trie node info [%u,%u,%u] data: %u label: %u key length:%
u
\n\t
key: %s
\n
"
,
current
->
left
,
current
->
right
,
current
->
child
,
current
->
dataIndex
,
current
->
labelIndex
,
current
->
length
,
current
->
key
);
}
if
(
current
->
dataIndex
!=
0
)
{
ParamNode
*
entry
=
(
ParamNode
*
)
GetTrieNode
(
workSpace
,
current
->
dataIndex
);
if
(
entry
!=
NULL
)
{
PARAM_DUMP
(
"
\t
parameter length info [%
d, %d
]
\n\t
param: %s
\n
"
,
PARAM_DUMP
(
"
\t
parameter length info [%
u, %u
]
\n\t
param: %s
\n
"
,
entry
->
keyLength
,
entry
->
valueLength
,
(
entry
!=
NULL
)
?
entry
->
data
:
"null"
);
}
}
if
(
current
->
labelIndex
!=
0
&&
verbose
)
{
ParamSecurityNode
*
label
=
(
ParamSecurityNode
*
)
GetTrieNode
(
workSpace
,
current
->
labelIndex
);
if
(
label
!=
NULL
)
{
PARAM_DUMP
(
"
\t
parameter label dac %
d %d
%o
\n\t
label: %s
\n
"
,
PARAM_DUMP
(
"
\t
parameter label dac %
u %u
%o
\n\t
label: %s
\n
"
,
label
->
uid
,
label
->
gid
,
label
->
mode
,
(
label
->
length
>
0
)
?
label
->
data
:
"null"
);
}
}
...
...
@@ -147,12 +147,12 @@ static void HashNodeTraverseForDump(WorkSpace *workSpace, int verbose)
{
PARAM_DUMP
(
" map file: %s
\n
"
,
workSpace
->
fileName
);
if
(
workSpace
->
area
!=
NULL
)
{
PARAM_DUMP
(
" total size: %
d
\n
"
,
workSpace
->
area
->
dataSize
);
PARAM_DUMP
(
" first offset: %
d
\n
"
,
workSpace
->
area
->
firstNode
);
PARAM_DUMP
(
" current offset: %
d
\n
"
,
workSpace
->
area
->
currOffset
);
PARAM_DUMP
(
" total node: %
d
\n
"
,
workSpace
->
area
->
trieNodeCount
);
PARAM_DUMP
(
" total param node: %
d
\n
"
,
workSpace
->
area
->
paramNodeCount
);
PARAM_DUMP
(
" total security node: %
d
\n
"
,
workSpace
->
area
->
securityNodeCount
);
PARAM_DUMP
(
" total size: %
u
\n
"
,
workSpace
->
area
->
dataSize
);
PARAM_DUMP
(
" first offset: %
u
\n
"
,
workSpace
->
area
->
firstNode
);
PARAM_DUMP
(
" current offset: %
u
\n
"
,
workSpace
->
area
->
currOffset
);
PARAM_DUMP
(
" total node: %
u
\n
"
,
workSpace
->
area
->
trieNodeCount
);
PARAM_DUMP
(
" total param node: %
u
\n
"
,
workSpace
->
area
->
paramNodeCount
);
PARAM_DUMP
(
" total security node: %
u
\n
"
,
workSpace
->
area
->
securityNodeCount
);
}
PARAM_DUMP
(
" node info:
\n
"
);
PARAMSPACE_AREA_RD_LOCK
(
workSpace
);
...
...
@@ -174,7 +174,7 @@ void SystemDumpParameters(int verbose)
PARAM_DUMP
(
"Dump all parameters begin ...
\n
"
);
if
(
verbose
)
{
PARAM_DUMP
(
"Local sercurity information
\n
"
);
PARAM_DUMP
(
"
\t
pid: %d uid: %
d gid: %d
\n
"
,
PARAM_DUMP
(
"
\t
pid: %d uid: %
u gid: %u
\n
"
,
paramSpace
->
securityLabel
.
cred
.
pid
,
paramSpace
->
securityLabel
.
cred
.
uid
,
paramSpace
->
securityLabel
.
cred
.
gid
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录