update test case
This commit is contained in:
parent
808630f406
commit
c0a8f81176
|
@ -79,7 +79,7 @@ static bool dmIsForbiddenIp(int8_t forbidden, char *user, uint32_t clientIp) {
|
||||||
char buf[36] = {0};
|
char buf[36] = {0};
|
||||||
|
|
||||||
rpcUtilSIpRangeToStr(&range, buf);
|
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;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1203,29 +1203,30 @@ _OVER:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: for community version use the commented version
|
// TODO: for community version use the commented version
|
||||||
int32_t mndSetUserWhiteListRsp(SMnode* pMnode, SUserObj* pUser, SGetUserWhiteListRsp* pWhiteListRsp) {
|
int32_t mndSetUserWhiteListRsp(SMnode *pMnode, SUserObj *pUser, SGetUserWhiteListRsp *pWhiteListRsp) {
|
||||||
memcpy(pWhiteListRsp->user, pUser->user, TSDB_USER_LEN);
|
memcpy(pWhiteListRsp->user, pUser->user, TSDB_USER_LEN);
|
||||||
// pWhiteListRsp->numWhiteLists = 1;
|
// pWhiteListRsp->numWhiteLists = 1;
|
||||||
// pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range));
|
// pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range));
|
||||||
// if (pWhiteListRsp->pWhiteLists == NULL) {
|
// if (pWhiteListRsp->pWhiteLists == NULL) {
|
||||||
// return TSDB_CODE_OUT_OF_MEMORY;
|
// return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
// }
|
// }
|
||||||
// memset(pUser->pIpWhiteList->pIpRange, 0, pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range));
|
// memset(pUser->pIpWhiteList->pIpRange, 0, pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range));
|
||||||
pWhiteListRsp->numWhiteLists = pUser->pIpWhiteList->num;
|
pWhiteListRsp->numWhiteLists = pUser->pIpWhiteList->num;
|
||||||
pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range));
|
pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range));
|
||||||
if (pWhiteListRsp->pWhiteLists == NULL) {
|
if (pWhiteListRsp->pWhiteLists == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t mndProcessGetUserWhiteListReq(SRpcMsg *pReq) {
|
int32_t mndProcessGetUserWhiteListReq(SRpcMsg *pReq) {
|
||||||
SMnode *pMnode = pReq->info.node;
|
SMnode *pMnode = pReq->info.node;
|
||||||
int32_t code = -1;
|
int32_t code = -1;
|
||||||
SUserObj *pUser = NULL;
|
SUserObj *pUser = NULL;
|
||||||
SGetUserWhiteListReq wlReq = {0};
|
SGetUserWhiteListReq wlReq = {0};
|
||||||
SGetUserWhiteListRsp wlRsp = {0};
|
SGetUserWhiteListRsp wlRsp = {0};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue