auth failure

This commit is contained in:
Shengliang Guan 2022-02-16 17:42:20 +08:00
parent d2253e0b72
commit 88ee9d94e4
1 changed files with 8 additions and 6 deletions

View File

@ -323,12 +323,14 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
terrno = rpcRsp.code; terrno = rpcRsp.code;
dError("user:%s, failed to get user auth from other mnodes since %s", user, terrstr()); dError("user:%s, failed to get user auth from other mnodes since %s", user, terrstr());
} else { } else {
SAuthRsp *pRsp = rpcRsp.pCont; SAuthRsp authRsp = {0};
memcpy(secret, pRsp->secret, TSDB_PASSWORD_LEN); tDeserializeSAuthReq(rpcRsp.pCont, rpcRsp.contLen, &authRsp);
memcpy(ckey, pRsp->ckey, TSDB_PASSWORD_LEN); memcpy(secret, authRsp.secret, TSDB_PASSWORD_LEN);
*spi = pRsp->spi; memcpy(ckey, authRsp.ckey, TSDB_PASSWORD_LEN);
*encrypt = pRsp->encrypt; *spi = authRsp.spi;
dTrace("user:%s, success to get user auth from other mnodes, spi:%d encrypt:%d", user, pRsp->spi, pRsp->encrypt); *encrypt = authRsp.encrypt;
dTrace("user:%s, success to get user auth from other mnodes, spi:%d encrypt:%d", user, authRsp.spi,
authRsp.encrypt);
} }
rpcFreeCont(rpcRsp.pCont); rpcFreeCont(rpcRsp.pCont);