Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cdee51f6
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看板
提交
cdee51f6
编写于
2月 23, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
message of account
上级
07e6caa3
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
91 addition
and
134 deletion
+91
-134
src/client/src/tscServer.c
src/client/src/tscServer.c
+13
-19
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-0
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+3
-0
src/dnode/src/dnodeSystem.c
src/dnode/src/dnodeSystem.c
+7
-20
src/inc/mnode.h
src/inc/mnode.h
+7
-9
src/inc/taosmsg.h
src/inc/taosmsg.h
+14
-14
src/kit/shell/src/shellMain.c
src/kit/shell/src/shellMain.c
+9
-1
src/mnode/CMakeLists.txt
src/mnode/CMakeLists.txt
+3
-3
src/mnode/inc/mgmtAcct.h
src/mnode/inc/mgmtAcct.h
+1
-2
src/mnode/src/mgmtAcct.c
src/mnode/src/mgmtAcct.c
+10
-19
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+15
-42
src/mnode/src/mgmtSystem.c
src/mnode/src/mgmtSystem.c
+0
-2
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+5
-0
src/util/CMakeLists.txt
src/util/CMakeLists.txt
+3
-3
未找到文件。
src/client/src/tscServer.c
浏览文件 @
cdee51f6
...
...
@@ -196,7 +196,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
}
void
tscProcessMsgFromServer
(
char
type
,
void
*
pCont
,
int
contLen
,
void
*
ahandle
,
int32_t
code
)
{
tscPrint
(
"response
is received, pCont:%p, code:%d"
,
pCont
,
code
);
tscPrint
(
"response
:%d is received, pCont:%p, contLen:%d code:%d"
,
type
,
pCont
,
contLen
,
code
);
SSqlObj
*
pSql
=
(
SSqlObj
*
)
ahandle
;
if
(
pSql
==
NULL
||
pSql
->
signature
!=
pSql
)
{
tscError
(
"%p sql is already released, signature:%p"
,
pSql
,
pSql
->
signature
);
...
...
@@ -1692,15 +1692,14 @@ int32_t tscBuildCreateDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
}
int32_t
tscBuildAcctMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
SCreateAcctMsg
*
pAlterMsg
;
char
*
pMsg
,
*
pStart
;
int
msgLen
=
0
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
pCmd
->
payloadLen
=
sizeof
(
SCMCreateAcctMsg
);
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
pCmd
,
pCmd
->
payloadLen
))
{
tscError
(
"%p failed to malloc for query msg"
,
pSql
);
return
TSDB_CODE_CLI_OUT_OF_MEMORY
;
}
pMsg
=
doBuildMsgHeader
(
pSql
,
&
pStart
);
pAlterMsg
=
(
SCreateAcctMsg
*
)
pMsg
;
SCMCreateAcctMsg
*
pAlterMsg
=
(
SCMCreateAcctMsg
*
)
pCmd
->
payload
;
SSQLToken
*
pName
=
&
pInfo
->
pDCLInfo
->
user
.
user
;
SSQLToken
*
pPwd
=
&
pInfo
->
pDCLInfo
->
user
.
passwd
;
...
...
@@ -1708,8 +1707,6 @@ int32_t tscBuildAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
strncpy
(
pAlterMsg
->
user
,
pName
->
z
,
pName
->
n
);
strncpy
(
pAlterMsg
->
pass
,
pPwd
->
z
,
pPwd
->
n
);
pMsg
+=
sizeof
(
SCreateAcctMsg
);
SCreateAcctSQL
*
pAcctOpt
=
&
pInfo
->
pDCLInfo
->
acctOpt
;
pAlterMsg
->
cfg
.
maxUsers
=
htonl
(
pAcctOpt
->
maxUsers
);
...
...
@@ -1735,21 +1732,18 @@ int32_t tscBuildAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
}
}
msgLen
=
pMsg
-
pStart
;
pCmd
->
payloadLen
=
msgLen
;
pCmd
->
msgType
=
TSDB_MSG_TYPE_CREATE_ACCT
;
return
TSDB_CODE_SUCCESS
;
}
int32_t
tscBuildUserMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
SCreateUserMsg
*
pAlterMsg
;
SC
MC
reateUserMsg
*
pAlterMsg
;
char
*
pMsg
,
*
pStart
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
pMsg
=
doBuildMsgHeader
(
pSql
,
&
pStart
);
pAlterMsg
=
(
SCreateUserMsg
*
)
pMsg
;
pAlterMsg
=
(
SC
MC
reateUserMsg
*
)
pMsg
;
SUserInfo
*
pUser
=
&
pInfo
->
pDCLInfo
->
user
;
strncpy
(
pAlterMsg
->
user
,
pUser
->
user
.
z
,
pUser
->
user
.
n
);
...
...
@@ -1764,7 +1758,7 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
strncpy
(
pAlterMsg
->
pass
,
pUser
->
passwd
.
z
,
pUser
->
passwd
.
n
);
}
pMsg
+=
sizeof
(
SCreateUserMsg
);
pMsg
+=
sizeof
(
SC
MC
reateUserMsg
);
pCmd
->
payloadLen
=
pMsg
-
pStart
;
if
(
pUser
->
type
==
TSDB_ALTER_USER_PASSWD
||
pUser
->
type
==
TSDB_ALTER_USER_PRIVILEGES
)
{
...
...
@@ -1877,18 +1871,18 @@ int32_t tscBuildDropDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
}
int32_t
tscBuildDropAcctMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
SDropUserMsg
*
pDropMsg
;
S
CM
DropUserMsg
*
pDropMsg
;
char
*
pMsg
,
*
pStart
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
pMsg
=
doBuildMsgHeader
(
pSql
,
&
pStart
);
pDropMsg
=
(
SDropUserMsg
*
)
pMsg
;
pDropMsg
=
(
S
CM
DropUserMsg
*
)
pMsg
;
SMeterMetaInfo
*
pMeterMetaInfo
=
tscGetMeterMetaInfo
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
strcpy
(
pDropMsg
->
user
,
pMeterMetaInfo
->
name
);
pMsg
+=
sizeof
(
SDropUserMsg
);
pMsg
+=
sizeof
(
S
CM
DropUserMsg
);
pCmd
->
payloadLen
=
pMsg
-
pStart
;
pCmd
->
msgType
=
TSDB_MSG_TYPE_DROP_USER
;
...
...
src/client/src/tscSql.c
浏览文件 @
cdee51f6
...
...
@@ -34,6 +34,7 @@ TAOS *taos_connect_imp(const char *ip, const char *user, const char *pass, const
void
(
*
fp
)(
void
*
,
TAOS_RES
*
,
int
),
void
*
param
,
void
**
taos
)
{
STscObj
*
pObj
;
taos_init
();
if
(
user
==
NULL
)
{
...
...
src/client/src/tscUtil.c
浏览文件 @
cdee51f6
...
...
@@ -430,6 +430,9 @@ void tscFreeResData(SSqlObj* pSql) {
}
void
tscFreeSqlResult
(
SSqlObj
*
pSql
)
{
//TODO not free
return
;
tfree
(
pSql
->
res
.
pRsp
);
pSql
->
res
.
row
=
0
;
pSql
->
res
.
numOfRows
=
0
;
...
...
src/dnode/src/dnodeSystem.c
浏览文件 @
cdee51f6
...
...
@@ -33,16 +33,12 @@
#include "dnodeVnodeMgmt.h"
#ifdef CLUSTER
#include "dnodeCluster.h"
#include "httpAdmin.h"
#include "mnodeAccount.h"
#include "mnodeBalance.h"
#include "mnodeCluster.h"
#include "sdbReplica.h"
#include "multilevelStorage.h"
#include "vnodeCluster.h"
#include "vnodeReplica.h"
#include "dnodeGrant.h"
#include "acct.h"
#include "admin.h"
#include "cluster.h"
#include "grant.h"
#include "replica.h"
#include "storage.h"
#endif
static
pthread_mutex_t
tsDnodeMutex
;
...
...
@@ -120,16 +116,7 @@ void dnodeCheckDataDirOpenned(const char *dir) {
void
dnodeInitPlugins
()
{
#ifdef CLUSTER
dnodeClusterInit
();
httpAdminInit
();
mnodeAccountInit
();
mnodeBalanceInit
();
mnodeClusterInit
();
sdbReplicaInit
();
multilevelStorageInit
();
vnodeClusterInit
();
vnodeReplicaInit
();
dnodeGrantInit
();
acctInit
();
#endif
}
...
...
src/inc/mnode.h
浏览文件 @
cdee51f6
...
...
@@ -247,7 +247,7 @@ typedef struct _db_obj {
struct
_acctObj
;
typedef
struct
_user_obj
{
char
user
[
TSDB_USER_LEN
+
1
];
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_KEY_LEN
];
char
acct
[
TSDB_USER_LEN
];
int64_t
createdTime
;
...
...
@@ -275,23 +275,21 @@ typedef struct {
int64_t
totalPoints
;
int64_t
inblound
;
int64_t
outbound
;
TSKEY
sKey
;
char
accessState
;
// Checked by mgmt heartbeat message
int64_t
sKey
;
int8_t
accessState
;
// Checked by mgmt heartbeat message
}
SAcctInfo
;
typedef
struct
_acctObj
{
char
user
[
TSDB_USER_LEN
+
1
];
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_KEY_LEN
];
SAcctCfg
cfg
;
S
CM
AcctCfg
cfg
;
int32_t
acctId
;
int64_t
createdTime
;
char
reserved
[
15
];
char
updateEnd
[
1
];
int8_t
reserved
[
15
];
int8_t
updateEnd
[
1
];
SAcctInfo
acctInfo
;
SDbObj
*
pHead
;
SUserObj
*
pUser
;
struct
_connObj
*
pConn
;
pthread_mutex_t
mutex
;
}
SAcctObj
;
...
...
src/inc/taosmsg.h
浏览文件 @
cdee51f6
...
...
@@ -280,10 +280,6 @@ typedef struct {
uint8_t
ignoreNotExists
;
}
SDropDbMsg
,
SUseDbMsg
;
typedef
struct
{
char
user
[
TSDB_USER_LEN
];
}
SDropUserMsg
,
SDropAcctMsg
;
typedef
struct
{
char
db
[
TSDB_DB_NAME_LEN
];
}
SShowTableMsg
;
...
...
@@ -340,21 +336,25 @@ typedef struct {
int64_t
maxQueryTime
;
// In unit of hour
int64_t
maxInbound
;
int64_t
maxOutbound
;
char
accessState
;
// Configured only by command
}
SAcctCfg
;
int8_t
accessState
;
// Configured only by command
}
S
CM
AcctCfg
;
typedef
struct
{
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_KEY_LEN
];
SAcctCfg
cfg
;
}
SC
reateAcctMsg
,
S
AlterAcctMsg
;
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_KEY_LEN
];
S
CM
AcctCfg
cfg
;
}
SC
MCreateAcctMsg
,
SCM
AlterAcctMsg
;
typedef
struct
{
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_KEY_LEN
];
char
privilege
;
char
flag
;
}
SCreateUserMsg
,
SAlterUserMsg
;
}
SCMDropUserMsg
,
SCMDropAcctMsg
;
typedef
struct
{
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_KEY_LEN
];
int8_t
privilege
;
int8_t
flag
;
}
SCMCreateUserMsg
,
SCMAlterUserMsg
;
typedef
struct
{
char
db
[
TSDB_TABLE_ID_LEN
];
...
...
src/kit/shell/src/shellMain.c
浏览文件 @
cdee51f6
...
...
@@ -81,7 +81,15 @@ struct arguments args = {
*/
int
main
(
int
argc
,
char
*
argv
[])
{
/*setlocale(LC_ALL, "en_US.UTF-8"); */
//
void
*
taos
=
taos_connect
(
NULL
,
"root"
,
"taosdata"
,
NULL
,
0
);
printf
(
"ok
\n
"
);
taos_query
(
taos
,
"create account a pass 'b'"
);
while
(
1
)
{
sleep
(
1000
);
}
//
if
(
!
checkVersion
())
{
exit
(
EXIT_FAILURE
);
}
...
...
src/mnode/CMakeLists.txt
浏览文件 @
cdee51f6
...
...
@@ -13,9 +13,9 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
ADD_LIBRARY
(
mnode
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
mnode trpc tutil sdb pthread
)
#
IF (TD_CLUSTER)
# TARGET_LINK_LIBRARIES(mnode mcluster
)
#
ENDIF ()
IF
(
TD_CLUSTER
)
TARGET_LINK_LIBRARIES
(
mnode acct
)
ENDIF
()
ENDIF
()
src/mnode/inc/mgmtAcct.h
浏览文件 @
cdee51f6
...
...
@@ -28,12 +28,11 @@ int32_t mgmtAddUserIntoAcct(SAcctObj *pAcct, SUserObj *pUser);
int32_t
mgmtRemoveUserFromAcct
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
);
extern
int32_t
(
*
mgmtInitAccts
)();
extern
void
(
*
mgmtCleanUpAccts
)();
extern
SAcctObj
*
(
*
mgmtGetAcct
)(
char
*
acctName
);
extern
int32_t
(
*
mgmtCheckUserLimit
)(
SAcctObj
*
pAcct
);
extern
int32_t
(
*
mgmtCheckDbLimit
)(
SAcctObj
*
pAcct
);
extern
int32_t
(
*
mgmtCheckTableLimit
)(
SAcctObj
*
pAcct
,
SCreateTableMsg
*
pCreate
);
extern
void
(
*
mgmtCheckAcct
)();
extern
void
(
*
mgmtCleanUpAccts
)();
extern
int32_t
(
*
mgmtGetAcctMeta
)(
SMeterMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
extern
int32_t
(
*
mgmtRetrieveAccts
)(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
...
...
src/mnode/src/mgmtAcct.c
浏览文件 @
cdee51f6
...
...
@@ -97,18 +97,21 @@ int32_t mgmtRemoveUserFromAcct(SAcctObj *pAcct, SUserObj *pUser) {
}
int32_t
mgmtInitAcctsImp
()
{
SAcctObj
*
pAcct
=
&
tsAcctObj
;
pAcct
->
acctId
=
0
;
strcpy
(
pAcct
->
user
,
"root"
);
return
0
;
}
int32_t
(
*
mgmtInitAccts
)()
=
mgmtInitAcctsImp
;
SAcctObj
*
mgmtGetAcctImp
(
char
*
acctName
)
{
static
SAcctObj
*
mgmtGetAcctImp
(
char
*
acctName
)
{
return
&
tsAcctObj
;
}
SAcctObj
*
(
*
mgmtGetAcct
)(
char
*
acctName
)
=
mgmtGetAcctImp
;
int32_t
mgmtCheckUserLimitImp
(
SAcctObj
*
pAcct
)
{
static
int32_t
mgmtCheckUserLimitImp
(
SAcctObj
*
pAcct
)
{
int32_t
numOfUsers
=
sdbGetNumOfRows
(
tsUserSdb
);
if
(
numOfUsers
>=
tsMaxUsers
)
{
mWarn
(
"numOfUsers:%d, exceed tsMaxUsers:%d"
,
numOfUsers
,
tsMaxUsers
);
...
...
@@ -119,7 +122,7 @@ int32_t mgmtCheckUserLimitImp(SAcctObj *pAcct) {
int32_t
(
*
mgmtCheckUserLimit
)(
SAcctObj
*
pAcct
)
=
mgmtCheckUserLimitImp
;
int32_t
mgmtCheckDbLimitImp
(
SAcctObj
*
pAcct
)
{
static
int32_t
mgmtCheckDbLimitImp
(
SAcctObj
*
pAcct
)
{
int32_t
numOfDbs
=
sdbGetNumOfRows
(
tsDbSdb
);
if
(
numOfDbs
>=
tsMaxDbs
)
{
mWarn
(
"numOfDbs:%d, exceed tsMaxDbs:%d"
,
numOfDbs
,
tsMaxDbs
);
...
...
@@ -130,36 +133,24 @@ int32_t mgmtCheckDbLimitImp(SAcctObj *pAcct) {
int32_t
(
*
mgmtCheckDbLimit
)(
SAcctObj
*
pAcct
)
=
mgmtCheckDbLimitImp
;
int32_t
mgmtCheckTableLimitImp
(
SAcctObj
*
pAcct
,
SCreateTableMsg
*
pCreate
)
{
static
int32_t
mgmtCheckTableLimitImp
(
SAcctObj
*
pAcct
,
SCreateTableMsg
*
pCreate
)
{
return
0
;
}
int32_t
(
*
mgmtCheckTableLimit
)(
SAcctObj
*
pAcct
,
SCreateTableMsg
*
pCreate
)
=
mgmtCheckTableLimitImp
;
void
mgmtCheckAcctImp
()
{
SAcctObj
*
pAcct
=
&
tsAcctObj
;
pAcct
->
acctId
=
0
;
strcpy
(
pAcct
->
user
,
"root"
);
mgmtCreateUser
(
pAcct
,
"root"
,
"taosdata"
);
mgmtCreateUser
(
pAcct
,
"monitor"
,
tsInternalPass
);
mgmtCreateUser
(
pAcct
,
"_root"
,
tsInternalPass
);
}
void
(
*
mgmtCheckAcct
)()
=
mgmtCheckAcctImp
;
void
mgmtCleanUpAcctsImp
()
{
static
void
mgmtCleanUpAcctsImp
()
{
}
void
(
*
mgmtCleanUpAccts
)()
=
mgmtCleanUpAcctsImp
;
int32_t
mgmtGetAcctMetaImp
(
SMeterMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
static
int32_t
mgmtGetAcctMetaImp
(
SMeterMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
return
TSDB_CODE_OPS_NOT_SUPPORT
;
}
int32_t
(
*
mgmtGetAcctMeta
)(
SMeterMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
=
mgmtGetAcctMetaImp
;
int32_t
mgmtRetrieveAcctsImp
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
)
{
static
int32_t
mgmtRetrieveAcctsImp
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
)
{
return
0
;
}
...
...
src/mnode/src/mgmtShell.c
浏览文件 @
cdee51f6
...
...
@@ -60,6 +60,8 @@ void mgmtProcessTranRequest(SSchedMsg *sched) {
void
*
pConn
=
sched
->
thandle
;
(
*
mgmtProcessShellMsg
[
msgType
])(
pCont
,
contLen
,
pConn
);
//rpcSendResponse(pConn, 12, NULL, 0);
if
(
sched
->
msg
)
{
free
(
sched
->
msg
);
}
...
...
@@ -73,7 +75,7 @@ void mgmtAddToTranRequest(int8_t type, void *pCont, int contLen, void *ahandle)
schedMsg
.
thandle
=
ahandle
;
*
(
int8_t
*
)
(
schedMsg
.
msg
)
=
type
;
*
(
int32_t
*
)
(
schedMsg
.
msg
+
sizeof
(
int8_t
))
=
contLen
;
memcpy
(
schedMsg
.
msg
,
pCont
+
sizeof
(
int32_t
)
+
sizeof
(
int8_t
)
,
contLen
);
memcpy
(
schedMsg
.
msg
+
sizeof
(
int32_t
)
+
sizeof
(
int8_t
),
pCont
,
contLen
);
taosScheduleTask
(
tsMgmtTranQhandle
,
&
schedMsg
);
}
...
...
@@ -632,7 +634,7 @@ int32_t mgmtProcessKillConnectionMsg(void *pCont, int32_t contLen, void *ahandle
}
int32_t
mgmtProcessCreateUserMsg
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
// SC
reateUserMsg *pCreate = (S
CreateUserMsg *)pMsg;
// SC
MCreateUserMsg *pCreate = (SCM
CreateUserMsg *)pMsg;
// int32_t code = 0;
//
// if (mgmtCheckRedirectMsg(pConn, TSDB_MSG_TYPE_CREATE_USER_RSP) != 0) {
...
...
@@ -654,7 +656,7 @@ int32_t mgmtProcessCreateUserMsg(void *pCont, int32_t contLen, void *ahandle) {
}
int32_t
mgmtProcessAlterUserMsg
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
// S
AlterUserMsg *pAlter = (S
AlterUserMsg *)pMsg;
// S
CMAlterUserMsg *pAlter = (SCM
AlterUserMsg *)pMsg;
// int32_t code = 0;
// SUserObj * pUser;
// SUserObj * pOperUser;
...
...
@@ -766,7 +768,7 @@ int32_t mgmtProcessAlterUserMsg(void *pCont, int32_t contLen, void *ahandle) {
}
int32_t
mgmtProcessDropUserMsg
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
// S
DropUserMsg *pDrop = (S
DropUserMsg *)pMsg;
// S
CMDropUserMsg *pDrop = (SCM
DropUserMsg *)pMsg;
// int32_t code = 0;
// SUserObj * pUser;
// SUserObj * pOperUser;
...
...
@@ -1407,44 +1409,15 @@ int32_t mgmtCheckRedirectMsgImp(void *pConn, int32_t msgType) {
}
int32_t
(
*
mgmtCheckRedirectMsg
)(
void
*
pConn
,
int32_t
msgType
)
=
mgmtCheckRedirectMsgImp
;
int32_t
mgmtProcessAlterAcctMsgImp
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
//return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_ALTER_ACCT_RSP, TSDB_CODE_OPS_NOT_SUPPORT);
return
0
;
}
int32_t
(
*
mgmtProcessAlterAcctMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessAlterAcctMsgImp
;
int32_t
mgmtProcessCreateDnodeMsgImp
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
//return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_CREATE_DNODE_RSP, TSDB_CODE_OPS_NOT_SUPPORT);
return
0
;
}
int32_t
(
*
mgmtProcessCreateDnodeMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessCreateDnodeMsgImp
;
int32_t
mgmtProcessCfgMnodeMsgImp
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
//return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_CFG_MNODE_RSP, TSDB_CODE_OPS_NOT_SUPPORT);
return
0
;
}
int32_t
(
*
mgmtProcessCfgMnodeMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessCfgMnodeMsgImp
;
int32_t
mgmtProcessDropMnodeMsgImp
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
//return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_DROP_MNODE_RSP, TSDB_CODE_OPS_NOT_SUPPORT);
static
int32_t
mgmtProcessUnSupportMsg
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
rpcSendResponse
(
ahandle
,
TSDB_CODE_OPS_NOT_SUPPORT
,
NULL
,
0
);
return
0
;
}
int32_t
(
*
mgmtProcessDropMnodeMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessDropMnodeMsgImp
;
int32_t
mgmtProcessDropDnodeMsgImp
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
//return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_DROP_DNODE_RSP, TSDB_CODE_OPS_NOT_SUPPORT);
return
0
;
}
int32_t
(
*
mgmtProcessDropDnodeMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessDropDnodeMsgImp
;
int32_t
mgmtProcessDropAcctMsgImp
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
// return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_DROP_ACCT_RSP, TSDB_CODE_OPS_NOT_SUPPORT);
return
0
;
}
int32_t
(
*
mgmtProcessDropAcctMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessDropAcctMsgImp
;
int32_t
mgmtProcessCreateAcctMsgImp
(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
{
// return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_CREATE_ACCT_RSP, TSDB_CODE_OPS_NOT_SUPPORT);
return
0
;
}
int32_t
(
*
mgmtProcessCreateAcctMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessCreateAcctMsgImp
;
\ No newline at end of file
int32_t
(
*
mgmtProcessAlterAcctMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessUnSupportMsg
;
int32_t
(
*
mgmtProcessCreateDnodeMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessUnSupportMsg
;
int32_t
(
*
mgmtProcessCfgMnodeMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessUnSupportMsg
;
int32_t
(
*
mgmtProcessDropMnodeMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessUnSupportMsg
;
int32_t
(
*
mgmtProcessDropDnodeMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessUnSupportMsg
;
int32_t
(
*
mgmtProcessDropAcctMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessUnSupportMsg
;
int32_t
(
*
mgmtProcessCreateAcctMsg
)(
void
*
pCont
,
int32_t
contLen
,
void
*
ahandle
)
=
mgmtProcessUnSupportMsg
;
\ No newline at end of file
src/mnode/src/mgmtSystem.c
浏览文件 @
cdee51f6
...
...
@@ -125,8 +125,6 @@ int32_t mgmtStartSystem() {
mError
(
"failed to init dnode balance"
)
}
mgmtCheckAcct
();
taosTmrReset
(
mgmtDoStatistic
,
tsStatusInterval
*
30000
,
NULL
,
tsMgmtTmr
,
&
tsMgmtStatisTimer
);
mPrint
(
"TDengine mgmt is initialized successfully"
);
...
...
src/mnode/src/mgmtUser.c
浏览文件 @
cdee51f6
...
...
@@ -78,6 +78,11 @@ int32_t mgmtInitUsers() {
numOfUsers
++
;
}
pAcct
=
mgmtGetAcct
(
"root"
);
mgmtCreateUser
(
pAcct
,
"root"
,
"taosdata"
);
mgmtCreateUser
(
pAcct
,
"monitor"
,
tsInternalPass
);
mgmtCreateUser
(
pAcct
,
"_root"
,
tsInternalPass
);
mTrace
(
"user data is initialized"
);
return
0
;
}
...
...
src/util/CMakeLists.txt
浏览文件 @
cdee51f6
...
...
@@ -108,9 +108,9 @@ ELSEIF(TD_DARWIN_64)
TARGET_LINK_LIBRARIES
(
tutil iconv pthread os
)
ENDIF
()
IF
(
TD_CLUSTER
)
TARGET_LINK_LIBRARIES
(
tutil mstorage
)
ENDIF
()
#IF (TD_CLUSTER)
#
TARGET_LINK_LIBRARIES(tutil mstorage)
#
ENDIF ()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录