feat: support uniq grant
This commit is contained in:
parent
2309e577c6
commit
fe01fb635d
|
@ -22,9 +22,7 @@ extern "C" {
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "taoserror.h"
|
#include "taoserror.h"
|
||||||
#ifdef GRANTS_CFG
|
#include "tdef.h"
|
||||||
#include "tgrantCfg.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef GRANTS_COL_MAX_LEN
|
#ifndef GRANTS_COL_MAX_LEN
|
||||||
#define GRANTS_COL_MAX_LEN 196
|
#define GRANTS_COL_MAX_LEN 196
|
||||||
|
|
|
@ -419,8 +419,9 @@ int32_t dmProcessGetMachine(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
char *machineId = grantGetMachineId();
|
char *machineId = grantGetMachineId();
|
||||||
if (machineId && (strlen(machineId) == TSDB_MACHINE_ID_LEN)) {
|
if (machineId) {
|
||||||
memcpy(pRsp, machineId, TSDB_MACHINE_ID_LEN);
|
memcpy(pRsp, machineId, TSDB_MACHINE_ID_LEN);
|
||||||
|
taosMemoryFreeClear(machineId);
|
||||||
} else {
|
} else {
|
||||||
terrno = TSDB_CODE_INVALID_DATA_FMT;
|
terrno = TSDB_CODE_INVALID_DATA_FMT;
|
||||||
rpcFreeCont(pRsp);
|
rpcFreeCont(pRsp);
|
||||||
|
|
Loading…
Reference in New Issue