feat/TS-5927-long-password-fix-case

This commit is contained in:
dmchen 2025-02-17 16:35:08 +08:00
parent 2baa0f97f8
commit e6e1d3ff1c
3 changed files with 14 additions and 21 deletions

View File

@ -3062,7 +3062,14 @@ static int32_t fillIpRangesFromWhiteList(SAstCreateContext* pCxt, SNodeList* pIp
}
SNode* addCreateUserStmtWhiteList(SAstCreateContext* pCxt, SNode* pCreateUserStmt, SNodeList* pIpRangesNodeList) {
if (NULL == pCreateUserStmt || NULL == pIpRangesNodeList) {
if (NULL == pCreateUserStmt) {
if (pIpRangesNodeList != NULL) {
nodesDestroyList(pIpRangesNodeList);
}
return NULL;
}
if (NULL == pIpRangesNodeList) {
return pCreateUserStmt;
}

View File

@ -35,19 +35,6 @@ class TDTestCase(TBase):
tdSql.execute("alter user test pass '23456789@Abc';")
#move from password.sim
tdSql.execute("CREATE USER `_xTest1` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7' SYSINFO 1 CREATEDB 0 IS_IMPORT 1 HOST '127.0.0.1';")
tdSql.error("CREATE USER `_xTest2` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';", expectErrInfo="Invalid password")
tdSql.error("CREATE USER `_xTest3` PASS '2729c41' SYSINFO 1 CREATEDB 0 IS_IMPORT 1 HOST '127.0.0.1';", expectErrInfo="Password too short or empty")
tdSql.error("CREATE USER `_xTest4` PASS '2729c417' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';", expectErrInfo="Invalid password")
tdSql.error("CREATE USER `_xTest5` PASS '2xF' SYSINFO 1 CREATEDB 0 IS_IMPORT 1 HOST '127.0.0.1';", expectErrInfo="Password too short or empty")
tdSql.error("CREATE USER `_xTest6` PASS '2xF' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';", expectErrInfo="Password too short or empty")
# change setting
tdSql.execute("ALTER ALL DNODES 'enableStrongPassword' '0'")

View File

@ -271,13 +271,12 @@ sql create user u25 pass 'taosdata1~'
sql create user u26 pass 'taosdata1,'
sql create user u27 pass 'taosdata1.'
#move case with host to strongPassword.py becase tsim have a memory leak error when using Host
sql CREATE USER `_xTest1` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7' SYSINFO 1 CREATEDB 0 IS_IMPORT 1;
sql_error CREATE USER `_xTest2` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7' SYSINFO 1 CREATEDB 0 IS_IMPORT 0;
sql_error CREATE USER `_xTest3` PASS '2729c41' SYSINFO 1 CREATEDB 0 IS_IMPORT 1;
sql_error CREATE USER `_xTest4` PASS '2729c417' SYSINFO 1 CREATEDB 0 IS_IMPORT 0;
sql_error CREATE USER `_xTest5` PASS '2xF' SYSINFO 1 CREATEDB 0 IS_IMPORT 1';
sql_error CREATE USER `_xTest6` PASS '2xF' SYSINFO 1 CREATEDB 0 IS_IMPORT 0;
sql CREATE USER `_xTest1` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7' SYSINFO 1 CREATEDB 0 IS_IMPORT 1 HOST '127.0.0.1';
sql_error CREATE USER `_xTest2` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';
sql_error CREATE USER `_xTest3` PASS '2729c41' SYSINFO 1 CREATEDB 0 IS_IMPORT 1 HOST '127.0.0.1';
sql_error CREATE USER `_xTest4` PASS '2729c417' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';
sql_error CREATE USER `_xTest5` PASS '2xF' SYSINFO 1 CREATEDB 0 IS_IMPORT 1' HOST '127.0.0.1';
sql_error CREATE USER `_xTest6` PASS '2xF' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';
sql_error alter USER `_xTest1` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7';