diff --git a/include/common/tmsg.h b/include/common/tmsg.h index b9365172d555c6a16698c34b5ab976f27b4fcc18..6c85fc9d7f83e2d709978a460c9537922d2512e0 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -632,6 +632,7 @@ typedef struct { int8_t superUser; int8_t sysInfo; int8_t connType; + int8_t enable; SEpSet epSet; int32_t svrTimestamp; int32_t passVer; diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index 736582dff2595485819d36a6b7b44dccd6440145..b234a9967858dd49a2837660b4b5a82322876a2d 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -141,6 +141,7 @@ typedef struct STscObj { char sVer[TSDB_VERSION_LEN]; char sDetailVer[128]; int8_t sysInfo; + int8_t enable; int8_t connType; int32_t acctId; uint32_t connId; diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index 54e3a6ee48ea7cbd94eb358c07255e8352b94470..e9c09bdc6e48a4bf989109f499cc5dd35ac67577 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -104,6 +104,12 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat pTscObj->sysInfo = pRsp->sysInfo; } + if (pTscObj->enable != pRsp->enable) { + tscDebug("update enable of user %s from %" PRIi8 " to %" PRIi8 ", tscRid:%" PRIi64, pRsp->user, pTscObj->enable, + pRsp->enable, pTscObj->id); + pTscObj->enable = pRsp->enable; + } + if (pTscObj->passInfo.fp) { SPassInfo *passInfo = &pTscObj->passInfo; int32_t oldVer = atomic_load_32(&passInfo->ver); diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index a25ee04a1baf6e61f7835e2e474b7c4046618efe..2370381df5a656b0ac426ed2552231f89d0b734b 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -4117,7 +4117,8 @@ int32_t tSerializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) { if (tEncodeCStr(&encoder, pRsp->sVer) < 0) return -1; if (tEncodeCStr(&encoder, pRsp->sDetailVer) < 0) return -1; if (tEncodeI32(&encoder, pRsp->passVer) < 0) return -1; - if (tEncodeI32(&encoder, pRsp->authVer) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->authVer) < 0) return -1; // since 3.0.7.0 + if (tEncodeI8(&encoder, pRsp->enable) < 0) return -1; // since 3.1.0.0 tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -4153,6 +4154,12 @@ int32_t tDeserializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) { } else { pRsp->authVer = 0; } + // since 3.1.0.0 + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI8(&decoder, &pRsp->enable) < 0) return -1; + } else { + pRsp->enable = 0; + } tEndDecode(&decoder); diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index 524ea1a06bdec94d6f77b9fcb8dcb524b9cdc0a9..d2160cb7c7fd4142d79f3342c175286cb60e6bdf 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -282,6 +282,7 @@ _CONNECT: connectRsp.acctId = pUser->acctId; connectRsp.superUser = pUser->superUser; connectRsp.sysInfo = pUser->sysInfo; + connectRsp.enable = pUser->enable; connectRsp.clusterId = pMnode->clusterId; connectRsp.connId = pConn->id; connectRsp.connType = connReq.connType;