提交 932da9d5 编写于 作者: H hzcheng

Fix shell password issue #92

上级 cd017909
...@@ -57,7 +57,7 @@ TAOS *shellInit(struct arguments *args) { ...@@ -57,7 +57,7 @@ TAOS *shellInit(struct arguments *args) {
} }
if (args->is_use_passwd) { if (args->is_use_passwd) {
args->password = getpass("Enter password: "); if (args->password == NULL) args->password = getpass("Enter password: ");
} else { } else {
args->password = tsDefaultPass; args->password = tsDefaultPass;
} }
......
...@@ -72,10 +72,8 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { ...@@ -72,10 +72,8 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
arguments->host = arg; arguments->host = arg;
break; break;
case 'p': case 'p':
if (arg) arguments->is_use_passwd = true;
arguments->password = arg; if (arg) arguments->password = arg;
else
arguments->is_use_passwd = true;
break; break;
case 'P': case 'P':
tsMgmtShellPort = atoi(arg); tsMgmtShellPort = atoi(arg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册