Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dcb309ce
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
dcb309ce
编写于
4月 23, 2020
作者:
S
slguan
提交者:
GitHub
4月 23, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1690 from taosdata/feature/alter
fix bug while release users
上级
a4263fd6
83727507
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
40 addition
and
13 deletion
+40
-13
src/mnode/inc/mgmtAcct.h
src/mnode/inc/mgmtAcct.h
+2
-2
src/mnode/src/mgmtAcct.c
src/mnode/src/mgmtAcct.c
+7
-2
src/mnode/src/mgmtDb.c
src/mnode/src/mgmtDb.c
+2
-0
src/mnode/src/mgmtDnode.c
src/mnode/src/mgmtDnode.c
+17
-4
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+4
-1
src/mnode/src/mgmtProfile.c
src/mnode/src/mgmtProfile.c
+3
-0
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+0
-1
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+2
-2
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+3
-1
未找到文件。
src/mnode/inc/mgmtAcct.h
浏览文件 @
dcb309ce
...
...
@@ -24,10 +24,10 @@ extern "C" {
int32_t
mgmtInitAccts
();
void
mgmtCleanUpAccts
();
void
*
mgmtGetAcct
(
char
*
acctName
);
void
*
mgmtGetAcct
(
char
*
acctName
);
void
*
mgmtGetNextAcct
(
void
*
pNode
,
SAcctObj
**
pAcct
);
void
mgmtIncAcctRef
(
SAcctObj
*
pAcct
);
void
mgmtDecAcctRef
(
SAcctObj
*
pAcct
);
void
mgmtAddDbToAcct
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
);
void
mgmtDropDbFromAcct
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
);
void
mgmtAddUserToAcct
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
);
...
...
src/mnode/src/mgmtAcct.c
浏览文件 @
dcb309ce
...
...
@@ -58,6 +58,7 @@ static int32_t mgmtActionAcctUpdate(SSdbOper *pOper) {
memcpy
(
pSaved
,
pAcct
,
tsAcctUpdateSize
);
free
(
pAcct
);
}
mgmtDecAcctRef
(
pSaved
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -106,11 +107,11 @@ int32_t mgmtInitAccts() {
tsAcctSdb
=
sdbOpenTable
(
&
tableDesc
);
if
(
tsAcctSdb
==
NULL
)
{
mError
(
"
failed to init acct data"
);
mError
(
"
table:%s, failed to create hash"
,
tableDesc
.
tableName
);
return
-
1
;
}
mTrace
(
"table:
accounts table is created"
);
mTrace
(
"table:
%s, hash is created"
,
tableDesc
.
tableName
);
return
acctInit
();
}
...
...
@@ -123,6 +124,10 @@ void *mgmtGetAcct(char *name) {
return
sdbGetRow
(
tsAcctSdb
,
name
);
}
void
*
mgmtGetNextAcct
(
void
*
pNode
,
SAcctObj
**
pAcct
)
{
return
sdbFetchRow
(
tsAcctSdb
,
pNode
,
(
void
**
)
pAcct
);
}
void
mgmtIncAcctRef
(
SAcctObj
*
pAcct
)
{
sdbIncRef
(
tsAcctSdb
,
pAcct
);
}
...
...
src/mnode/src/mgmtDb.c
浏览文件 @
dcb309ce
...
...
@@ -63,6 +63,7 @@ static int32_t mgmtDbActionInsert(SSdbOper *pOper) {
if
(
pAcct
!=
NULL
)
{
mgmtAddDbToAcct
(
pAcct
,
pDb
);
mgmtDecAcctRef
(
pAcct
);
}
else
{
mError
(
"db:%s, acct:%s info not exist in sdb"
,
pDb
->
name
,
pDb
->
cfg
.
acct
);
...
...
@@ -80,6 +81,7 @@ static int32_t mgmtDbActionDelete(SSdbOper *pOper) {
mgmtDropAllChildTables
(
pDb
);
mgmtDropAllSuperTables
(
pDb
);
mgmtDropAllVgroups
(
pDb
);
mgmtDecAcctRef
(
pAcct
);
return
TSDB_CODE_SUCCESS
;
}
...
...
src/mnode/src/mgmtDnode.c
浏览文件 @
dcb309ce
...
...
@@ -508,7 +508,10 @@ static int32_t mgmtGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
SUserObj
*
pUser
=
mgmtGetUserFromConn
(
pConn
,
NULL
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
mgmtDecUserRef
(
pUser
);
return
TSDB_CODE_NO_RIGHTS
;
}
int32_t
cols
=
0
;
SSchema
*
pSchema
=
pMeta
->
schema
;
...
...
@@ -635,7 +638,10 @@ static int32_t mgmtGetModuleMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
SUserObj
*
pUser
=
mgmtGetUserFromConn
(
pConn
,
NULL
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
{
mgmtDecUserRef
(
pUser
);
return
TSDB_CODE_NO_RIGHTS
;
}
SSchema
*
pSchema
=
pMeta
->
schema
;
...
...
@@ -744,7 +750,10 @@ static int32_t mgmtGetConfigMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
SUserObj
*
pUser
=
mgmtGetUserFromConn
(
pConn
,
NULL
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
{
mgmtDecUserRef
(
pUser
);
return
TSDB_CODE_NO_RIGHTS
;
}
SSchema
*
pSchema
=
pMeta
->
schema
;
...
...
@@ -827,7 +836,11 @@ static int32_t mgmtGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
int32_t
cols
=
0
;
SUserObj
*
pUser
=
mgmtGetUserFromConn
(
pConn
,
NULL
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
{
mgmtDecUserRef
(
pUser
);
return
TSDB_CODE_NO_RIGHTS
;
}
SSchema
*
pSchema
=
pMeta
->
schema
;
...
...
src/mnode/src/mgmtMnode.c
浏览文件 @
dcb309ce
...
...
@@ -268,7 +268,10 @@ static int32_t mgmtGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
SUserObj
*
pUser
=
mgmtGetUserFromConn
(
pConn
,
NULL
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
mgmtDecUserRef
(
pUser
);
return
TSDB_CODE_NO_RIGHTS
;
}
int32_t
cols
=
0
;
SSchema
*
pSchema
=
pMeta
->
schema
;
...
...
src/mnode/src/mgmtProfile.c
浏览文件 @
dcb309ce
...
...
@@ -704,6 +704,7 @@ void mgmtProcessKillQueryMsg(SQueuedMsg *pMsg) {
rpcRsp
.
code
=
code
;
rpcSendResponse
(
&
rpcRsp
);
mgmtDecUserRef
(
pUser
);
}
void
mgmtProcessKillStreamMsg
(
SQueuedMsg
*
pMsg
)
{
...
...
@@ -727,6 +728,7 @@ void mgmtProcessKillStreamMsg(SQueuedMsg *pMsg) {
rpcRsp
.
code
=
code
;
rpcSendResponse
(
&
rpcRsp
);
mgmtDecUserRef
(
pUser
);
}
void
mgmtProcessKillConnectionMsg
(
SQueuedMsg
*
pMsg
)
{
...
...
@@ -750,6 +752,7 @@ void mgmtProcessKillConnectionMsg(SQueuedMsg *pMsg) {
rpcRsp
.
code
=
code
;
rpcSendResponse
(
&
rpcRsp
);
mgmtDecUserRef
(
pUser
);
}
int32_t
mgmtInitProfile
()
{
...
...
src/mnode/src/mgmtShell.c
浏览文件 @
dcb309ce
...
...
@@ -371,7 +371,6 @@ static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secr
SUserObj
*
pUser
=
mgmtGetUser
(
user
);
if
(
pUser
==
NULL
)
{
*
secret
=
0
;
mgmtDecUserRef
(
pUser
);
return
TSDB_CODE_INVALID_USER
;
}
else
{
memcpy
(
secret
,
pUser
->
pass
,
TSDB_KEY_LEN
);
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
dcb309ce
...
...
@@ -108,7 +108,7 @@ static int32_t mgmtChildTableActionInsert(SSdbOper *pOper) {
SAcctObj
*
pAcct
=
mgmtGetAcct
(
pDb
->
cfg
.
acct
);
if
(
pAcct
==
NULL
)
{
mError
(
"ctable:%s, acc
oun
t:%s not exists"
,
pTable
->
info
.
tableId
,
pDb
->
cfg
.
acct
);
mError
(
"ctable:%s, acct:%s not exists"
,
pTable
->
info
.
tableId
,
pDb
->
cfg
.
acct
);
return
TSDB_CODE_INVALID_ACCT
;
}
mgmtDecAcctRef
(
pAcct
);
...
...
@@ -150,7 +150,7 @@ static int32_t mgmtChildTableActionDelete(SSdbOper *pOper) {
SAcctObj
*
pAcct
=
mgmtGetAcct
(
pDb
->
cfg
.
acct
);
if
(
pAcct
==
NULL
)
{
mError
(
"ctable:%s, acc
oun
t:%s not exists"
,
pTable
->
info
.
tableId
,
pDb
->
cfg
.
acct
);
mError
(
"ctable:%s, acct:%s not exists"
,
pTable
->
info
.
tableId
,
pDb
->
cfg
.
acct
);
return
TSDB_CODE_INVALID_ACCT
;
}
mgmtDecAcctRef
(
pAcct
);
...
...
src/mnode/src/mgmtUser.c
浏览文件 @
dcb309ce
...
...
@@ -63,6 +63,7 @@ static int32_t mgmtUserActionDelete(SSdbOper *pOper) {
if
(
pAcct
!=
NULL
)
{
mgmtDropUserFromAcct
(
pAcct
,
pUser
);
mgmtDecAcctRef
(
pAcct
);
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -72,9 +73,10 @@ static int32_t mgmtUserActionUpdate(SSdbOper *pOper) {
SUserObj
*
pUser
=
pOper
->
pObj
;
SUserObj
*
pSaved
=
mgmtGetUser
(
pUser
->
user
);
if
(
pUser
!=
pSaved
)
{
memcpy
(
pSaved
,
pUser
,
pOper
->
row
Size
);
memcpy
(
pSaved
,
pUser
,
tsUserUpdate
Size
);
free
(
pUser
);
}
mgmtDecUserRef
(
pSaved
);
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录