Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
25745b3a
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
25745b3a
编写于
3月 21, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 21, 2023
浏览文件
操作
浏览文件
下载
差异文件
!1829 告警清理
Merge pull request !1829 from 李明康/cherry-pick-1678882415
上级
ce0344dd
6d8edc93
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
58 addition
and
38 deletion
+58
-38
interfaces/innerkits/fs_manager/dm_verity/dm_verity.c
interfaces/innerkits/fs_manager/dm_verity/dm_verity.c
+2
-2
interfaces/innerkits/fs_manager/fstab_mount.c
interfaces/innerkits/fs_manager/fstab_mount.c
+2
-2
interfaces/innerkits/fs_manager/libfs_dm/fs_dm.c
interfaces/innerkits/fs_manager/libfs_dm/fs_dm.c
+2
-1
interfaces/innerkits/fs_manager/libfs_hvb/fs_hvb.c
interfaces/innerkits/fs_manager/libfs_hvb/fs_hvb.c
+3
-3
interfaces/innerkits/fs_manager/libfs_hvb/hvb_ops.c
interfaces/innerkits/fs_manager/libfs_hvb/hvb_ops.c
+48
-29
services/param/watcher/proxy/watcher_manager.cpp
services/param/watcher/proxy/watcher_manager.cpp
+1
-1
未找到文件。
interfaces/innerkits/fs_manager/dm_verity/dm_verity.c
浏览文件 @
25745b3a
...
...
@@ -38,7 +38,7 @@ extern "C" {
} \
} while (0)
static
bool
HvbDmVerityIsEnable
()
static
bool
HvbDmVerityIsEnable
(
void
)
{
int
rc
;
char
forceEnable
[
HVB_FORCE_ENABLE_STR_MAX_LEN
]
=
{
0
};
...
...
@@ -80,7 +80,7 @@ int HvbDmVerityinit(const Fstab *fstab)
if
(
p
==
NULL
)
{
BEGET_LOGI
(
"no need init fs hvb"
);
//
return 0;
return
0
;
}
rc
=
FsHvbInit
();
...
...
interfaces/innerkits/fs_manager/fstab_mount.c
浏览文件 @
25745b3a
...
...
@@ -453,7 +453,7 @@ static int CheckRequiredAndMount(FstabItem *item, bool required)
rc
=
HvbDmVeritySetUp
(
item
);
if
(
rc
!=
0
)
{
BEGET_LOGE
(
"set dm_verity err, ret = 0x%x"
,
rc
);
//
return rc;
return
rc
;
}
#endif
rc
=
MountOneItem
(
item
);
...
...
@@ -480,7 +480,7 @@ int MountAllWithFstab(const Fstab *fstab, bool required)
rc
=
HvbDmVerityinit
(
fstab
);
if
(
rc
!=
0
)
{
BEGET_LOGE
(
"set dm_verity init, ret = 0x%x"
,
rc
);
//
return rc;
return
rc
;
}
}
#endif
...
...
interfaces/innerkits/fs_manager/libfs_dm/fs_dm.c
浏览文件 @
25745b3a
...
...
@@ -97,7 +97,8 @@ static int CreateDmDevice(int fd, const char *devName)
return
0
;
}
static
int
LoadDmDeviceTable
(
int
fd
,
const
char
*
devName
,
DmVerityTarget
*
target
)
static
int
LoadDmDeviceTable
(
int
fd
,
const
char
*
devName
,
DmVerityTarget
*
target
)
{
int
rc
;
errno_t
err
;
...
...
interfaces/innerkits/fs_manager/libfs_hvb/fs_hvb.c
浏览文件 @
25745b3a
...
...
@@ -284,9 +284,9 @@ static int FsHvbVerityTargetAppendOctets(char **p, char *end, char *octs, size_t
}
rc
=
FsHvbVerityTargetAppendString
(
p
,
end
,
str
,
str_len
);
if
(
rc
!=
0
)
if
(
rc
!=
0
)
{
BEGET_LOGE
(
"error 0x%x, append str fail"
,
rc
);
}
free
(
str
);
return
rc
;
...
...
@@ -380,7 +380,7 @@ static int FsHvbConstructVerityTarget(DmVerityTarget *target, char *devName, str
if
(
snprintf_s
(
&
devPath
[
0
],
sizeof
(
devPath
),
sizeof
(
devPath
)
-
1
,
"%s%s"
,
FS_HVB_PARTITION_PREFIX
,
devName
)
==
-
1
)
{
BEGET_LOGE
(
"error, snprintf_s devPath"
);
return
-
1
;
return
-
1
;
}
BEGET_LOGE
(
"puck devPath=%s"
,
&
devPath
[
0
]);
...
...
interfaces/innerkits/fs_manager/libfs_hvb/hvb_ops.c
浏览文件 @
25745b3a
...
...
@@ -13,14 +13,15 @@
* limitations under the License.
*/
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "beget_ext.h"
#include "fs_dm.h"
#include "fs_hvb.h"
#include "securec.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#ifdef __cplusplus
#if __cplusplus
...
...
@@ -28,9 +29,9 @@ extern "C" {
#endif
#endif
#define PARTITION_PATH_PREFIX
"/dev/block/by-name/"
#define PARTITION_PATH_PREFIX "/dev/block/by-name/"
static
int64_t
GetImageSizeForHVB
(
const
int
fd
,
const
char
*
image
)
static
int64_t
GetImageSizeForHVB
(
const
int
fd
,
const
char
*
image
)
{
if
(
fd
<
0
)
{
BEGET_LOGE
(
"param is error"
);
...
...
@@ -40,12 +41,14 @@ static int64_t GetImageSizeForHVB(const int fd, const char *image)
return
lseek64
(
fd
,
0
,
SEEK_END
);
}
static
enum
hvb_io_errno
HvbReadFromPartition
(
struct
hvb_ops
*
ops
,
const
char
*
partition
,
int64_t
offset
,
uint64_t
numBytes
,
void
*
buf
,
uint64_t
*
outNumRead
)
static
enum
hvb_io_errno
HvbReadFromPartition
(
struct
hvb_ops
*
ops
,
const
char
*
partition
,
int64_t
offset
,
uint64_t
numBytes
,
void
*
buf
,
uint64_t
*
outNumRead
)
{
int
rc
;
int
fd
=
-
1
;
char
*
path
=
NULL
;
char
*
path
=
NULL
;
size_t
pathLen
=
0
;
enum
hvb_io_errno
ret
=
HVB_IO_ERROR_IO
;
...
...
@@ -66,20 +69,23 @@ static enum hvb_io_errno HvbReadFromPartition(
return
HVB_IO_ERROR_OOM
;
}
rc
=
snprintf_s
(
path
,
pathLen
+
1
,
pathLen
,
"%s%s"
,
PARTITION_PATH_PREFIX
,
partition
);
rc
=
snprintf_s
(
path
,
pathLen
+
1
,
pathLen
,
"%s%s"
,
PARTITION_PATH_PREFIX
,
partition
);
if
(
rc
<
0
)
{
BEGET_LOGE
(
"error, snprintf_s fail, ret = %d"
,
rc
);
ret
=
HVB_IO_ERROR_IO
;
goto
exit
;
}
fd
=
open
(
path
,
O_RDONLY
|
O_CLOEXEC
);
fd
=
open
(
path
,
O_RDONLY
|
O_CLOEXEC
);
if
(
fd
<
0
)
{
BEGET_LOGE
(
"error, Failed to open %s, errno = %d"
,
path
,
errno
);
fd
=
open
(
"/dev/block/by-name/rvt_system"
,
O_RDONLY
|
O_CLOEXEC
);
BEGET_LOGE
(
"open %s, fd=%d errno = %d"
,
"/dev/block/by-name/rvt_system"
,
fd
,
errno
);
if
(
fd
>=
0
)
BEGET_LOGE
(
"open %s, fd=%d errno = %d"
,
"/dev/block/by-name/rvt_system"
,
fd
,
errno
);
if
(
fd
>=
0
)
{
close
(
fd
);
}
ret
=
HVB_IO_ERROR_IO
;
goto
exit
;
}
...
...
@@ -91,14 +97,15 @@ static enum hvb_io_errno HvbReadFromPartition(
ret
=
HVB_IO_ERROR_IO
;
goto
exit
;
}
offset
=
total_size
+
offset
;
offset
=
total_size
+
offset
;
}
lseek64
(
fd
,
offset
,
SEEK_SET
);
ssize_t
numRead
=
read
(
fd
,
buf
,
numBytes
);
if
(
numRead
<
0
||
(
size_t
)
numRead
!=
numBytes
)
{
BEGET_LOGE
(
"Failed to read %lld bytes from %s offset %lld"
,
numBytes
,
path
,
offset
);
BEGET_LOGE
(
"Failed to read %lld bytes from %s offset %lld"
,
numBytes
,
path
,
offset
);
ret
=
HVB_IO_ERROR_IO
;
goto
exit
;
}
...
...
@@ -111,23 +118,30 @@ static enum hvb_io_errno HvbReadFromPartition(
exit:
if
(
path
!=
NULL
)
if
(
path
!=
NULL
)
{
free
(
path
);
}
if
(
fd
>=
0
)
if
(
fd
>=
0
)
{
close
(
fd
);
}
return
ret
;
}
static
enum
hvb_io_errno
HvbWriteToPartition
(
struct
hvb_ops
*
ops
,
const
char
*
partition
,
int64_t
offset
,
uint64_t
numBytes
,
const
void
*
buf
)
static
enum
hvb_io_errno
HvbWriteToPartition
(
struct
hvb_ops
*
ops
,
const
char
*
partition
,
int64_t
offset
,
uint64_t
numBytes
,
const
void
*
buf
)
{
return
HVB_IO_OK
;
}
static
enum
hvb_io_errno
HvbInvaldateKey
(
struct
hvb_ops
*
ops
,
const
uint8_t
*
publicKeyData
,
uint64_t
publicKeyLength
,
const
uint8_t
*
publicKeyMetadata
,
uint64_t
publicKeyMetadataLength
,
bool
*
outIsTrusted
)
static
enum
hvb_io_errno
HvbInvaldateKey
(
struct
hvb_ops
*
ops
,
const
uint8_t
*
publicKeyData
,
uint64_t
publicKeyLength
,
const
uint8_t
*
publicKeyMetadata
,
uint64_t
publicKeyMetadataLength
,
bool
*
outIsTrusted
)
{
if
(
outIsTrusted
==
NULL
)
{
return
HVB_IO_ERROR_IO
;
...
...
@@ -138,8 +152,9 @@ static enum hvb_io_errno HvbInvaldateKey(struct hvb_ops *ops, const uint8_t *pub
return
HVB_IO_OK
;
}
static
enum
hvb_io_errno
HvbReadRollbackIdx
(
struct
hvb_ops
*
ops
,
uint64_t
rollBackIndexLocation
,
uint64_t
*
outRollbackIndex
)
static
enum
hvb_io_errno
HvbReadRollbackIdx
(
struct
hvb_ops
*
ops
,
uint64_t
rollBackIndexLocation
,
uint64_t
*
outRollbackIndex
)
{
if
(
outRollbackIndex
==
NULL
)
{
return
HVB_IO_ERROR_IO
;
...
...
@@ -151,18 +166,22 @@ static enum hvb_io_errno HvbReadRollbackIdx(
return
HVB_IO_OK
;
}
static
enum
hvb_io_errno
HvbWriteRollbackIdx
(
struct
hvb_ops
*
ops
,
uint64_t
rollBackIndexLocation
,
uint64_t
rollbackIndex
)
static
enum
hvb_io_errno
HvbWriteRollbackIdx
(
struct
hvb_ops
*
ops
,
uint64_t
rollBackIndexLocation
,
uint64_t
rollbackIndex
)
{
return
HVB_IO_OK
;
}
static
enum
hvb_io_errno
HvbReadLockState
(
struct
hvb_ops
*
ops
,
bool
*
lock_state
)
static
enum
hvb_io_errno
HvbReadLockState
(
struct
hvb_ops
*
ops
,
bool
*
lock_state
)
{
return
HVB_IO_OK
;
}
static
enum
hvb_io_errno
HvbGetSizeOfPartition
(
struct
hvb_ops
*
ops
,
const
char
*
partition
,
uint64_t
*
size
)
static
enum
hvb_io_errno
HvbGetSizeOfPartition
(
struct
hvb_ops
*
ops
,
const
char
*
partition
,
uint64_t
*
size
)
{
if
(
size
==
NULL
)
{
return
HVB_IO_ERROR_IO
;
...
...
@@ -186,7 +205,7 @@ static struct hvb_ops g_hvb_ops = {
.
get_partiton_size
=
HvbGetSizeOfPartition
,
};
struct
hvb_ops
*
FsHvbGetOps
(
void
)
struct
hvb_ops
*
FsHvbGetOps
(
void
)
{
return
&
g_hvb_ops
;
}
...
...
services/param/watcher/proxy/watcher_manager.cpp
浏览文件 @
25745b3a
...
...
@@ -37,7 +37,7 @@ WatcherManager::~WatcherManager()
uint32_t
WatcherManager
::
AddRemoteWatcher
(
uint32_t
id
,
const
sptr
<
IWatcher
>
&
watcher
)
{
if
(
id
==
(
uint32_t
)
getpid
(
))
{
if
(
id
==
static_cast
<
uint32_t
>
(
getpid
()
))
{
WATCHER_LOGE
(
"Failed to add remote watcher %u"
,
id
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录