Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
cbd77262
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cbd77262
编写于
1月 04, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TBASE-1398 #1073
上级
9149d091
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
55 addition
and
15 deletion
+55
-15
src/client/src/tscServer.c
src/client/src/tscServer.c
+12
-1
src/rpc/src/trpc.c
src/rpc/src/trpc.c
+4
-1
src/system/detail/src/mgmtDb.c
src/system/detail/src/mgmtDb.c
+5
-0
src/system/detail/src/mgmtMeter.c
src/system/detail/src/mgmtMeter.c
+15
-0
src/system/detail/src/mgmtShell.c
src/system/detail/src/mgmtShell.c
+19
-13
未找到文件。
src/client/src/tscServer.c
浏览文件 @
cbd77262
...
...
@@ -481,7 +481,18 @@ void *tscProcessMsgFromServer(char *msg, void *ahandle, void *thandle) {
msg
=
NULL
;
}
else
if
(
rspCode
==
TSDB_CODE_NOT_ACTIVE_TABLE
||
rspCode
==
TSDB_CODE_INVALID_TABLE_ID
||
rspCode
==
TSDB_CODE_INVALID_VNODE_ID
||
rspCode
==
TSDB_CODE_NOT_ACTIVE_VNODE
||
rspCode
==
TSDB_CODE_NETWORK_UNAVAIL
)
{
rspCode
==
TSDB_CODE_NETWORK_UNAVAIL
||
rspCode
==
TSDB_CODE_NOT_ACTIVE_SESSION
)
{
/*
* not_active_table: 1. the virtual node may fail to create table, since the procedure of create table is asynchronized,
* the virtual node may have not create table till now, so try again by using the new metermeta.
* 2. this requested table may have been removed by other client, so we need to renew the
* metermeta here.
*
* not_active_vnode: current vnode is move to other node due to node balance procedure or virtual node have been
* removed. So, renew metermeta and try again.
* not_active_session: db has been move to other node, the vnode does not exist on this dnode anymore.
*/
#else
if
(
rspCode
==
TSDB_CODE_NOT_ACTIVE_TABLE
||
rspCode
==
TSDB_CODE_INVALID_TABLE_ID
||
rspCode
==
TSDB_CODE_INVALID_VNODE_ID
||
rspCode
==
TSDB_CODE_NOT_ACTIVE_VNODE
||
...
...
src/rpc/src/trpc.c
浏览文件 @
cbd77262
...
...
@@ -899,7 +899,10 @@ int taosProcessMsgHeader(STaosHeader *pHeader, SRpcConn **ppConn, STaosRpc *pSer
}
if
(
taosAuthenticateMsg
((
uint8_t
*
)
pHeader
,
dataLen
-
TSDB_AUTH_LEN
,
pDigest
->
auth
,
pConn
->
secret
)
<
0
)
{
tTrace
(
"%s cid:%d sid:%d id:%s, authentication failed, msg discarded pConn:%p"
,
pServer
->
label
,
chann
,
sid
,
char
ipstr
[
24
];
tinet_ntoa
(
ipstr
,
ip
);
mLError
(
"user:%s login from %s, authentication failed"
,
pHeader
->
meterId
,
ipstr
);
tError
(
"%s cid:%d sid:%d id:%s, authentication failed, msg discarded pConn:%p"
,
pServer
->
label
,
chann
,
sid
,
pConn
->
meterId
,
pConn
);
code
=
TSDB_CODE_AUTH_FAILURE
;
goto
_exit
;
...
...
src/system/detail/src/mgmtDb.c
浏览文件 @
cbd77262
...
...
@@ -668,6 +668,11 @@ int mgmtRetrieveDbs(SShowObj *pShow, char *data, int rows, SConnObj *pConn) {
pDb
=
(
SDbObj
*
)
pShow
->
pNode
;
if
(
pDb
==
NULL
)
break
;
pShow
->
pNode
=
(
void
*
)
pDb
->
next
;
if
(
mgmtCheckIsMonitorDB
(
pDb
->
name
,
tsMonitorDbName
))
{
if
(
strcmp
(
pConn
->
pUser
->
user
,
"root"
)
!=
0
&&
strcmp
(
pConn
->
pUser
->
user
,
"_root"
)
!=
0
&&
strcmp
(
pConn
->
pUser
->
user
,
"monitor"
)
!=
0
)
{
continue
;
}
}
cols
=
0
;
...
...
src/system/detail/src/mgmtMeter.c
浏览文件 @
cbd77262
...
...
@@ -1259,6 +1259,11 @@ int mgmtRetrieveMeters(SShowObj *pShow, char *data, int rows, SConnObj *pConn) {
if
(
pConn
->
pDb
!=
NULL
)
pDb
=
mgmtGetDb
(
pConn
->
pDb
->
name
);
if
(
pDb
==
NULL
)
return
0
;
if
(
mgmtCheckIsMonitorDB
(
pDb
->
name
,
tsMonitorDbName
))
{
if
(
strcmp
(
pConn
->
pUser
->
user
,
"root"
)
!=
0
&&
strcmp
(
pConn
->
pUser
->
user
,
"_root"
)
!=
0
&&
strcmp
(
pConn
->
pUser
->
user
,
"monitor"
)
!=
0
)
{
return
0
;
}
}
strcpy
(
prefix
,
pDb
->
name
);
strcat
(
prefix
,
TS_PATH_DELIMITER
);
...
...
@@ -1376,6 +1381,16 @@ int mgmtRetrieveMetrics(SShowObj *pShow, char *data, int rows, SConnObj *pConn)
char
*
pWrite
;
int
cols
=
0
;
SDbObj
*
pDb
=
NULL
;
if
(
pConn
->
pDb
!=
NULL
)
pDb
=
mgmtGetDb
(
pConn
->
pDb
->
name
);
if
(
pDb
==
NULL
)
return
0
;
if
(
mgmtCheckIsMonitorDB
(
pDb
->
name
,
tsMonitorDbName
))
{
if
(
strcmp
(
pConn
->
pUser
->
user
,
"root"
)
!=
0
&&
strcmp
(
pConn
->
pUser
->
user
,
"_root"
)
!=
0
&&
strcmp
(
pConn
->
pUser
->
user
,
"monitor"
)
!=
0
)
{
return
0
;
}
}
SPatternCompareInfo
info
=
PATTERN_COMPARE_INFO_INITIALIZER
;
char
metricName
[
TSDB_METER_NAME_LEN
]
=
{
0
};
...
...
src/system/detail/src/mgmtShell.c
浏览文件 @
cbd77262
...
...
@@ -733,8 +733,11 @@ int mgmtProcessAlterUserMsg(char *pMsg, int msgLen, SConnObj *pConn) {
if
((
pAlter
->
flag
&
TSDB_ALTER_USER_PRIVILEGES
)
!=
0
)
{
bool
hasRight
=
false
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
hasRight
=
false
;
}
else
if
(
strcmp
(
pUser
->
user
,
pUser
->
acct
)
==
0
)
{
hasRight
=
false
;
}
else
if
(
strcmp
(
pOperUser
->
user
,
"root"
)
==
0
)
{
hasRight
=
true
;
}
else
if
(
strcmp
(
pUser
->
user
,
pOperUser
->
user
)
==
0
)
{
...
...
@@ -749,21 +752,24 @@ int mgmtProcessAlterUserMsg(char *pMsg, int msgLen, SConnObj *pConn) {
}
}
if
(
pAlter
->
privilege
==
1
)
{
// super
hasRight
=
false
;
}
if
(
hasRight
)
{
if
((
pAlter
->
flag
&
TSDB_ALTER_USER_PRIVILEGES
)
!=
0
)
{
if
(
pAlter
->
privilege
==
1
)
{
// super
pUser
->
superAuth
=
1
;
pUser
->
writeAuth
=
1
;
}
if
(
pAlter
->
privilege
==
2
)
{
// read
pUser
->
superAuth
=
0
;
pUser
->
writeAuth
=
0
;
}
if
(
pAlter
->
privilege
==
3
)
{
// write
pUser
->
superAuth
=
0
;
pUser
->
writeAuth
=
1
;
}
//if (pAlter->privilege == 1) { // super
// pUser->superAuth = 1;
// pUser->writeAuth = 1;
//}
if
(
pAlter
->
privilege
==
2
)
{
// read
pUser
->
superAuth
=
0
;
pUser
->
writeAuth
=
0
;
}
if
(
pAlter
->
privilege
==
3
)
{
// write
pUser
->
superAuth
=
0
;
pUser
->
writeAuth
=
1
;
}
code
=
mgmtUpdateUser
(
pUser
);
mLPrint
(
"user:%s privilege is altered by %s, code:%d"
,
pAlter
->
user
,
pConn
->
pUser
->
user
,
code
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录