Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d80a5f70
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d80a5f70
编写于
9月 24, 2021
作者:
sangshuduo
提交者:
GitHub
9月 24, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-6473]<fix>: taosdump verify input arguments. (#8048)
上级
8da7318a
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
87 addition
and
73 deletion
+87
-73
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+87
-73
未找到文件。
src/kit/taosdump/taosdump.c
浏览文件 @
d80a5f70
...
@@ -493,23 +493,38 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -493,23 +493,38 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
errorPrint
(
"Invalid path %s
\n
"
,
arg
);
errorPrint
(
"Invalid path %s
\n
"
,
arg
);
return
-
1
;
return
-
1
;
}
}
if
(
full_path
.
we_wordv
[
0
])
{
tstrncpy
(
g_args
.
outpath
,
full_path
.
we_wordv
[
0
],
tstrncpy
(
g_args
.
outpath
,
full_path
.
we_wordv
[
0
],
MAX_FILE_NAME_LEN
);
MAX_FILE_NAME_LEN
);
wordfree
(
&
full_path
);
wordfree
(
&
full_path
);
}
else
{
errorPrintReqArg3
(
"taosdump"
,
"-o or --outpath"
);
exit
(
EXIT_FAILURE
);
}
break
;
break
;
case
'g'
:
case
'g'
:
g_args
.
debug_print
=
true
;
g_args
.
debug_print
=
true
;
break
;
break
;
case
'i'
:
case
'i'
:
g_args
.
isDumpIn
=
true
;
g_args
.
isDumpIn
=
true
;
if
(
wordexp
(
arg
,
&
full_path
,
0
)
!=
0
)
{
if
(
wordexp
(
arg
,
&
full_path
,
0
)
!=
0
)
{
errorPrint
(
"Invalid path %s
\n
"
,
arg
);
errorPrint
(
"Invalid path %s
\n
"
,
arg
);
return
-
1
;
return
-
1
;
}
}
if
(
full_path
.
we_wordv
[
0
])
{
tstrncpy
(
g_args
.
inpath
,
full_path
.
we_wordv
[
0
],
tstrncpy
(
g_args
.
inpath
,
full_path
.
we_wordv
[
0
],
MAX_FILE_NAME_LEN
);
MAX_FILE_NAME_LEN
);
wordfree
(
&
full_path
);
wordfree
(
&
full_path
);
}
else
{
errorPrintReqArg3
(
"taosdump"
,
"-i or --inpath"
);
exit
(
EXIT_FAILURE
);
}
break
;
break
;
case
'r'
:
case
'r'
:
g_args
.
resultFile
=
arg
;
g_args
.
resultFile
=
arg
;
break
;
break
;
...
@@ -2776,7 +2791,7 @@ int main(int argc, char *argv[]) {
...
@@ -2776,7 +2791,7 @@ int main(int argc, char *argv[]) {
}
}
printf
(
"====== arguments config ======
\n
"
);
printf
(
"====== arguments config ======
\n
"
);
{
printf
(
"host: %s
\n
"
,
g_args
.
host
);
printf
(
"host: %s
\n
"
,
g_args
.
host
);
printf
(
"user: %s
\n
"
,
g_args
.
user
);
printf
(
"user: %s
\n
"
,
g_args
.
user
);
printf
(
"password: %s
\n
"
,
g_args
.
password
);
printf
(
"password: %s
\n
"
,
g_args
.
password
);
...
@@ -2810,7 +2825,7 @@ int main(int argc, char *argv[]) {
...
@@ -2810,7 +2825,7 @@ int main(int argc, char *argv[]) {
for
(
int32_t
i
=
0
;
i
<
g_args
.
arg_list_len
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
g_args
.
arg_list_len
;
i
++
)
{
printf
(
"arg_list[%d]: %s
\n
"
,
i
,
g_args
.
arg_list
[
i
]);
printf
(
"arg_list[%d]: %s
\n
"
,
i
,
g_args
.
arg_list
[
i
]);
}
}
}
printf
(
"==============================
\n
"
);
printf
(
"==============================
\n
"
);
if
(
checkParam
(
&
g_args
)
<
0
)
{
if
(
checkParam
(
&
g_args
)
<
0
)
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
@@ -2824,7 +2839,7 @@ int main(int argc, char *argv[]) {
...
@@ -2824,7 +2839,7 @@ int main(int argc, char *argv[]) {
fprintf
(
g_fpOfResult
,
"#############################################################################
\n
"
);
fprintf
(
g_fpOfResult
,
"#############################################################################
\n
"
);
fprintf
(
g_fpOfResult
,
"============================== arguments config =============================
\n
"
);
fprintf
(
g_fpOfResult
,
"============================== arguments config =============================
\n
"
);
{
fprintf
(
g_fpOfResult
,
"host: %s
\n
"
,
g_args
.
host
);
fprintf
(
g_fpOfResult
,
"host: %s
\n
"
,
g_args
.
host
);
fprintf
(
g_fpOfResult
,
"user: %s
\n
"
,
g_args
.
user
);
fprintf
(
g_fpOfResult
,
"user: %s
\n
"
,
g_args
.
user
);
fprintf
(
g_fpOfResult
,
"password: %s
\n
"
,
g_args
.
password
);
fprintf
(
g_fpOfResult
,
"password: %s
\n
"
,
g_args
.
password
);
...
@@ -2857,7 +2872,6 @@ int main(int argc, char *argv[]) {
...
@@ -2857,7 +2872,6 @@ int main(int argc, char *argv[]) {
for
(
int32_t
i
=
0
;
i
<
g_args
.
arg_list_len
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
g_args
.
arg_list_len
;
i
++
)
{
fprintf
(
g_fpOfResult
,
"arg_list[%d]: %s
\n
"
,
i
,
g_args
.
arg_list
[
i
]);
fprintf
(
g_fpOfResult
,
"arg_list[%d]: %s
\n
"
,
i
,
g_args
.
arg_list
[
i
]);
}
}
}
g_numOfCores
=
(
int32_t
)
sysconf
(
_SC_NPROCESSORS_ONLN
);
g_numOfCores
=
(
int32_t
)
sysconf
(
_SC_NPROCESSORS_ONLN
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录