Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
8be277a2
提交
8be277a2
authored
6 年前
作者:
mysinmyc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
handling issues when authenticator not set
上级
72e7f15f
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
26 行增加
和
14 行删除
+26
-14
ErrorCode.java
h2/src/main/org/h2/api/ErrorCode.java
+14
-1
Engine.java
h2/src/main/org/h2/engine/Engine.java
+11
-13
_messages_en.prop
h2/src/main/org/h2/res/_messages_en.prop
+1
-0
没有找到文件。
h2/src/main/org/h2/api/ErrorCode.java
浏览文件 @
8be277a2
...
@@ -1990,7 +1990,20 @@ public class ErrorCode {
...
@@ -1990,7 +1990,20 @@ public class ErrorCode {
*/
*/
public
static
final
int
ROW_NOT_FOUND_IN_PRIMARY_INDEX
=
90143
;
public
static
final
int
ROW_NOT_FOUND_IN_PRIMARY_INDEX
=
90143
;
// next are 90122, 90144
/**
* The error with code <code>90144</code> is thrown when
* user trying to login into a database with AUTHREALM set and
* the target database doesn't have an authenticator defined
* <p>Authenticator experimental feature can be enabled by
* </p>
* <pre>
* SET AUTHENTICATOR TRUE
* </pre>
*/
public
static
final
int
AUTHENTICATOR_NOT_AVAILABLE
=
90144
;
// next are 90122, 90145
private
ErrorCode
()
{
private
ErrorCode
()
{
// utility class
// utility class
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Engine.java
浏览文件 @
8be277a2
...
@@ -93,7 +93,6 @@ public class Engine implements SessionFactory {
...
@@ -93,7 +93,6 @@ public class Engine implements SessionFactory {
}
}
if
(
user
==
null
)
{
if
(
user
==
null
)
{
if
(
database
.
validateFilePasswordHash
(
cipher
,
ci
.
getFilePasswordHash
()))
{
if
(
database
.
validateFilePasswordHash
(
cipher
,
ci
.
getFilePasswordHash
()))
{
if
(
ci
.
getProperty
(
"AUTHREALM"
)==
null
)
{
if
(
ci
.
getProperty
(
"AUTHREALM"
)==
null
)
{
user
=
database
.
findUser
(
ci
.
getUserName
());
user
=
database
.
findUser
(
ci
.
getUserName
());
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
...
@@ -102,21 +101,18 @@ public class Engine implements SessionFactory {
...
@@ -102,21 +101,18 @@ public class Engine implements SessionFactory {
}
}
}
}
}
else
{
}
else
{
try
{
Authenticator
authenticator
=
database
.
getAuthenticator
();
Authenticator
authenticator
=
database
.
getAuthenticator
();
if
(
authenticator
==
null
)
{
if
(
authenticator
==
null
)
{
DbException
er
=
DbException
.
get
(
ErrorCode
.
WRONG_USER_OR_PASSWORD
);
throw
DbException
.
get
(
ErrorCode
.
AUTHENTICATOR_NOT_AVAILABLE
,
name
);
database
.
getTrace
(
Trace
.
DATABASE
).
error
(
er
,
"no authenticator for database users"
);
}
else
{
}
else
{
try
{
AuthenticationInfo
authenticationInfo
=
new
AuthenticationInfo
(
ci
);
AuthenticationInfo
authenticationInfo
=
new
AuthenticationInfo
(
ci
);
user
=
database
.
getAuthenticator
().
authenticate
(
authenticationInfo
,
database
);
user
=
database
.
getAuthenticator
().
authenticate
(
authenticationInfo
,
database
);
}
}
catch
(
AuthenticationException
authenticationError
)
{
}
catch
(
AuthenticationException
authenticationError
)
{
database
.
getTrace
(
Trace
.
DATABASE
).
error
(
authenticationError
,
database
.
getTrace
(
Trace
.
DATABASE
).
error
(
authenticationError
,
"an error occurred during authentication; user: \""
+
"an error occurred during authentication; user: \""
+
ci
.
getUserName
()
+
"\""
);
ci
.
getUserName
()
+
"\""
);
}
finally
{
}
ci
.
cleanAuthenticationInfo
();
}
}
}
}
}
}
...
@@ -133,6 +129,8 @@ public class Engine implements SessionFactory {
...
@@ -133,6 +129,8 @@ public class Engine implements SessionFactory {
database
.
removeSession
(
null
);
database
.
removeSession
(
null
);
throw
er
;
throw
er
;
}
}
//Prevent to set _PASSWORD
ci
.
cleanAuthenticationInfo
();
checkClustering
(
ci
,
database
);
checkClustering
(
ci
,
database
);
Session
session
=
database
.
createSession
(
user
);
Session
session
=
database
.
createSession
(
user
);
if
(
session
==
null
)
{
if
(
session
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/res/_messages_en.prop
浏览文件 @
8be277a2
...
@@ -174,6 +174,7 @@
...
@@ -174,6 +174,7 @@
90141=Serializer cannot be changed because there is a data table: {0}
90141=Serializer cannot be changed because there is a data table: {0}
90142=Step size must not be zero
90142=Step size must not be zero
90143=Row {1} not found in primary index {0}
90143=Row {1} not found in primary index {0}
90144=Athenticator not enabled on database {0}
HY000=General error: {0}
HY000=General error: {0}
HY004=Unknown data type: {0}
HY004=Unknown data type: {0}
HYC00=Feature not supported: {0}
HYC00=Feature not supported: {0}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论