Merge pull request #16039 from taosdata/fix/userAuth
fix: fix sysdb user authentication failure
This commit is contained in:
commit
6e6b06e0a1
|
@ -238,7 +238,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) {
|
||||||
} else {
|
} else {
|
||||||
memcpy(pReq->info.conn.user, TSDB_DEFAULT_USER, strlen(TSDB_DEFAULT_USER) + 1);
|
memcpy(pReq->info.conn.user, TSDB_DEFAULT_USER, strlen(TSDB_DEFAULT_USER) + 1);
|
||||||
}
|
}
|
||||||
if (mndCheckShowPrivilege(pMnode, pReq->info.conn.user, pShow->type, retrieveReq.db) != 0) {
|
if (retrieveReq.db[0] && mndCheckShowPrivilege(pMnode, pReq->info.conn.user, pShow->type, retrieveReq.db) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -581,6 +581,20 @@ _return:
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ctgChkAuthFromCache(SCatalog* pCtg, char* user, char* dbFName, AUTH_TYPE type, bool *inCache, bool *pass) {
|
int32_t ctgChkAuthFromCache(SCatalog* pCtg, char* user, char* dbFName, AUTH_TYPE type, bool *inCache, bool *pass) {
|
||||||
|
char *p = strchr(dbFName, '.');
|
||||||
|
if (p) {
|
||||||
|
++p;
|
||||||
|
} else {
|
||||||
|
p = dbFName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IS_SYS_DBNAME(p)) {
|
||||||
|
*inCache = true;
|
||||||
|
*pass = true;
|
||||||
|
ctgDebug("sysdb %s, pass", dbFName);
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
SCtgUserAuth *pUser = (SCtgUserAuth *)taosHashGet(pCtg->userCache, user, strlen(user));
|
SCtgUserAuth *pUser = (SCtgUserAuth *)taosHashGet(pCtg->userCache, user, strlen(user));
|
||||||
if (NULL == pUser) {
|
if (NULL == pUser) {
|
||||||
ctgDebug("user not in cache, user:%s", user);
|
ctgDebug("user not in cache, user:%s", user);
|
||||||
|
|
|
@ -45,16 +45,16 @@ sql_error drop database db
|
||||||
sql_error use db
|
sql_error use db
|
||||||
sql_error alter database db replica 1;
|
sql_error alter database db replica 1;
|
||||||
sql_error show db.vgroups
|
sql_error show db.vgroups
|
||||||
sql_error select * from information_schema.ins_stables where db_name = 'db'
|
sql select * from information_schema.ins_stables where db_name = 'db'
|
||||||
sql_error select * from information_schema.ins_tables where db_name = 'db'
|
sql select * from information_schema.ins_tables where db_name = 'db'
|
||||||
|
|
||||||
print =============== check show
|
print =============== check show
|
||||||
sql_error select * from information_schema.ins_users
|
sql select * from information_schema.ins_users
|
||||||
sql_error show cluster
|
sql_error show cluster
|
||||||
sql_error select * from information_schema.ins_dnodes
|
sql select * from information_schema.ins_dnodes
|
||||||
sql_error select * from information_schema.ins_mnodes
|
sql select * from information_schema.ins_mnodes
|
||||||
sql_error show snodes
|
sql_error show snodes
|
||||||
sql_error select * from information_schema.ins_qnodes
|
sql select * from information_schema.ins_qnodes
|
||||||
sql_error show bnodes
|
sql_error show bnodes
|
||||||
sql_error show grants
|
sql_error show grants
|
||||||
sql_error show dnode 1 variables;
|
sql_error show dnode 1 variables;
|
||||||
|
|
Loading…
Reference in New Issue