From c0a8f811761b47708ecff9a65aa46f183503babf Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 13 Sep 2023 14:27:58 +0800 Subject: [PATCH] update test case --- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 2 +- source/dnode/mnode/impl/src/mndUser.c | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 93bc80b705..4bdf877933 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -79,7 +79,7 @@ static bool dmIsForbiddenIp(int8_t forbidden, char *user, uint32_t clientIp) { char buf[36] = {0}; rpcUtilSIpRangeToStr(&range, buf); - dError("User %s host:%s not in ip white list", user, buf); + dError("User:%s host:%s not in ip white list", user, buf); return true; } else { return false; diff --git a/source/dnode/mnode/impl/src/mndUser.c b/source/dnode/mnode/impl/src/mndUser.c index a14a9c5b7d..a8847e71ad 100644 --- a/source/dnode/mnode/impl/src/mndUser.c +++ b/source/dnode/mnode/impl/src/mndUser.c @@ -1203,29 +1203,30 @@ _OVER: return code; } -//TODO: for community version use the commented version -int32_t mndSetUserWhiteListRsp(SMnode* pMnode, SUserObj* pUser, SGetUserWhiteListRsp* pWhiteListRsp) { +// TODO: for community version use the commented version +int32_t mndSetUserWhiteListRsp(SMnode *pMnode, SUserObj *pUser, SGetUserWhiteListRsp *pWhiteListRsp) { memcpy(pWhiteListRsp->user, pUser->user, TSDB_USER_LEN); -// pWhiteListRsp->numWhiteLists = 1; -// pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); -// if (pWhiteListRsp->pWhiteLists == NULL) { -// return TSDB_CODE_OUT_OF_MEMORY; -// } -// memset(pUser->pIpWhiteList->pIpRange, 0, pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); + // pWhiteListRsp->numWhiteLists = 1; + // pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); + // if (pWhiteListRsp->pWhiteLists == NULL) { + // return TSDB_CODE_OUT_OF_MEMORY; + // } + // memset(pUser->pIpWhiteList->pIpRange, 0, pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); pWhiteListRsp->numWhiteLists = pUser->pIpWhiteList->num; pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); if (pWhiteListRsp->pWhiteLists == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } - memcpy(pUser->pIpWhiteList->pIpRange, pUser->pIpWhiteList->pIpRange, pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); + memcpy(pUser->pIpWhiteList->pIpRange, pUser->pIpWhiteList->pIpRange, + pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); return 0; } int32_t mndProcessGetUserWhiteListReq(SRpcMsg *pReq) { - SMnode *pMnode = pReq->info.node; - int32_t code = -1; - SUserObj *pUser = NULL; + SMnode *pMnode = pReq->info.node; + int32_t code = -1; + SUserObj *pUser = NULL; SGetUserWhiteListReq wlReq = {0}; SGetUserWhiteListRsp wlRsp = {0};