Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN产品汪
TDengine
提交
ab7b7f42
T
TDengine
项目概览
CSDN产品汪
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ab7b7f42
编写于
6月 10, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-459: TSDB_PASSWORD_LEN
上级
7f123214
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
10 addition
and
10 deletion
+10
-10
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscSql.c
src/client/src/tscSql.c
+2
-2
src/common/src/tglobal.c
src/common/src/tglobal.c
+1
-1
src/plugins/http/src/gcHandle.c
src/plugins/http/src/gcHandle.c
+1
-1
src/plugins/http/src/httpAuth.c
src/plugins/http/src/httpAuth.c
+2
-2
src/plugins/http/src/restHandle.c
src/plugins/http/src/restHandle.c
+1
-1
src/plugins/http/src/tgHandle.c
src/plugins/http/src/tgHandle.c
+2
-2
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
ab7b7f42
...
@@ -169,7 +169,7 @@ static int32_t handlePassword(SSqlCmd* pCmd, SSQLToken* pPwd) {
...
@@ -169,7 +169,7 @@ static int32_t handlePassword(SSqlCmd* pCmd, SSQLToken* pPwd) {
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
}
if
(
pPwd
->
n
>
TSDB_PASSWORD_LEN
)
{
if
(
pPwd
->
n
>
=
TSDB_PASSWORD_LEN
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
}
...
...
src/client/src/tscSql.c
浏览文件 @
ab7b7f42
...
@@ -45,11 +45,11 @@ static bool validImpl(const char* str, size_t maxsize) {
...
@@ -45,11 +45,11 @@ static bool validImpl(const char* str, size_t maxsize) {
}
}
static
bool
validUserName
(
const
char
*
user
)
{
static
bool
validUserName
(
const
char
*
user
)
{
return
validImpl
(
user
,
TSDB_USER_LEN
);
return
validImpl
(
user
,
TSDB_USER_LEN
-
1
);
}
}
static
bool
validPassword
(
const
char
*
passwd
)
{
static
bool
validPassword
(
const
char
*
passwd
)
{
return
validImpl
(
passwd
,
TSDB_PASSWORD_LEN
);
return
validImpl
(
passwd
,
TSDB_PASSWORD_LEN
-
1
);
}
}
SSqlObj
*
taosConnectImpl
(
const
char
*
ip
,
const
char
*
user
,
const
char
*
pass
,
const
char
*
db
,
uint16_t
port
,
SSqlObj
*
taosConnectImpl
(
const
char
*
ip
,
const
char
*
user
,
const
char
*
pass
,
const
char
*
db
,
uint16_t
port
,
...
...
src/common/src/tglobal.c
浏览文件 @
ab7b7f42
...
@@ -728,7 +728,7 @@ static void doInitGlobalConfig() {
...
@@ -728,7 +728,7 @@ static void doInitGlobalConfig() {
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLIENT
|
TSDB_CFG_CTYPE_B_NOT_PRINT
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLIENT
|
TSDB_CFG_CTYPE_B_NOT_PRINT
;
cfg
.
minValue
=
0
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
0
;
cfg
.
maxValue
=
0
;
cfg
.
ptrLength
=
TSDB_PASSWORD_LEN
;
cfg
.
ptrLength
=
TSDB_PASSWORD_LEN
-
1
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
taosInitConfigOption
(
cfg
);
...
...
src/plugins/http/src/gcHandle.c
浏览文件 @
ab7b7f42
...
@@ -58,7 +58,7 @@ bool gcGetUserFromUrl(HttpContext* pContext) {
...
@@ -58,7 +58,7 @@ bool gcGetUserFromUrl(HttpContext* pContext) {
bool
gcGetPassFromUrl
(
HttpContext
*
pContext
)
{
bool
gcGetPassFromUrl
(
HttpContext
*
pContext
)
{
HttpParser
*
pParser
=
&
pContext
->
parser
;
HttpParser
*
pParser
=
&
pContext
->
parser
;
if
(
pParser
->
path
[
GC_PASS_URL_POS
].
len
>
TSDB_PASSWORD_LEN
-
1
||
pParser
->
path
[
GC_PASS_URL_POS
].
len
<=
0
)
{
if
(
pParser
->
path
[
GC_PASS_URL_POS
].
len
>
=
TSDB_PASSWORD_LEN
||
pParser
->
path
[
GC_PASS_URL_POS
].
len
<=
0
)
{
return
false
;
return
false
;
}
}
...
...
src/plugins/http/src/httpAuth.c
浏览文件 @
ab7b7f42
...
@@ -89,7 +89,7 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) {
...
@@ -89,7 +89,7 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) {
return
false
;
return
false
;
}
else
{
}
else
{
tstrncpy
(
pContext
->
user
,
descrypt
,
sizeof
(
pContext
->
user
));
tstrncpy
(
pContext
->
user
,
descrypt
,
sizeof
(
pContext
->
user
));
tstrncpy
(
pContext
->
pass
,
descrypt
+
TSDB_USER_LEN
,
TSDB_PASSWORD_LEN
);
tstrncpy
(
pContext
->
pass
,
descrypt
+
TSDB_USER_LEN
,
sizeof
(
pContext
->
pass
)
);
httpTrace
(
"context:%p, fd:%d, ip:%s, taosd token:%s parsed success, user:%s"
,
pContext
,
pContext
->
fd
,
httpTrace
(
"context:%p, fd:%d, ip:%s, taosd token:%s parsed success, user:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
token
,
pContext
->
user
);
pContext
->
ipstr
,
token
,
pContext
->
user
);
...
@@ -102,7 +102,7 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) {
...
@@ -102,7 +102,7 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) {
bool
httpGenTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int
maxLen
)
{
bool
httpGenTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int
maxLen
)
{
char
buffer
[
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
]
=
{
0
};
char
buffer
[
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
]
=
{
0
};
strncpy
(
buffer
,
pContext
->
user
,
sizeof
(
pContext
->
user
));
strncpy
(
buffer
,
pContext
->
user
,
sizeof
(
pContext
->
user
));
strncpy
(
buffer
+
TSDB_USER_LEN
,
pContext
->
pass
,
TSDB_PASSWORD_LEN
);
strncpy
(
buffer
+
TSDB_USER_LEN
,
pContext
->
pass
,
sizeof
(
pContext
->
pass
)
);
char
*
encrypt
=
taosDesEncode
(
KEY_DES_4
,
buffer
,
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
);
char
*
encrypt
=
taosDesEncode
(
KEY_DES_4
,
buffer
,
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
);
char
*
base64
=
base64_encode
((
const
unsigned
char
*
)
encrypt
,
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
);
char
*
base64
=
base64_encode
((
const
unsigned
char
*
)
encrypt
,
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
);
...
...
src/plugins/http/src/restHandle.c
浏览文件 @
ab7b7f42
...
@@ -71,7 +71,7 @@ bool restGetUserFromUrl(HttpContext* pContext) {
...
@@ -71,7 +71,7 @@ bool restGetUserFromUrl(HttpContext* pContext) {
bool
restGetPassFromUrl
(
HttpContext
*
pContext
)
{
bool
restGetPassFromUrl
(
HttpContext
*
pContext
)
{
HttpParser
*
pParser
=
&
pContext
->
parser
;
HttpParser
*
pParser
=
&
pContext
->
parser
;
if
(
pParser
->
path
[
REST_PASS_URL_POS
].
len
>
TSDB_PASSWORD_LEN
-
1
||
pParser
->
path
[
REST_PASS_URL_POS
].
len
<=
0
)
{
if
(
pParser
->
path
[
REST_PASS_URL_POS
].
len
>
=
TSDB_PASSWORD_LEN
||
pParser
->
path
[
REST_PASS_URL_POS
].
len
<=
0
)
{
return
false
;
return
false
;
}
}
...
...
src/plugins/http/src/tgHandle.c
浏览文件 @
ab7b7f42
...
@@ -316,11 +316,11 @@ bool tgGetUserFromUrl(HttpContext *pContext) {
...
@@ -316,11 +316,11 @@ bool tgGetUserFromUrl(HttpContext *pContext) {
bool
tgGetPassFromUrl
(
HttpContext
*
pContext
)
{
bool
tgGetPassFromUrl
(
HttpContext
*
pContext
)
{
HttpParser
*
pParser
=
&
pContext
->
parser
;
HttpParser
*
pParser
=
&
pContext
->
parser
;
if
(
pParser
->
path
[
TG_PASS_URL_POS
].
len
>
TSDB_PASSWORD_LEN
-
1
||
pParser
->
path
[
TG_PASS_URL_POS
].
len
<=
0
)
{
if
(
pParser
->
path
[
TG_PASS_URL_POS
].
len
>
=
TSDB_PASSWORD_LEN
||
pParser
->
path
[
TG_PASS_URL_POS
].
len
<=
0
)
{
return
false
;
return
false
;
}
}
tstrncpy
(
pContext
->
pass
,
pParser
->
path
[
TG_PASS_URL_POS
].
pos
,
TSDB_PASSWORD_LEN
);
tstrncpy
(
pContext
->
pass
,
pParser
->
path
[
TG_PASS_URL_POS
].
pos
,
sizeof
(
pContext
->
pass
)
);
return
true
;
return
true
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录