RFR: [PATCH] 8176553 Fix LDAP referral loop

Jan Kalina jkalina at redhat.com
Wed Apr 4 15:29:51 UTC 2018


Note: Test is not included, as it would require running LDAP server.
(existing ldap tests in JDK use only mocks of the server)

The patch was manually verified using reproducer attached to issue.

On Wed, Apr 4, 2018 at 4:12 PM, Jan Kalina <jkalina at redhat.com> wrote:
> Hi,
> I has prepared trivial patch for bug JDK-8176553,
> which I would like to get reviewed and sponsored.
>
> I am covered by Red Hat OCA.
>
> The bug affects upstream, JDK9 and JDK8 too.
>
> The reproducer is available in issue tracker:
> https://bugs.openjdk.java.net/browse/JDK-8176553
>
> PATCH:
> ----------------------------------------------
> diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
> b/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
> --- a/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
> +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
> @@ -312,7 +312,8 @@
>
>          if ((refEx != null) &&
>              (refEx.hasMoreReferrals() ||
> -             refEx.hasMoreReferralExceptions())) {
> +             refEx.hasMoreReferralExceptions()) &&
> +             ! (errEx instanceof LimitExceededException)) {
>
>              if (homeCtx.handleReferrals == LdapClient.LDAP_REF_THROW) {
>                  throw (NamingException)(refEx.fillInStackTrace());
> ----------------------------------------------
>
> Thanks,
> Jan Kalina


More information about the core-libs-dev mailing list