Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
aa62f182
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,发现更多精彩内容 >>
未验证
提交
aa62f182
编写于
10月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1386 修复代码静态告警(1017)
Merge pull request !1386 from cheng_jinsong/codex
上级
702e2df0
1756b289
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
15 addition
and
16 deletion
+15
-16
interfaces/innerkits/syspara/param_comm.c
interfaces/innerkits/syspara/param_comm.c
+1
-1
interfaces/kits/jskits/src_v9/native_parameters_js.cpp
interfaces/kits/jskits/src_v9/native_parameters_js.cpp
+6
-6
services/modules/seccomp/scripts/generate_code_from_policy.py
...ices/modules/seccomp/scripts/generate_code_from_policy.py
+0
-1
test/exec_test/server.c
test/exec_test/server.c
+1
-3
test/fuzztest/systemtraversalparameter_fuzzer/systemtraversalparameter_fuzzer.cpp
...ersalparameter_fuzzer/systemtraversalparameter_fuzzer.cpp
+1
-1
test/unittest/init/loopevent_unittest.cpp
test/unittest/init/loopevent_unittest.cpp
+1
-1
test/unittest/init/sandbox_unittest.cpp
test/unittest/init/sandbox_unittest.cpp
+1
-0
test/unittest/param/client_unittest.cpp
test/unittest/param/client_unittest.cpp
+1
-0
test/unittest/param/param_stub.cpp
test/unittest/param/param_stub.cpp
+3
-3
未找到文件。
interfaces/innerkits/syspara/param_comm.c
浏览文件 @
aa62f182
...
...
@@ -183,7 +183,7 @@ INIT_LOCAL_API int GetDevUdid_(char *udid, int size)
return
EC_FAILURE
;
}
uint32_t
len
=
size
;
uint32_t
len
=
(
uint32_t
)
size
;
int
ret
=
SystemGetParameter
(
"const.product.udid"
,
udid
,
&
len
);
BEGET_CHECK
(
ret
!=
0
,
return
ret
);
...
...
interfaces/kits/jskits/src_v9/native_parameters_js.cpp
浏览文件 @
aa62f182
...
...
@@ -107,13 +107,13 @@ static void SetCallbackWork(napi_env env, StorageAsyncContextPtr asyncContext)
napi_create_async_work
(
env
,
nullptr
,
resource
,
[](
napi_env
env
,
void
*
data
)
{
StorageAsyncContext
*
asyncContext
=
(
StorageAsyncContext
*
)
data
;
StorageAsyncContext
*
asyncContext
=
reinterpret_cast
<
StorageAsyncContext
*>
(
data
)
;
asyncContext
->
status
=
SetParameter
(
asyncContext
->
key
,
asyncContext
->
value
);
PARAM_JS_LOGV
(
"JSApp set status: %d, key: '%s', value: '%s'."
,
asyncContext
->
status
,
asyncContext
->
key
,
asyncContext
->
value
);
},
[](
napi_env
env
,
napi_status
status
,
void
*
data
)
{
StorageAsyncContext
*
asyncContext
=
(
StorageAsyncContext
*
)
data
;
StorageAsyncContext
*
asyncContext
=
reinterpret_cast
<
StorageAsyncContext
*>
(
data
)
;
napi_value
result
[
ARGC_NUMBER
]
=
{
0
};
if
(
asyncContext
->
status
==
0
)
{
napi_get_undefined
(
env
,
&
result
[
0
]);
...
...
@@ -139,7 +139,7 @@ static void SetCallbackWork(napi_env env, StorageAsyncContextPtr asyncContext)
napi_delete_async_work
(
env
,
asyncContext
->
work
);
delete
asyncContext
;
},
(
void
*
)
asyncContext
,
&
asyncContext
->
work
);
reinterpret_cast
<
void
*>
(
asyncContext
)
,
&
asyncContext
->
work
);
napi_queue_async_work
(
env
,
asyncContext
->
work
);
}
...
...
@@ -285,7 +285,7 @@ static void GetCallbackWork(napi_env env, StorageAsyncContextPtr asyncContext)
napi_create_async_work
(
env
,
nullptr
,
resource
,
[](
napi_env
env
,
void
*
data
)
{
StorageAsyncContext
*
asyncContext
=
(
StorageAsyncContext
*
)
data
;
StorageAsyncContext
*
asyncContext
=
reinterpret_cast
<
StorageAsyncContext
*>
(
data
)
;
std
::
vector
<
char
>
value
(
MAX_VALUE_LENGTH
,
0
);
asyncContext
->
status
=
GetParameter
(
asyncContext
->
key
,
(
asyncContext
->
valueLen
==
0
)
?
nullptr
:
asyncContext
->
value
,
value
.
data
(),
MAX_VALUE_LENGTH
);
...
...
@@ -294,7 +294,7 @@ static void GetCallbackWork(napi_env env, StorageAsyncContextPtr asyncContext)
asyncContext
->
status
,
asyncContext
->
key
,
asyncContext
->
getValue
.
c_str
(),
asyncContext
->
value
);
},
[](
napi_env
env
,
napi_status
status
,
void
*
data
)
{
StorageAsyncContext
*
asyncContext
=
(
StorageAsyncContext
*
)
data
;
StorageAsyncContext
*
asyncContext
=
reinterpret_cast
<
StorageAsyncContext
*>
(
data
)
;
napi_value
result
[
ARGC_NUMBER
]
=
{
0
};
if
(
asyncContext
->
status
>
0
)
{
napi_get_undefined
(
env
,
&
result
[
0
]);
...
...
@@ -321,7 +321,7 @@ static void GetCallbackWork(napi_env env, StorageAsyncContextPtr asyncContext)
napi_delete_async_work
(
env
,
asyncContext
->
work
);
delete
asyncContext
;
},
(
void
*
)
asyncContext
,
&
asyncContext
->
work
);
reinterpret_cast
<
void
*>
(
asyncContext
)
,
&
asyncContext
->
work
);
napi_queue_async_work
(
env
,
asyncContext
->
work
);
}
...
...
services/modules/seccomp/scripts/generate_code_from_policy.py
浏览文件 @
aa62f182
...
...
@@ -570,7 +570,6 @@ class GenBpfPolicy:
return
bpf_policy
#parse (argn & mask) == value
def
compile_mask_equal_atom
(
self
,
atom
,
cur_size
):
bpf_policy
=
[]
left_brace_pos
=
atom
.
find
(
'('
)
...
...
test/exec_test/server.c
浏览文件 @
aa62f182
...
...
@@ -20,7 +20,6 @@
int
main
(
int
argc
,
char
*
argv
[])
{
int
ret
=
0
;
int
sockFd
=
GetControlSocket
(
"serversock"
);
if
(
sockFd
<
0
)
{
INIT_LOGE
(
"Failed to get server socket"
);
...
...
@@ -28,8 +27,7 @@ int main(int argc, char* argv[])
}
char
buffer
[
MAX_BUFFER_SIZE
]
=
{
0
};
while
(
1
)
{
ret
=
read
(
sockFd
,
buffer
,
sizeof
(
buffer
)
-
1
);
if
(
ret
>
0
)
{
if
(
read
(
sockFd
,
buffer
,
sizeof
(
buffer
)
-
1
)
>
0
)
{
INIT_LOGI
(
"Read message: %s"
,
buffer
);
(
void
)
memset_s
(
buffer
,
MAX_BUFFER_SIZE
,
0
,
MAX_BUFFER_SIZE
);
}
...
...
test/fuzztest/systemtraversalparameter_fuzzer/systemtraversalparameter_fuzzer.cpp
浏览文件 @
aa62f182
...
...
@@ -40,7 +40,7 @@ namespace OHOS {
CloseStdout
();
Cookie
instance
=
{
0
,
nullptr
};
Cookie
*
cookie
=
&
instance
;
if
(
size
<
=
0
)
{
if
(
size
=
=
0
)
{
return
false
;
}
if
(
size
>
PARAM_CONST_VALUE_LEN_MAX
+
PARAM_NAME_LEN_MAX
)
{
...
...
test/unittest/init/loopevent_unittest.cpp
浏览文件 @
aa62f182
...
...
@@ -198,8 +198,8 @@ public:
LE_BaseInfo
info
=
{
TASK_EVENT
,
NULL
};
int
testfd
=
65535
;
// 65535 is not exist fd
BaseTask
*
task
=
CreateTask
(
LE_GetDefaultLoop
(),
testfd
,
&
info
,
sizeof
(
StreamClientTask
));
task
->
handleEvent
=
TestHandleTaskEvent
;
if
(
task
!=
nullptr
)
{
task
->
handleEvent
=
TestHandleTaskEvent
;
ProcessEvent
((
EventLoop
*
)
LE_GetDefaultLoop
(),
testfd
,
Event_Read
);
}
((
HashTab
*
)(((
EventLoop
*
)
LE_GetDefaultLoop
())
->
taskMap
))
->
nodeFree
(
&
task
->
hashNode
);
...
...
test/unittest/init/sandbox_unittest.cpp
浏览文件 @
aa62f182
...
...
@@ -155,6 +155,7 @@ bool MakeFileByJson(cJSON * mJson, const char *sandboxFileName)
int
ret1
=
write
(
fd
,
cjValue1
,
strlen
(
cjValue1
));
if
(
-
1
==
ret1
)
{
std
::
cout
<<
"Write file ERROR"
<<
errno
<<
" fd is :"
<<
fd
<<
std
::
endl
;
close
(
fd
);
return
false
;
}
free
(
cjValue1
);
...
...
test/unittest/param/client_unittest.cpp
浏览文件 @
aa62f182
...
...
@@ -110,6 +110,7 @@ static void TestPermission()
int
ret
;
ParamSecurityOps
*
paramSecurityOps
=
GetParamSecurityOps
(
0
);
EXPECT_NE
(
paramSecurityOps
,
nullptr
);
paramSecurityOps
->
securityCheckParamPermission
=
TestCheckParamPermission
;
SetTestPermissionResult
(
DAC_RESULT_FORBIDED
);
if
((
GetParamSecurityLabel
()
!=
nullptr
))
{
...
...
test/unittest/param/param_stub.cpp
浏览文件 @
aa62f182
...
...
@@ -55,7 +55,7 @@ static int TestGenHashCode(const char *buff)
static
void
TestSetSelinuxLogCallback
(
void
)
{}
static
const
char
*
forbidWriteParamName
[]
=
{
static
const
char
*
g_
forbidWriteParamName
[]
=
{
"ohos.servicectrl."
,
"test.permission.read"
,
"test.persmission.watch"
...
...
@@ -64,8 +64,8 @@ static const char *forbidWriteParamName[] = {
static
int
TestSetParamCheck
(
const
char
*
paraName
,
const
char
*
context
,
const
SrcInfo
*
info
)
{
// forbid to read ohos.servicectrl.
for
(
size_t
i
=
0
;
i
<
ARRAY_LENGTH
(
forbidWriteParamName
);
i
++
)
{
if
(
strncmp
(
paraName
,
forbidWriteParamName
[
i
],
strlen
(
forbidWriteParamName
[
i
]))
==
0
)
{
for
(
size_t
i
=
0
;
i
<
ARRAY_LENGTH
(
g_
forbidWriteParamName
);
i
++
)
{
if
(
strncmp
(
paraName
,
g_forbidWriteParamName
[
i
],
strlen
(
g_
forbidWriteParamName
[
i
]))
==
0
)
{
return
g_testPermissionResult
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录