Fix shell password issue #92

This commit is contained in:
hzcheng 2019-07-17 20:04:44 +08:00
parent cd01790959
commit 932da9d53a
2 changed files with 3 additions and 5 deletions

View File

@ -57,7 +57,7 @@ TAOS *shellInit(struct arguments *args) {
}
if (args->is_use_passwd) {
args->password = getpass("Enter password: ");
if (args->password == NULL) args->password = getpass("Enter password: ");
} else {
args->password = tsDefaultPass;
}

View File

@ -72,10 +72,8 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
arguments->host = arg;
break;
case 'p':
if (arg)
arguments->password = arg;
else
arguments->is_use_passwd = true;
arguments->is_use_passwd = true;
if (arg) arguments->password = arg;
break;
case 'P':
tsMgmtShellPort = atoi(arg);