Blame SOURCES/jdk8275535-rh2053256-ldap_auth.patch

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