Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7a999040
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看板
提交
7a999040
编写于
1月 21, 2022
作者:
S
Shengliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix auth error while create table
上级
fa145e68
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
13 deletion
+22
-13
source/dnode/mgmt/impl/src/dndMnode.c
source/dnode/mgmt/impl/src/dndMnode.c
+2
-0
source/dnode/mgmt/impl/src/dndTransport.c
source/dnode/mgmt/impl/src/dndTransport.c
+6
-7
source/dnode/mnode/impl/src/mndAuth.c
source/dnode/mnode/impl/src/mndAuth.c
+10
-2
source/dnode/vnode/src/vnd/vnodeWrite.c
source/dnode/vnode/src/vnd/vnodeWrite.c
+1
-1
source/libs/transport/src/rpcMain.c
source/libs/transport/src/rpcMain.c
+3
-3
未找到文件。
source/dnode/mgmt/impl/src/dndMnode.c
浏览文件 @
7a999040
...
...
@@ -621,5 +621,7 @@ int32_t dndGetUserAuthFromMnode(SDnode *pDnode, char *user, char *spi, char *enc
int32_t
code
=
mndRetriveAuth
(
pMnode
,
user
,
spi
,
encrypt
,
secret
,
ckey
);
dndReleaseMnode
(
pDnode
,
pMnode
);
dTrace
(
"user:%s, retrieve auth spi:%d encrypt:%d"
,
user
,
*
spi
,
*
encrypt
);
return
code
;
}
source/dnode/mgmt/impl/src/dndTransport.c
浏览文件 @
7a999040
...
...
@@ -171,7 +171,7 @@ static int32_t dndInitClient(SDnode *pDnode) {
SRpcInit
rpcInit
;
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
rpcInit
.
label
=
"D
ND
-C"
;
rpcInit
.
label
=
"D-C"
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
cfp
=
dndProcessResponse
;
rpcInit
.
sessions
=
1024
;
...
...
@@ -282,12 +282,12 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
SDnode
*
pDnode
=
parent
;
if
(
dndAuthInternalReq
(
parent
,
user
,
spi
,
encrypt
,
secret
,
ckey
)
==
0
)
{
// dTrace("get internal auth success"
);
dTrace
(
"user:%s, get auth from internal mnode, spi:%d encrypt:%d"
,
user
,
*
spi
,
*
encrypt
);
return
0
;
}
if
(
dndGetUserAuthFromMnode
(
pDnode
,
user
,
spi
,
encrypt
,
secret
,
ckey
)
==
0
)
{
// dTrace("get auth from internal mnode"
);
dTrace
(
"user:%s, get auth from internal mnode, spi:%d encrypt:%d"
,
user
,
*
spi
,
*
encrypt
);
return
0
;
}
...
...
@@ -296,13 +296,12 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
return
-
1
;
}
// dDebug("user:%s, send auth msg to other mnodes", user);
SAuthReq
*
pReq
=
rpcMallocCont
(
sizeof
(
SAuthReq
));
tstrncpy
(
pReq
->
user
,
user
,
TSDB_USER_LEN
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pReq
,
.
contLen
=
sizeof
(
SAuthReq
),
.
msgType
=
TDMT_MND_AUTH
};
SRpcMsg
rpcRsp
=
{
0
};
dTrace
(
"user:%s, send user auth req to other mnodes, spi:%d encrypt:%d"
,
user
,
pReq
->
spi
,
pReq
->
encrypt
);
dndSendMsgToMnodeRecv
(
pDnode
,
&
rpcMsg
,
&
rpcRsp
);
if
(
rpcRsp
.
code
!=
0
)
{
...
...
@@ -314,7 +313,7 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
memcpy
(
ckey
,
pRsp
->
ckey
,
TSDB_PASSWORD_LEN
);
*
spi
=
pRsp
->
spi
;
*
encrypt
=
pRsp
->
encrypt
;
d
Debug
(
"user:%s, success to get user auth from other mnodes"
,
user
);
d
Trace
(
"user:%s, success to get user auth from other mnodes, spi:%d encrypt:%d"
,
user
,
pRsp
->
spi
,
pRsp
->
encrypt
);
}
rpcFreeCont
(
rpcRsp
.
pCont
);
...
...
@@ -333,7 +332,7 @@ static int32_t dndInitServer(SDnode *pDnode) {
SRpcInit
rpcInit
;
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
rpcInit
.
localPort
=
pDnode
->
cfg
.
serverPort
;
rpcInit
.
label
=
"D
ND
-S"
;
rpcInit
.
label
=
"D-S"
;
rpcInit
.
numOfThreads
=
numOfThreads
;
rpcInit
.
cfp
=
dndProcessRequest
;
rpcInit
.
sessions
=
pDnode
->
cfg
.
maxShellConns
;
...
...
source/dnode/mnode/impl/src/mndAuth.c
浏览文件 @
7a999040
...
...
@@ -28,6 +28,14 @@ void mndCleanupAuth(SMnode *pMnode) {}
int32_t
mndRetriveAuth
(
SMnode
*
pMnode
,
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
return
0
;
}
static
int32_t
mndProcessAuthReq
(
SMnodeMsg
*
pReq
)
{
mDebug
(
"user:%s, auth req is processed"
,
pReq
->
user
);
return
0
;
SAuthReq
*
pAuth
=
pReq
->
rpcMsg
.
pCont
;
int32_t
contLen
=
sizeof
(
SAuthRsp
);
SAuthRsp
*
pRsp
=
rpcMallocCont
(
contLen
);
pReq
->
pCont
=
pRsp
;
pReq
->
contLen
=
contLen
;
int32_t
code
=
mndRetriveAuth
(
pReq
->
pMnode
,
pAuth
->
user
,
&
pRsp
->
spi
,
&
pRsp
->
encrypt
,
pRsp
->
secret
,
pRsp
->
ckey
);
mTrace
(
"user:%s, auth req received, spi:%d encrypt:%d ruser:%s"
,
pReq
->
user
,
pAuth
->
spi
,
pAuth
->
encrypt
,
pAuth
->
user
);
return
code
;
}
\ No newline at end of file
source/dnode/vnode/src/vnd/vnodeWrite.c
浏览文件 @
7a999040
...
...
@@ -96,7 +96,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
}
}
v
Info
(
"vgId:%d process create %"
PRIzu
" tables"
,
pVnode
->
vgId
,
taosArrayGetSize
(
vCreateTbBatchReq
.
pArray
));
v
Debug
(
"vgId:%d process create %"
PRIzu
" tables"
,
pVnode
->
vgId
,
taosArrayGetSize
(
vCreateTbBatchReq
.
pArray
));
taosArrayDestroy
(
vCreateTbBatchReq
.
pArray
);
break
;
...
...
source/libs/transport/src/rpcMain.c
浏览文件 @
7a999040
...
...
@@ -752,8 +752,8 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) {
}
taosHashPut
(
pRpc
->
hash
,
hashstr
,
size
,
(
char
*
)
&
pConn
,
POINTER_BYTES
);
tDebug
(
"%s %p server connection is allocated, uid:0x%x sid:%d key:%s"
,
pRpc
->
label
,
pConn
,
pConn
->
linkUid
,
sid
,
hashstr
);
tDebug
(
"%s %p server connection is allocated, uid:0x%x sid:%d key:%s
spi:%d
"
,
pRpc
->
label
,
pConn
,
pConn
->
linkUid
,
sid
,
hashstr
,
pConn
->
spi
);
}
return
pConn
;
...
...
@@ -1612,7 +1612,7 @@ static int rpcCheckAuthentication(SRpcConn *pConn, char *msg, int msgLen) {
}
}
}
else
{
t
Debug
(
"%s, auth spi:%d not matched with received:%d"
,
pConn
->
info
,
pConn
->
spi
,
pHead
->
spi
);
t
Error
(
"%s, auth spi:%d not matched with received:%d %p"
,
pConn
->
info
,
pConn
->
spi
,
pHead
->
spi
,
pConn
);
code
=
pHead
->
spi
?
TSDB_CODE_RPC_AUTH_FAILURE
:
TSDB_CODE_RPC_AUTH_REQUIRED
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录