From d43280075fcbb93992d7316a06be022fd7874b8c Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 14 Mar 2007 20:01:57 +0000
Subject: [PATCH] Update the schema and memory backends so that they will properly set the matched DN field in the response if the backend doesn't have the entry specified as the search base DN but does have an ancestor for that entry.
---
opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java b/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
index 7825ab9..7a8034f 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
@@ -4078,6 +4078,7 @@
boolean found = false;
DN[] dnArray = baseDNs;
+ DN matchedDN = null;
for (DN dn : dnArray)
{
if (dn.equals(baseDN))
@@ -4085,6 +4086,11 @@
found = true;
break;
}
+ else if (dn.isAncestorOf(baseDN))
+ {
+ matchedDN = dn;
+ break;
+ }
}
if (! found)
@@ -4093,7 +4099,8 @@
String message = getMessage(msgID, searchOperation.getConnectionID(),
searchOperation.getOperationID(),
String.valueOf(baseDN));
- throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, message, msgID);
+ throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, message, msgID,
+ matchedDN, null);
}
--
Gitblit v1.10.0