未验证 提交 689bdd88 编写于 作者: M Minglei Jin 提交者: GitHub

Merge pull request #13380 from taosdata/fix/TS-1581

test: add test case for TS-1581
......@@ -625,18 +625,11 @@ int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, cha
mError("user:%s, failed to auth user, reason:%s", user, tstrerror(TSDB_CODE_MND_INVALID_USER));
return TSDB_CODE_MND_INVALID_USER;
} else {
if (pUser->superAuth) {
SAcctObj *pAcct = mnodeGetAcct(user);
memcpy(secret, pAcct->pass, TSDB_KEY_LEN);
mnodeDecAcctRef(pAcct);
} else {
memcpy(secret, pUser->pass, TSDB_KEY_LEN);
}
*spi = 1;
*encrypt = 0;
*ckey = 0;
memcpy(secret, pUser->pass, TSDB_KEY_LEN);
mnodeDecUserRef(pUser);
mDebug("user:%s, auth info is returned", user);
return TSDB_CODE_SUCCESS;
......
......@@ -13,6 +13,7 @@
import sys
import taos
import os
from util.log import tdLog
from util.cases import tdCases
from util.sql import tdSql
......@@ -35,6 +36,17 @@ class TDTestCase:
tdSql.error("create user tdenginet PASS '1234512345123456' ")
updatePwd = "test"
os.system('''taos -s "alter user root PASS '%s'"''' % updatePwd)
r = os.popen("taos -u root -p%s -s 'show users'" % updatePwd);
text = r.read()
r.close()
if "Authentication failure" in text:
tdLog.exit("%s failed: Authentication failure" % __file__)
else:
pass
try:
tdSql.execute("create account a&cc PASS 'pass123'")
except Exception as e:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册