From 4371795418de3f7908de0a4dfc4a05707d28fb38 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Tue, 14 Apr 2009 09:30:13 +0000
Subject: [PATCH] Fix issue 3638 - Referrals not properly managed for bind operations

---
 opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
index 666173a..bd7b9b7 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
@@ -545,8 +545,20 @@
         }
 
         userEntry = null;
-        throw new DirectoryException(ResultCode.INVALID_CREDENTIALS,
-                                     de.getMessageObject());
+
+        if (de.getResultCode() == ResultCode.REFERRAL)
+        {
+          // Re-throw referral exceptions - these should be passed back
+          // to the client.
+          throw de;
+        }
+        else
+        {
+          // Replace other exceptions in case they expose any sensitive
+          // information.
+          throw new DirectoryException(ResultCode.INVALID_CREDENTIALS,
+              de.getMessageObject());
+        }
       }
 
       if (userEntry == null)

--
Gitblit v1.10.0