From e8db435e2ecfd08011604ccca7b992270b9e2908 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 24 Jun 2022 15:24:13 +0800 Subject: [PATCH] enh: adjust password len --- source/dnode/mnode/impl/inc/mndDef.h | 2 +- source/dnode/mnode/impl/src/mndProfile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 0605e3a69e..693cb77b6d 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -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; diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index 832e328d96..08da1d54d9 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -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;