mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

lutoff
16.49.2009 492e4c56535090cff7af1f0b67e202d770ac56b0
Fix for issue #3714 (ldapsearch should return exit code 10 when it receives a referral)
If a referral is returned, we now return 10.

1 files modified
27 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java 27 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java
@@ -366,7 +366,7 @@
                break;
            }
            if(resultCode != SUCCESS && resultCode != REFERRAL)
            if(resultCode != SUCCESS)
            {
              Message msg = INFO_OPERATION_FAILED.get("SEARCH");
              throw new LDAPException(resultCode, errorMessage, msg,
@@ -1761,17 +1761,22 @@
    } catch(LDAPException le)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, le);
      }
      LDAPToolUtils.printErrorMessage(err,
                                      le.getMessageObject(),
                                      le.getResultCode(),
                                      le.getErrorMessage(),
                                      le.getMatchedDN());
      int code = le.getResultCode();
      if (code == REFERRAL)
      {
        out.println();
        out.println(wrapText(le.getErrorMessage(), MAX_LINE_WIDTH));
      }
      else
      {
      if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, le);
        }
        LDAPToolUtils.printErrorMessage(err, le.getMessageObject(), code,
            le.getErrorMessage(), le.getMatchedDN());
      }
      return code;
    } catch(LDAPConnectionException lce)
    {