Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ProActive
scheduling
Commits
ed98b88b
Unverified
Commit
ed98b88b
authored
Sep 18, 2020
by
Fabien Viale
Committed by
GitHub
Sep 18, 2020
Browse files
Merge pull request #3800 from fviale/master
Fix anonymous connection in LDAP
parents
5711c675
1c30edaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
common/common-client/src/main/java/org/ow2/proactive/authentication/LDAPLoginModule.java
View file @
ed98b88b
...
...
@@ -435,7 +435,7 @@ public abstract class LDAPLoginModule extends FileLoginModule implements Loggabl
logger
.
debug
(
"check password for user: "
+
userDN
);
}
ContextHandler
handler
=
createLdapContext
(
userDN
,
password
);
ContextHandler
handler
=
createLdapContext
(
userDN
,
password
,
true
);
closeContext
(
handler
);
return
handler
!=
null
;
}
...
...
@@ -459,15 +459,19 @@ public abstract class LDAPLoginModule extends FileLoginModule implements Loggabl
}
}
private
ContextHandler
createLdapContext
(
String
user
,
String
password
)
{
private
ContextHandler
createLdapContext
(
String
user
,
String
password
,
boolean
requireAuthentication
)
{
LdapContext
ctx
=
null
;
StartTlsResponse
tls
=
null
;
Hashtable
<
String
,
String
>
env
=
createBasicEnvForInitalContext
();
try
{
if
(!
START_TLS
)
{
if
(!
AUTHENTICATION_METHOD
.
equals
(
ANONYMOUS_LDAP_CONNECTION
))
{
env
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
AUTHENTICATION_METHOD
);
if
(
requireAuthentication
||
!
AUTHENTICATION_METHOD
.
equals
(
ANONYMOUS_LDAP_CONNECTION
))
{
if
(
requireAuthentication
)
{
env
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
"simple"
);
}
else
{
env
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
AUTHENTICATION_METHOD
);
}
env
.
put
(
Context
.
SECURITY_PRINCIPAL
,
user
);
env
.
put
(
Context
.
SECURITY_CREDENTIALS
,
password
);
}
...
...
@@ -500,8 +504,12 @@ public abstract class LDAPLoginModule extends FileLoginModule implements Loggabl
}
else
{
tls
.
negotiate
();
}
if
(!
AUTHENTICATION_METHOD
.
equals
(
ANONYMOUS_LDAP_CONNECTION
))
{
ctx
.
addToEnvironment
(
Context
.
SECURITY_AUTHENTICATION
,
AUTHENTICATION_METHOD
);
if
(
requireAuthentication
||
!
AUTHENTICATION_METHOD
.
equals
(
ANONYMOUS_LDAP_CONNECTION
))
{
if
(
requireAuthentication
)
{
env
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
"simple"
);
}
else
{
ctx
.
addToEnvironment
(
Context
.
SECURITY_AUTHENTICATION
,
AUTHENTICATION_METHOD
);
}
ctx
.
addToEnvironment
(
Context
.
SECURITY_PRINCIPAL
,
user
);
ctx
.
addToEnvironment
(
Context
.
SECURITY_CREDENTIALS
,
password
);
}
...
...
@@ -595,7 +603,7 @@ public abstract class LDAPLoginModule extends FileLoginModule implements Loggabl
*/
private
ContextHandler
connectAndGetContext
()
throws
NamingException
{
// Create the initial directory context
return
createLdapContext
(
BIND_LOGIN
,
BIND_PASSWD
);
return
createLdapContext
(
BIND_LOGIN
,
BIND_PASSWD
,
false
);
}
/**
...
...
scheduler/scheduler-server/src/main/java/org/ow2/proactive/scheduler/core/SchedulerBackupRunner.java
View file @
ed98b88b
...
...
@@ -127,8 +127,7 @@ public class SchedulerBackupRunner implements Runnable {
File
backupFile
=
new
File
(
resolvedDestination
,
backupFileName
);
LOGGER
.
info
(
"Performing backup to "
+
backupFile
);
String
[]
foldersToZip
=
targets
.
stream
()
.
map
(
target
->
(
new
File
(
PASchedulerProperties
.
SCHEDULER_HOME
.
getValueAsString
(),
target
)).
getAbsolutePath
())
.
map
(
target
->
PASchedulerProperties
.
getAbsolutePath
(
target
))
.
toArray
(
String
[]::
new
);
LOGGER
.
info
(
"Backup of the following folders : "
+
Arrays
.
toString
(
foldersToZip
));
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment