enh: taosdump extend password length from 128 to 255
This commit is contained in:
parent
6c25d88f14
commit
7c13d742c6
|
@ -214,6 +214,27 @@ class TDTestCase(TBase):
|
||||||
self.checkExcept(taosdump + f" -t 2 -k 2 -z 1 -C https://not-exist.com:80/cloud -D test -o {tmpdir}")
|
self.checkExcept(taosdump + f" -t 2 -k 2 -z 1 -C https://not-exist.com:80/cloud -D test -o {tmpdir}")
|
||||||
self.checkExcept(taosdump + f" -P 65536")
|
self.checkExcept(taosdump + f" -P 65536")
|
||||||
|
|
||||||
|
# password
|
||||||
|
def checkPassword(self, tmpdir):
|
||||||
|
# 255 char max password
|
||||||
|
pwd = ""
|
||||||
|
pwdFile = "cmdline/data/pwdMax.txt"
|
||||||
|
with open(pwdFile) as file:
|
||||||
|
pwd = file.readline()
|
||||||
|
|
||||||
|
sql = f"create user dkj pass '{pwd}' "
|
||||||
|
tdSql.execute(sql)
|
||||||
|
|
||||||
|
cmds = [
|
||||||
|
f"-udkj -p{pwd} -D test -o {tmpdir}", # command pass
|
||||||
|
f"-udkj -p < {pwdFile} -D test -o {tmpdir}" # input pass
|
||||||
|
]
|
||||||
|
|
||||||
|
for cmd in cmds:
|
||||||
|
self.clearPath(tmpdir)
|
||||||
|
rlist = self.taosdump(cmd)
|
||||||
|
self.checkListString(rlist, "OK: Database test dumped")
|
||||||
|
|
||||||
# run
|
# run
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
|
@ -249,6 +270,12 @@ class TDTestCase(TBase):
|
||||||
self.dumpInOutMode("", db , json, tmpdir)
|
self.dumpInOutMode("", db , json, tmpdir)
|
||||||
tdLog.info("4. native varbinary geometry ........................... [Passed]")
|
tdLog.info("4. native varbinary geometry ........................... [Passed]")
|
||||||
|
|
||||||
|
#
|
||||||
|
# long password
|
||||||
|
#
|
||||||
|
self.checkPassword(tmpdir)
|
||||||
|
tdLog.info("5. check long password ................................. [Passed]")
|
||||||
|
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
|
|
|
@ -152,7 +152,7 @@ typedef unsigned __int32 uint32_t;
|
||||||
|
|
||||||
#define MAX_JSON_BUFF 6400000
|
#define MAX_JSON_BUFF 6400000
|
||||||
|
|
||||||
#define INPUT_BUF_LEN 256
|
#define INPUT_BUF_LEN 512
|
||||||
#define EXTRA_SQL_LEN 256
|
#define EXTRA_SQL_LEN 256
|
||||||
#define DATATYPE_BUFF_LEN (TINY_BUFF_LEN * 3)
|
#define DATATYPE_BUFF_LEN (TINY_BUFF_LEN * 3)
|
||||||
#define SML_MAX_BATCH 65536 * 32
|
#define SML_MAX_BATCH 65536 * 32
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <taos.h>
|
#include <taos.h>
|
||||||
#include <taoserror.h>
|
#include <taoserror.h>
|
||||||
#include <toolsdef.h>
|
#include <toolsdef.h>
|
||||||
|
#include <tdef.h>
|
||||||
|
|
||||||
#ifdef WEBSOCKET
|
#ifdef WEBSOCKET
|
||||||
#include <taosws.h>
|
#include <taosws.h>
|
||||||
|
@ -336,7 +337,7 @@ typedef struct arguments {
|
||||||
// connection option
|
// connection option
|
||||||
char *host;
|
char *host;
|
||||||
char *user;
|
char *user;
|
||||||
char password[SHELL_MAX_PASSWORD_LEN];
|
char password[TSDB_USET_PASSWORD_LONGLEN];
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
// strlen(taosdump.) +1 is 10
|
// strlen(taosdump.) +1 is 10
|
||||||
char outpath[DUMP_DIR_LEN];
|
char outpath[DUMP_DIR_LEN];
|
||||||
|
|
|
@ -77,7 +77,7 @@ extern "C" {
|
||||||
#define TSDB_DEFAULT_PASS "taosdata"
|
#define TSDB_DEFAULT_PASS "taosdata"
|
||||||
|
|
||||||
#define TSDB_PASS_LEN 129
|
#define TSDB_PASS_LEN 129
|
||||||
#define SHELL_MAX_PASSWORD_LEN TSDB_PASS_LEN
|
|
||||||
|
|
||||||
#define TSDB_TIME_PRECISION_MILLI 0
|
#define TSDB_TIME_PRECISION_MILLI 0
|
||||||
#define TSDB_TIME_PRECISION_MICRO 1
|
#define TSDB_TIME_PRECISION_MICRO 1
|
||||||
|
|
|
@ -784,8 +784,7 @@ static void parse_args(
|
||||||
}
|
}
|
||||||
setConsoleEcho(true);
|
setConsoleEcho(true);
|
||||||
} else {
|
} else {
|
||||||
tstrncpy(arguments->password, (char *)(argv[i] + 2),
|
strcpy(arguments->password, (char *)(argv[i] + 2));
|
||||||
SHELL_MAX_PASSWORD_LEN);
|
|
||||||
strcpy(argv[i], "-p");
|
strcpy(argv[i], "-p");
|
||||||
}
|
}
|
||||||
} else if (strcmp(argv[i], "-n") == 0) {
|
} else if (strcmp(argv[i], "-n") == 0) {
|
||||||
|
|
Loading…
Reference in New Issue