Blame SOURCES/jdk8275535-rh2053256-ldap_auth.patch

f190be
diff --git openjdk.orig/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java openjdk/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java
f190be
index cf4becb7db..4ab2ac0a31 100644
f190be
--- openjdk.orig/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java
f190be
+++ openjdk/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java
f190be
@@ -189,6 +189,10 @@ final public class LdapCtxFactory implements ObjectFactory, InitialContextFactor
f190be
                     ctx = getLdapCtxFromUrl(
f190be
                             r.getDomainName(), url, new LdapURL(u), env);
f190be
                     return ctx;
f190be
+                } catch (AuthenticationException e) {
f190be
+                    // do not retry on a different endpoint to avoid blocking
f190be
+                    // the user if authentication credentials are wrong.
f190be
+                    throw e;
f190be
                 } catch (NamingException e) {
f190be
                     // try the next element
f190be
                     lastException = e;
f190be
@@ -241,6 +245,10 @@ final public class LdapCtxFactory implements ObjectFactory, InitialContextFactor
f190be
         for (String u : urls) {
f190be
             try {
f190be
                 return getUsingURL(u, env);
f190be
+            } catch (AuthenticationException e) {
f190be
+                // do not retry on a different URL to avoid blocking
f190be
+                // the user if authentication credentials are wrong.
f190be
+                throw e;
f190be
             } catch (NamingException e) {
f190be
                 ex = e;
f190be
             }