Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oblogproxy
提交
1504a965
O
oblogproxy
项目概览
oceanbase
/
oblogproxy
大约 1 年 前同步成功
通知
24
Star
29
Fork
10
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oblogproxy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1504a965
编写于
7月 25, 2022
作者:
F
Fankux
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
judge sys tenant when auth
上级
0f647e8e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
2 deletion
+8
-2
src/obaccess/ob_access.cpp
src/obaccess/ob_access.cpp
+3
-2
src/obaccess/oblog_config.cpp
src/obaccess/oblog_config.cpp
+4
-0
src/obaccess/oblog_config.h
src/obaccess/oblog_config.h
+1
-0
未找到文件。
src/obaccess/ob_access.cpp
浏览文件 @
1504a965
...
...
@@ -174,7 +174,8 @@ int ObAccess::init(const OblogConfig& hs_config)
int
ObAccess
::
auth
()
{
for
(
auto
&
server
:
_servers
)
{
int
ret
=
_table_whites
.
all_tenant
?
auth_sys
(
server
)
:
auth_tenant
(
server
);
bool
auth_by_sys
=
_table_whites
.
all_tenant
||
_table_whites
.
with_sys
;
int
ret
=
auth_by_sys
?
auth_sys
(
server
)
:
auth_tenant
(
server
);
if
(
ret
!=
OMS_OK
)
{
return
OMS_FAILED
;
}
...
...
@@ -201,7 +202,7 @@ int ObAccess::auth_sys(const ServerInfo& server)
const
MySQLRow
&
row
=
rs
.
rows
.
front
();
const
std
::
string
&
tenant
=
row
.
fields
().
front
();
if
(
tenant
.
size
()
<
3
||
strncasecmp
(
"sys"
,
tenant
.
c_str
(),
3
)
!=
0
)
{
OMS_ERROR
<<
"Failed to auth, all tenant mode
must be
sys tenant, current: "
<<
tenant
;
OMS_ERROR
<<
"Failed to auth, all tenant mode
or sys tenant must be connected as
sys tenant, current: "
<<
tenant
;
return
OMS_FAILED
;
}
return
OMS_OK
;
...
...
src/obaccess/oblog_config.cpp
浏览文件 @
1504a965
...
...
@@ -113,7 +113,11 @@ int TenantDbTable::from(const std::string& table_whites)
}
const
std
::
string
&
tenant
=
items
[
0
];
if
(
tenant
==
"sys"
)
{
with_sys
=
true
;
}
if
(
tenant
==
"*"
)
{
with_sys
=
true
;
all_tenant
=
true
;
tenants
.
clear
();
return
OMS_OK
;
...
...
src/obaccess/oblog_config.h
浏览文件 @
1504a965
...
...
@@ -60,6 +60,7 @@ struct DbTable {
};
struct
TenantDbTable
{
bool
with_sys
=
false
;
bool
all_tenant
=
false
;
std
::
map
<
std
::
string
,
DbTable
>
tenants
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录