enh: adjust password len

This commit is contained in:
Shengliang Guan 2022-06-24 15:24:13 +08:00
parent 544a2534c5
commit e8db435e2e
2 changed files with 2 additions and 2 deletions

View File

@ -222,7 +222,7 @@ typedef struct {
typedef struct {
char user[TSDB_USER_LEN];
char pass[TSDB_PASSWORD_LEN];
char pass[TSDB_PASSWORD_LEN + 1];
char acct[TSDB_USER_LEN];
int64_t createdTime;
int64_t updateTime;

View File

@ -230,7 +230,7 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
mGError("user:%s, failed to login while acquire user since %s", pReq->info.conn.user, terrstr());
goto CONN_OVER;
}
if (0 != strncmp(connReq.passwd, pUser->pass, TSDB_PASSWORD_LEN - 1)) {
if (0 != strncmp(connReq.passwd, pUser->pass, TSDB_PASSWORD_LEN)) {
mGError("user:%s, failed to auth while acquire user, input:%s", pReq->info.conn.user, connReq.passwd);
code = TSDB_CODE_RPC_AUTH_FAILURE;
goto CONN_OVER;