Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ccf57129
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ccf57129
编写于
5月 29, 2023
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: show create table privilege issue
上级
2db1149d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
6 deletion
+13
-6
source/libs/catalog/src/ctgUtil.c
source/libs/catalog/src/ctgUtil.c
+2
-2
source/libs/parser/src/parAstParser.c
source/libs/parser/src/parAstParser.c
+1
-1
source/libs/parser/src/parAuthenticator.c
source/libs/parser/src/parAuthenticator.c
+1
-1
source/libs/parser/src/parUtil.c
source/libs/parser/src/parUtil.c
+9
-2
未找到文件。
source/libs/catalog/src/ctgUtil.c
浏览文件 @
ccf57129
...
...
@@ -1482,7 +1482,7 @@ int32_t ctgChkSetAuthRes(SCatalog* pCtg, SCtgAuthReq* req, SCtgAuthRsp* res) {
switch
(
pReq
->
type
)
{
case
AUTH_TYPE_READ
:
{
if
(
pInfo
->
readTbs
&&
taosHashGetSize
(
pInfo
->
readTbs
)
>
0
)
{
if
(
p
Req
->
tbName
.
type
==
TSDB_TABLE_NAME_T
&&
p
Info
->
readTbs
&&
taosHashGetSize
(
pInfo
->
readTbs
)
>
0
)
{
req
->
singleType
=
AUTH_TYPE_READ
;
CTG_ERR_RET
(
ctgChkSetTbAuthRes
(
pCtg
,
req
,
res
));
if
(
pRes
->
pass
||
res
->
metaNotExists
)
{
...
...
@@ -1498,7 +1498,7 @@ int32_t ctgChkSetAuthRes(SCatalog* pCtg, SCtgAuthReq* req, SCtgAuthRsp* res) {
break
;
}
case
AUTH_TYPE_WRITE
:
{
if
(
pInfo
->
writeTbs
&&
taosHashGetSize
(
pInfo
->
writeTbs
)
>
0
)
{
if
(
p
Req
->
tbName
.
type
==
TSDB_TABLE_NAME_T
&&
p
Info
->
writeTbs
&&
taosHashGetSize
(
pInfo
->
writeTbs
)
>
0
)
{
req
->
singleType
=
AUTH_TYPE_WRITE
;
CTG_ERR_RET
(
ctgChkSetTbAuthRes
(
pCtg
,
req
,
res
));
if
(
pRes
->
pass
||
res
->
metaNotExists
)
{
...
...
source/libs/parser/src/parAstParser.c
浏览文件 @
ccf57129
...
...
@@ -581,7 +581,7 @@ static int32_t collectMetaKeyFromShowCreateTable(SCollectMetaKeyCxt* pCxt, SShow
code
=
reserveDbCfgInCache
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pCxt
->
pMetaCache
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
reserveUserAuthInCache
(
pCxt
->
pParseCxt
->
acctId
,
pCxt
->
pParseCxt
->
pUser
,
pStmt
->
dbName
,
NULL
,
AUTH_TYPE_READ
,
code
=
reserveUserAuthInCache
(
pCxt
->
pParseCxt
->
acctId
,
pCxt
->
pParseCxt
->
pUser
,
pStmt
->
dbName
,
pStmt
->
tableName
,
AUTH_TYPE_READ
,
pCxt
->
pMetaCache
);
}
return
code
;
...
...
source/libs/parser/src/parAuthenticator.c
浏览文件 @
ccf57129
...
...
@@ -175,7 +175,7 @@ static int32_t authShowTables(SAuthCxt* pCxt, SShowStmt* pStmt) {
static
int32_t
authShowCreateTable
(
SAuthCxt
*
pCxt
,
SShowCreateTableStmt
*
pStmt
)
{
SNode
*
pTagCond
=
NULL
;
// todo check tag condition for subtable
return
checkAuth
(
pCxt
,
pStmt
->
dbName
,
NULL
,
AUTH_TYPE_READ
,
&
pTagCond
);
return
checkAuth
(
pCxt
,
pStmt
->
dbName
,
pStmt
->
tableName
,
AUTH_TYPE_READ
,
&
pTagCond
);
}
static
int32_t
authCreateTable
(
SAuthCxt
*
pCxt
,
SCreateTableStmt
*
pStmt
)
{
...
...
source/libs/parser/src/parUtil.c
浏览文件 @
ccf57129
...
...
@@ -498,7 +498,7 @@ int32_t getVnodeSysTableTargetName(int32_t acctId, SNode* pWhere, SName* pName)
static
int32_t
userAuthToString
(
int32_t
acctId
,
const
char
*
pUser
,
const
char
*
pDb
,
const
char
*
pTable
,
AUTH_TYPE
type
,
char
*
pStr
)
{
return
sprintf
(
pStr
,
"%s*%d*%s*%s*%d"
,
pUser
,
acctId
,
pDb
,
(
NULL
!=
pTable
&&
'\0'
==
pTable
[
0
])
?
NULL
:
pTable
,
return
sprintf
(
pStr
,
"%s*%d*%s*%s*%d"
,
pUser
,
acctId
,
pDb
,
(
NULL
==
pTable
||
'\0'
==
pTable
[
0
])
?
"``"
:
pTable
,
type
);
}
...
...
@@ -524,6 +524,9 @@ static void getStringFromAuthStr(const char* pStart, char* pStr, char** pNext) {
strncpy
(
pStr
,
pStart
,
p
-
pStart
);
*
pNext
=
++
p
;
}
if
(
*
pStart
==
'`'
&&
*
(
pStart
+
1
)
==
'`'
)
{
*
pStr
=
0
;
}
}
static
void
stringToUserAuth
(
const
char
*
pStr
,
int32_t
len
,
SUserAuthInfo
*
pUserAuth
)
{
...
...
@@ -532,7 +535,11 @@ static void stringToUserAuth(const char* pStr, int32_t len, SUserAuthInfo* pUser
pUserAuth
->
tbName
.
acctId
=
getIntegerFromAuthStr
(
p
,
&
p
);
getStringFromAuthStr
(
p
,
pUserAuth
->
tbName
.
dbname
,
&
p
);
getStringFromAuthStr
(
p
,
pUserAuth
->
tbName
.
tname
,
&
p
);
pUserAuth
->
tbName
.
type
=
TSDB_TABLE_NAME_T
;
if
(
pUserAuth
->
tbName
.
tname
[
0
])
{
pUserAuth
->
tbName
.
type
=
TSDB_TABLE_NAME_T
;
}
else
{
pUserAuth
->
tbName
.
type
=
TSDB_DB_NAME_T
;
}
pUserAuth
->
type
=
getIntegerFromAuthStr
(
p
,
&
p
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录