[389-commits] Branch '389-ds-base-1.3.1' - ldap/servers

Noriko Hosoi nhosoi at fedoraproject.org
Sat Jun 28 00:42:57 UTC 2014


 ldap/servers/slapd/util.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 2f3852fea43efde5994b3805d65cf2fc80210d73
Author: Noriko Hosoi <nhosoi at redhat.com>
Date:   Fri Jun 27 12:51:30 2014 -0700

    Ticket #47750 - Creating a glue fails if one above level is a conflict or missing
    
    Bug description: https://fedorahosted.org/389/ticket/47750#comment:16
    
    Fix description: The logic in slapi_is_special_rdn to check if the
    RDN is a tombstone or not had a problem.  Even if the first part of
    RDN is not nsuniqueid=<UNIQUE_ID>, it was returning true.  In this
    patch, code to check the case is added and it returns false if the
    first part of RDN is not  nsuniqueid=<UNIQUE_ID>.
    
    Reviewed by mreynolds at redhat.com and rmeggins at redhat.com (Thank you,
    Mark and Rich!!)
    (cherry picked from commit 286559dac7a968faa0102f0165ba56892795b269)
    (cherry picked from commit 36b883082265a2a5b2c818c0f7ce93e97ee55672)

diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 880700c..e6c20dc 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -1436,7 +1436,7 @@ slapi_is_special_rdn(const char *rdn, int flag)
 	}
 	rp = (char *)rdn;
 	while (rp) {
-		char *comma = NULL;
+		char *endp = NULL;
 		if (!PL_strncasecmp(rp, SLAPI_ATTR_UNIQUEID, SLAPI_ATTR_UNIQUEID_LENGTH) &&
 		    (*(rp + SLAPI_ATTR_UNIQUEID_LENGTH) == '=')) {
 			if (RDN_IS_TOMBSTONE == flag) {
@@ -1453,10 +1453,17 @@ slapi_is_special_rdn(const char *rdn, int flag)
 					return 1;
 				}
 			}
+		} else if (RDN_IS_TOMBSTONE == flag) {
+			/* If the first part of rdn does not start with SLAPI_ATTR_UNIQUEID,
+			 * it's not a tombstone RDN. */
+			return 0;
+		}
+		endp = PL_strchr(rp, ',');
+		if (!endp) {
+			endp = rp + strlen(rp);
 		}
-		comma = PL_strchr(rp, ',');
 		rp = PL_strchr(rp, '+');
-		if (rp && (rp < comma)) {
+		if (rp && (rp < endp)) {
 			plus = 1;
 			rp++;
 		}




More information about the 389-commits mailing list