encrypt grant
This commit is contained in:
parent
a0fffa7eda
commit
e5547eccbf
|
@ -327,6 +327,7 @@ int32_t* taosGetErrno();
|
|||
#define TSDB_CODE_MND_DB_IN_CREATING TAOS_DEF_ERROR_CODE(0, 0x0396) //
|
||||
#define TSDB_CODE_MND_INVALID_SYS_TABLENAME TAOS_DEF_ERROR_CODE(0, 0x039A)
|
||||
#define TSDB_CODE_MND_ENCRYPT_NOT_ALLOW_CHANGE TAOS_DEF_ERROR_CODE(0, 0x039B)
|
||||
#define TSDB_CODE_MND_DB_ENCRYPT_GRANT_EXPIRED TAOS_DEF_ERROR_CODE(0, 0x039C)
|
||||
|
||||
// mnode-node
|
||||
#define TSDB_CODE_MND_MNODE_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x03A0)
|
||||
|
|
|
@ -843,6 +843,13 @@ static int32_t mndCheckDbEncryptKey(SMnode *pMnode, SCreateDbReq *pReq) {
|
|||
}
|
||||
sdbRelease(pSdb, pDnode);
|
||||
}
|
||||
|
||||
if(grantCheck(TSDB_GRANT_DB_ENCRYPTION) != 0){
|
||||
code = TSDB_CODE_MND_DB_ENCRYPT_GRANT_EXPIRED;
|
||||
errno = code;
|
||||
mError("db:%s, failed to create db since %s", pReq->db, terrstr());
|
||||
goto _exit;
|
||||
}
|
||||
#else
|
||||
if (pReq->encryptAlgorithm != TSDB_ENCRYPT_ALGO_NONE) {
|
||||
code = TSDB_CODE_MND_INVALID_DB_OPTION;
|
||||
|
|
|
@ -259,6 +259,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_CREATING, "Database in creating
|
|||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_ENCRYPT_NOT_ALLOW_CHANGE, "Encryption is not allowed to be changed after database is created")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INCONSIST_ENCRYPT_KEY, "Inconsistent encryption key")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_ENCRYPT_KEY, "The cluster has not been set properly for database encryption")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_ENCRYPT_GRANT_EXPIRED, "The database encryption funtion grant expired")
|
||||
|
||||
// mnode-node
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_MNODE_ALREADY_EXIST, "Mnode already exists")
|
||||
|
|
Loading…
Reference in New Issue