Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
23f4876f
O
oceanbase
项目概览
oceanbase
/
oceanbase
9 个月 前同步成功
通知
261
Star
6084
Fork
1301
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
23f4876f
编写于
11月 30, 2022
作者:
O
obdev
提交者:
OB-robot
11月 30, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] bugfix: alter user resource/public/connect identified by pwd core
上级
7d21e913
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
1 deletion
+31
-1
src/sql/resolver/dcl/ob_set_password_resolver.cpp
src/sql/resolver/dcl/ob_set_password_resolver.cpp
+30
-1
src/sql/resolver/dcl/ob_set_password_resolver.h
src/sql/resolver/dcl/ob_set_password_resolver.h
+1
-0
未找到文件。
src/sql/resolver/dcl/ob_set_password_resolver.cpp
浏览文件 @
23f4876f
...
...
@@ -78,9 +78,15 @@ int ObSetPasswordResolver::resolve(const ParseNode &parse_tree)
ObString
host_name
;
const
ObString
&
session_user_name
=
session_info_
->
get_user_name
();
const
ObString
&
session_host_name
=
session_info_
->
get_host_name
();
bool
is_valid
=
false
;
if
(
NULL
!=
node
->
children_
[
0
])
{
ParseNode
*
user_hostname_node
=
node
->
children_
[
0
];
if
(
OB_ISNULL
(
user_hostname_node
->
children_
[
0
]))
{
if
(
OB_FAIL
(
check_role_as_user
(
user_hostname_node
,
is_valid
)))
{
LOG_WARN
(
"failed to check role as user"
,
K
(
ret
));
}
else
if
(
!
is_valid
)
{
ret
=
OB_USER_NOT_EXIST
;
LOG_ORACLE_USER_ERROR
(
OB_USER_NOT_EXIST
,
int
(
user_hostname_node
->
str_len_
),
user_hostname_node
->
str_value_
);
}
else
if
(
OB_ISNULL
(
user_hostname_node
->
children_
[
0
]))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"username should not be NULL"
,
K
(
ret
));
}
else
{
...
...
@@ -326,3 +332,26 @@ int ObSetPasswordResolver::resolve_oracle_password_strength(common::ObString &us
}
return
ret
;
}
/*
bugfix : https://work.aone.alibaba-inc.com/issue/46244474
alter user resource identified by password core cause by invalid memory access
*/
int
ObSetPasswordResolver
::
check_role_as_user
(
ParseNode
*
user_hostname_node
,
bool
&
is_valid
)
{
is_valid
=
false
;
int
ret
=
OB_SUCCESS
;
if
(
OB_ISNULL
(
user_hostname_node
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"failed to check_role_as_user, user_hostname_node is NULL"
,
K
(
ret
));
}
else
if
(
!
lib
::
is_oracle_mode
()
||
T_VARCHAR
!=
user_hostname_node
->
type_
)
{
is_valid
=
true
;
}
else
{
ObString
node_str
(
user_hostname_node
->
str_len_
,
user_hostname_node
->
str_value_
);
if
(
0
!=
node_str
.
case_compare
(
OB_ORA_RESOURCE_ROLE_NAME
)
&&
0
!=
node_str
.
case_compare
(
OB_ORA_PUBLIC_ROLE_NAME
)
&&
0
!=
node_str
.
case_compare
(
OB_ORA_CONNECT_ROLE_NAME
))
{
is_valid
=
true
;
}
}
return
ret
;
}
\ No newline at end of file
src/sql/resolver/dcl/ob_set_password_resolver.h
浏览文件 @
23f4876f
...
...
@@ -39,6 +39,7 @@ private:
int
resolve_oracle_password_strength
(
common
::
ObString
&
user_name
,
common
::
ObString
&
hostname
,
common
::
ObString
&
password
);
int
check_role_as_user
(
ParseNode
*
user_hostname_node
,
bool
&
is_valid
);
private:
const
static
uint64_t
MAX_CONNECTIONS
=
4294967295
;
// disallow copy
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录