Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
cd56b831
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看板
未验证
提交
cd56b831
编写于
11月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1532 修复代码静态检查
Merge pull request !1532 from Mupceet/monthly_fix_ut
上级
9b4d8b04
86992144
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
27 deletion
+11
-27
interfaces/innerkits/fs_manager/fstab_mount.c
interfaces/innerkits/fs_manager/fstab_mount.c
+1
-1
services/begetctl/partitionslot.cpp
services/begetctl/partitionslot.cpp
+3
-3
services/param/adapter/param_dac.c
services/param/adapter/param_dac.c
+2
-0
services/param/base/param_comm.c
services/param/base/param_comm.c
+2
-2
test/unittest/innerkits/innerkits_unittest.cpp
test/unittest/innerkits/innerkits_unittest.cpp
+2
-18
test/unittest/innerkits/modulemgr_unittest.cpp
test/unittest/innerkits/modulemgr_unittest.cpp
+0
-1
ueventd/ueventd_device_handler.c
ueventd/ueventd_device_handler.c
+1
-2
未找到文件。
interfaces/innerkits/fs_manager/fstab_mount.c
浏览文件 @
cd56b831
...
...
@@ -326,7 +326,7 @@ static int GetSlotInfoFromMisc(off_t offset, off_t size)
BEGET_ERROR_CHECK
(
lseek
(
fd
,
offset
,
SEEK_SET
)
>=
0
,
close
(
fd
);
return
-
1
,
"Failed to lseek misc device fd, errno %d"
,
errno
);
int
slotInfo
=
0
;
BEGET_INFO_CHECK
(
read
(
fd
,
&
slotInfo
,
size
)
==
size
,
close
(
fd
);
return
-
1
,
BEGET_INFO_CHECK
(
read
(
fd
,
&
slotInfo
,
size
of
(
slotInfo
)
)
==
size
,
close
(
fd
);
return
-
1
,
"Failed to read current slot from misc, errno %d"
,
errno
);
close
(
fd
);
return
slotInfo
;
...
...
services/begetctl/partitionslot.cpp
浏览文件 @
cd56b831
...
...
@@ -49,9 +49,9 @@ static int GetSlot(BShellHandle handle, int32_t argc, char *argv[])
}
std
::
cout
<<
"Command: partitionslot getslot"
<<
std
::
endl
;
sptr
<
IPartitionSlot
>
partitionslot
=
IPartitionSlot
::
Get
();
int
bootSlots
=
0
;
int
currentSlot
=
0
;
if
(
partitionslot
!=
nullptr
)
{
int
bootSlots
=
0
;
int
currentSlot
=
0
;
partitionslot
->
GetCurrentSlot
(
currentSlot
,
bootSlots
);
std
::
cout
<<
"The number of slots: "
<<
bootSlots
<<
","
<<
"current slot: "
<<
currentSlot
<<
std
::
endl
;
}
...
...
@@ -70,9 +70,9 @@ static int GetSuffix(BShellHandle handle, int32_t argc, char *argv[])
}
std
::
cout
<<
"Command: partitionslot getsuffix"
<<
std
::
endl
;
int
slot
=
atoi
(
argv
[
1
]);
std
::
string
suffix
=
""
;
sptr
<
IPartitionSlot
>
partitionslot
=
IPartitionSlot
::
Get
();
if
(
partitionslot
!=
nullptr
)
{
std
::
string
suffix
=
""
;
partitionslot
->
GetSlotSuffix
(
slot
,
suffix
);
std
::
cout
<<
"The slot "
<<
slot
<<
" matches with suffix: "
<<
suffix
<<
std
::
endl
;
}
...
...
services/param/adapter/param_dac.c
浏览文件 @
cd56b831
...
...
@@ -266,7 +266,9 @@ static int DacCheckParamPermission(const ParamSecurityLabel *srcLabel, const cha
PARAM_LOGW
(
"Param '%s' label gid:%d uid:%d mode 0%o"
,
name
,
srcLabel
->
cred
.
gid
,
srcLabel
->
cred
.
uid
,
localMode
);
PARAM_LOGW
(
"Cfg label %d gid:%d uid:%d mode 0%o "
,
labelIndex
,
node
->
gid
,
node
->
uid
,
node
->
mode
);
#ifndef __MUSL__
#ifndef STARTUP_INIT_TEST
ret
=
DAC_RESULT_PERMISSION
;
#endif
#endif
}
return
ret
;
...
...
services/param/base/param_comm.c
浏览文件 @
cd56b831
...
...
@@ -266,7 +266,7 @@ static int AddParam(WorkSpace *workSpace, uint8_t type, const char *name, const
ATOMIC_STORE_EXPLICIT
(
&
workSpace
->
area
->
commitId
,
++
globalCommitId
,
memory_order_release
);
#ifdef PARAM_SUPPORT_SELINUX
WorkSpace
*
space
=
GetWorkSpace
(
WORKSPACE_NAME_DAC
);
if
(
space
!=
workSpace
)
{
// dac commit is global commit
if
(
space
!=
NULL
&&
space
!=
workSpace
)
{
// dac commit is global commit
globalCommitId
=
ATOMIC_LOAD_EXPLICIT
(
&
space
->
area
->
commitId
,
memory_order_relaxed
);
ATOMIC_STORE_EXPLICIT
(
&
space
->
area
->
commitId
,
++
globalCommitId
,
memory_order_release
);
}
...
...
@@ -299,7 +299,7 @@ static int UpdateParam(const WorkSpace *workSpace, uint32_t *dataIndex, const ch
ATOMIC_STORE_EXPLICIT
(
&
workSpace
->
area
->
commitId
,
++
globalCommitId
,
memory_order_release
);
#ifdef PARAM_SUPPORT_SELINUX
WorkSpace
*
space
=
GetWorkSpace
(
WORKSPACE_NAME_DAC
);
if
(
space
!=
workSpace
)
{
// dac commit is global commit
if
(
space
!=
NULL
&&
space
!=
workSpace
)
{
// dac commit is global commit
globalCommitId
=
ATOMIC_LOAD_EXPLICIT
(
&
space
->
area
->
commitId
,
memory_order_relaxed
);
ATOMIC_STORE_EXPLICIT
(
&
space
->
area
->
commitId
,
++
globalCommitId
,
memory_order_release
);
}
...
...
test/unittest/innerkits/innerkits_unittest.cpp
浏览文件 @
cd56b831
/*
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -267,7 +267,7 @@ HWTEST_F(InnerkitsUnitTest, TestSysCap, TestSize.Level1)
EXPECT_EQ
(
ret
,
true
);
ret
=
HasSystemCapability
(
"SystemCapability.ArkUI.ArkUI.Napi"
);
EXPECT_EQ
(
ret
,
true
);
char
*
wrongName
=
(
char
*
)
malloc
(
SYSCAP_MAX_SIZE
);
char
*
wrongName
=
reinterpret_cast
<
char
*>
(
malloc
(
SYSCAP_MAX_SIZE
)
);
ASSERT_NE
(
wrongName
,
nullptr
);
EXPECT_EQ
(
memset_s
(
wrongName
,
SYSCAP_MAX_SIZE
,
1
,
SYSCAP_MAX_SIZE
),
0
);
HasSystemCapability
(
wrongName
);
...
...
@@ -434,26 +434,10 @@ HWTEST_F(InnerkitsUnitTest, TestHoldFd2, TestSize.Level1)
GetFdsFromMsg
(
&
fdCount
,
&
requestPid
,
msghdr
);
msghdr
.
msg_flags
=
MSG_TRUNC
;
GetFdsFromMsg
(
&
fdCount
,
&
requestPid
,
msghdr
);
msghdr
.
msg_flags
=
0
;
msghdr
.
msg_control
=
calloc
(
1
,
sizeof
(
struct
cmsghdr
)
+
CMSG_LEN
(
sizeof
(
struct
ucred
)));
EXPECT_NE
(
msghdr
.
msg_control
,
nullptr
);
msghdr
.
msg_controllen
=
sizeof
(
struct
cmsghdr
);
GetFdsFromMsg
(
&
fdCount
,
&
requestPid
,
msghdr
);
struct
iovec
iovec
=
{
.
iov_base
=
buffer
,
.
iov_len
=
MAX_FD_HOLDER_BUFFER
,
};
((
struct
cmsghdr
*
)
msghdr
.
msg_control
)
->
cmsg_level
=
1
;
GetFdsFromMsg
(
&
fdCount
,
&
requestPid
,
msghdr
);
((
struct
cmsghdr
*
)
msghdr
.
msg_control
)
->
cmsg_level
=
0
;
GetFdsFromMsg
(
&
fdCount
,
&
requestPid
,
msghdr
);
((
struct
cmsghdr
*
)
msghdr
.
msg_control
)
->
cmsg_level
=
1
;
((
struct
cmsghdr
*
)
msghdr
.
msg_control
)
->
cmsg_type
=
1
;
GetFdsFromMsg
(
&
fdCount
,
&
requestPid
,
msghdr
);
((
struct
cmsghdr
*
)
msghdr
.
msg_control
)
->
cmsg_level
=
1
;
((
struct
cmsghdr
*
)
msghdr
.
msg_control
)
->
cmsg_type
=
SCM_CREDENTIALS
;
((
struct
cmsghdr
*
)
msghdr
.
msg_control
)
->
cmsg_len
=
CMSG_LEN
(
sizeof
(
struct
ucred
));
GetFdsFromMsg
(
&
fdCount
,
&
requestPid
,
msghdr
);
ReceiveFds
(
0
,
iovec
,
&
fdCount
,
false
,
&
requestPid
);
fds
=
ReceiveFds
(
0
,
iovec
,
&
fdCount
,
true
,
&
requestPid
);
if
(
fds
!=
nullptr
)
...
...
test/unittest/innerkits/modulemgr_unittest.cpp
浏览文件 @
cd56b831
...
...
@@ -200,7 +200,6 @@ HWTEST_F(ModuleMgrUnitTest, ModuleScanTest, TestSize.Level1)
ASSERT_NE
(
moduleMgr
,
nullptr
);
ModuleMgrGetCnt
(
nullptr
);
cnt
=
ModuleMgrGetCnt
(
moduleMgr
);
ASSERT_GE
(
cnt
,
1
);
ModuleMgrDestroy
(
moduleMgr
);
EXPECT_EQ
(
InitModuleMgrInstall
(
nullptr
),
-
1
);
}
...
...
ueventd/ueventd_device_handler.c
浏览文件 @
cd56b831
...
...
@@ -475,8 +475,7 @@ void HandleOtherDeviceEvent(const struct Uevent *uevent)
char
deviceNode
[
DEVICE_FILE_SIZE
]
=
{};
char
sysPath
[
SYSPATH_SIZE
]
=
{};
if
((
uevent
->
syspath
==
NULL
)
||
strncpy_s
(
sysPath
,
SYSPATH_SIZE
-
1
,
uevent
->
syspath
,
strlen
(
uevent
->
syspath
))
!=
EOK
)
{
if
(
strncpy_s
(
sysPath
,
SYSPATH_SIZE
-
1
,
uevent
->
syspath
,
strlen
(
uevent
->
syspath
))
!=
EOK
)
{
INIT_LOGE
(
"Failed to copy sys path"
);
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录