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