Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
41a8c764
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
41a8c764
编写于
2月 21, 2022
作者:
X
xywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TS-229]<feature>: enhance altering password feature
上级
0bea9c93
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
30 addition
and
6 deletion
+30
-6
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-1
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+3
-0
src/common/src/tglobal.c
src/common/src/tglobal.c
+13
-0
src/inc/taosdef.h
src/inc/taosdef.h
+3
-2
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+1
-1
src/mnode/src/mnodeUser.c
src/mnode/src/mnodeUser.c
+8
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
41a8c764
...
@@ -366,7 +366,7 @@ static int32_t handlePassword(SSqlCmd* pCmd, SStrToken* pPwd) {
...
@@ -366,7 +366,7 @@ static int32_t handlePassword(SSqlCmd* pCmd, SStrToken* pPwd) {
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
}
if
(
pPwd
->
n
>
=
TSDB_PASS_LEN
)
{
if
(
pPwd
->
n
>
tsPasswordLength
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
}
...
...
src/client/src/tscSql.c
浏览文件 @
41a8c764
...
@@ -49,7 +49,7 @@ static bool validUserName(const char* user) {
...
@@ -49,7 +49,7 @@ static bool validUserName(const char* user) {
}
}
static
bool
validPassword
(
const
char
*
passwd
)
{
static
bool
validPassword
(
const
char
*
passwd
)
{
return
validImpl
(
passwd
,
TSDB_PASS_LEN
-
1
);
return
validImpl
(
passwd
,
tsPasswordLength
);
}
}
static
SSqlObj
*
taosConnectImpl
(
const
char
*
ip
,
const
char
*
user
,
const
char
*
pass
,
const
char
*
auth
,
const
char
*
db
,
static
SSqlObj
*
taosConnectImpl
(
const
char
*
ip
,
const
char
*
user
,
const
char
*
pass
,
const
char
*
auth
,
const
char
*
db
,
...
...
src/common/inc/tglobal.h
浏览文件 @
41a8c764
...
@@ -159,6 +159,9 @@ extern int32_t tsMonitorInterval;
...
@@ -159,6 +159,9 @@ extern int32_t tsMonitorInterval;
// stream
// stream
extern
int8_t
tsEnableStream
;
extern
int8_t
tsEnableStream
;
// password
extern
int32_t
tsPasswordLength
;
// internal
// internal
extern
int8_t
tsCompactMnodeWal
;
extern
int8_t
tsCompactMnodeWal
;
extern
int8_t
tsPrintAuth
;
extern
int8_t
tsPrintAuth
;
...
...
src/common/src/tglobal.c
浏览文件 @
41a8c764
...
@@ -204,6 +204,9 @@ int32_t tsMonitorInterval = 30; // seconds
...
@@ -204,6 +204,9 @@ int32_t tsMonitorInterval = 30; // seconds
// stream
// stream
int8_t
tsEnableStream
=
1
;
int8_t
tsEnableStream
=
1
;
// password
int32_t
tsPasswordLength
=
TSDB_PASS_LEN
-
1
;
// internal
// internal
int8_t
tsCompactMnodeWal
=
0
;
int8_t
tsCompactMnodeWal
=
0
;
int8_t
tsPrintAuth
=
0
;
int8_t
tsPrintAuth
=
0
;
...
@@ -1302,6 +1305,16 @@ static void doInitGlobalConfig(void) {
...
@@ -1302,6 +1305,16 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"passwordLength"
;
cfg
.
ptr
=
&
tsPasswordLength
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
1
;
cfg
.
maxValue
=
TSDB_PASS_LEN
-
1
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"topicBinaryLen"
;
cfg
.
option
=
"topicBinaryLen"
;
cfg
.
ptr
=
&
tsTopicBianryLen
;
cfg
.
ptr
=
&
tsTopicBianryLen
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
...
...
src/inc/taosdef.h
浏览文件 @
41a8c764
...
@@ -86,7 +86,9 @@ extern const int32_t TYPE_BYTES[16];
...
@@ -86,7 +86,9 @@ extern const int32_t TYPE_BYTES[16];
#define TSDB_DEFAULT_USER "root"
#define TSDB_DEFAULT_USER "root"
#define TSDB_DEFAULT_PASS "taosdata"
#define TSDB_DEFAULT_PASS "taosdata"
#define SHELL_MAX_PASSWORD_LEN 20
#define TSDB_PASS_LEN 33
#define SHELL_MAX_PASSWORD_LEN TSDB_PASS_LEN
#define TSDB_TRUE 1
#define TSDB_TRUE 1
#define TSDB_FALSE 0
#define TSDB_FALSE 0
#define TSDB_OK 0
#define TSDB_OK 0
...
@@ -221,7 +223,6 @@ do { \
...
@@ -221,7 +223,6 @@ do { \
#define TSDB_MAX_JSON_KEY_LEN 256
#define TSDB_MAX_JSON_KEY_LEN 256
#define TSDB_MAX_JSON_KEY_MD5_LEN 16
#define TSDB_MAX_JSON_KEY_MD5_LEN 16
#define TSDB_PASS_LEN 21
#define TSDB_AUTH_LEN 16
#define TSDB_AUTH_LEN 16
#define TSDB_KEY_LEN 16
#define TSDB_KEY_LEN 16
#define TSDB_VERSION_LEN 12
#define TSDB_VERSION_LEN 12
...
...
src/kit/shell/src/shellLinux.c
浏览文件 @
41a8c764
...
@@ -186,7 +186,7 @@ static void parse_args(
...
@@ -186,7 +186,7 @@ static void parse_args(
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
printf
(
"Enter password: "
);
printf
(
"Enter password: "
);
taosSetConsoleEcho
(
false
);
taosSetConsoleEcho
(
false
);
if
(
scanf
(
"%
20
s"
,
g_password
)
>
1
)
{
if
(
scanf
(
"%
32
s"
,
g_password
)
>
1
)
{
fprintf
(
stderr
,
"password reading error
\n
"
);
fprintf
(
stderr
,
"password reading error
\n
"
);
}
}
taosSetConsoleEcho
(
true
);
taosSetConsoleEcho
(
true
);
...
...
src/mnode/src/mnodeUser.c
浏览文件 @
41a8c764
...
@@ -625,11 +625,18 @@ int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, cha
...
@@ -625,11 +625,18 @@ int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, cha
mError
(
"user:%s, failed to auth user, reason:%s"
,
user
,
tstrerror
(
TSDB_CODE_MND_INVALID_USER
));
mError
(
"user:%s, failed to auth user, reason:%s"
,
user
,
tstrerror
(
TSDB_CODE_MND_INVALID_USER
));
return
TSDB_CODE_MND_INVALID_USER
;
return
TSDB_CODE_MND_INVALID_USER
;
}
else
{
}
else
{
if
(
pUser
->
superAuth
)
{
SAcctObj
*
pAcct
=
mnodeGetAcct
(
user
);
memcpy
(
secret
,
pAcct
->
pass
,
TSDB_KEY_LEN
);
mnodeDecAcctRef
(
pAcct
);
}
else
{
memcpy
(
secret
,
pUser
->
pass
,
TSDB_KEY_LEN
);
}
*
spi
=
1
;
*
spi
=
1
;
*
encrypt
=
0
;
*
encrypt
=
0
;
*
ckey
=
0
;
*
ckey
=
0
;
memcpy
(
secret
,
pUser
->
pass
,
TSDB_KEY_LEN
);
mnodeDecUserRef
(
pUser
);
mnodeDecUserRef
(
pUser
);
mDebug
(
"user:%s, auth info is returned"
,
user
);
mDebug
(
"user:%s, auth info is returned"
,
user
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录