andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 59bbc2f6c8fe8895bb1ccb90da9b5c25806c9320 Mon Sep 17 00:00:00 2001
dc8c34
From: Noriko Hosoi <nhosoi@redhat.com>
dc8c34
Date: Fri, 27 Sep 2013 11:23:42 -0700
dc8c34
Subject: [PATCH] Ticket #47534 - RUV tombstone search with scope "one" doesn`t
dc8c34
 work
dc8c34
dc8c34
Bug description: slapi_sdn_scope_test_ext examines the given dn
dc8c34
satisfies the scope against the base dn.  Onelevel case for the
dc8c34
tombstone DN ignores the nsuniqueid leaf rdn before checking the
dc8c34
scope which should not be done for the RUV tombstone.
dc8c34
dc8c34
Fix description: This patch correctly handles the RUV tombstone
dc8c34
as an exception.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/47534
dc8c34
dc8c34
Reviewed by rmeggins (Thanks, Rich!)
dc8c34
(cherry picked from commit fbece32d94515bc1ca3889c3d7c0691bbeec3ab0)
dc8c34
---
dc8c34
 ldap/servers/slapd/dn.c | 5 ++++-
dc8c34
 1 file changed, 4 insertions(+), 1 deletion(-)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
dc8c34
index dda439b..0f20d16 100644
dc8c34
--- a/ldap/servers/slapd/dn.c
dc8c34
+++ b/ldap/servers/slapd/dn.c
dc8c34
@@ -2537,7 +2537,10 @@ slapi_sdn_scope_test_ext( const Slapi_DN *dn, const Slapi_DN *base, int scope, i
dc8c34
         }
dc8c34
         break;
dc8c34
     case LDAP_SCOPE_ONELEVEL:
dc8c34
-        if (flags & SLAPI_ENTRY_FLAG_TOMBSTONE) {
dc8c34
+#define RUVRDN SLAPI_ATTR_UNIQUEID "=" RUV_STORAGE_ENTRY_UNIQUEID ","
dc8c34
+        if ((flags & SLAPI_ENTRY_FLAG_TOMBSTONE) &&
dc8c34
+            (strncmp(slapi_sdn_get_ndn(dn), RUVRDN, sizeof(RUVRDN) - 1))) {
dc8c34
+            /* tombstones except RUV tombstone */
dc8c34
             Slapi_DN parent;
dc8c34
             slapi_sdn_init(&parent);
dc8c34
             slapi_sdn_get_parent(dn, &parent);
dc8c34
-- 
dc8c34
1.8.1.4
dc8c34