Blame SOURCES/jdk8275535-rh2053256-ldap_auth.patch
|
|
97e098 |
diff --git openjdk.orig/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java openjdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java
|
|
|
97e098 |
index 300f3682655..6f3eb6c450b 100644
|
|
|
97e098 |
--- openjdk.orig/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java
|
|
|
97e098 |
+++ openjdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java
|
|
|
97e098 |
@@ -226,6 +226,10 @@ final public class LdapCtxFactory implements ObjectFactory, InitialContextFactor
|
|
|
97e098 |
ctx = getLdapCtxFromUrl(
|
|
|
97e098 |
r.getDomainName(), url, new LdapURL(u), env);
|
|
|
97e098 |
return ctx;
|
|
|
97e098 |
+ } catch (AuthenticationException e) {
|
|
|
97e098 |
+ // do not retry on a different endpoint to avoid blocking
|
|
|
97e098 |
+ // the user if authentication credentials are wrong.
|
|
|
97e098 |
+ throw e;
|
|
|
97e098 |
} catch (NamingException e) {
|
|
|
97e098 |
// try the next element
|
|
|
97e098 |
lastException = e;
|
|
|
97e098 |
@@ -278,6 +282,10 @@ final public class LdapCtxFactory implements ObjectFactory, InitialContextFactor
|
|
|
97e098 |
for (String u : urls) {
|
|
|
97e098 |
try {
|
|
|
97e098 |
return getUsingURL(u, env);
|
|
|
97e098 |
+ } catch (AuthenticationException e) {
|
|
|
97e098 |
+ // do not retry on a different URL to avoid blocking
|
|
|
97e098 |
+ // the user if authentication credentials are wrong.
|
|
|
97e098 |
+ throw e;
|
|
|
97e098 |
} catch (NamingException e) {
|
|
|
97e098 |
ex = e;
|
|
|
97e098 |
}
|