]> git.sur5r.net Git - openldap/commitdiff
Fix prev commit, return NULL if rewrite returns original DN
authorHoward Chu <hyc@openldap.org>
Mon, 21 Jun 2010 17:26:50 +0000 (17:26 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 21 Jun 2010 17:26:50 +0000 (17:26 +0000)
servers/slapd/syncrepl.c

index 2bba5fdef5dd4dd4a053a0cc7a5193f94362a68f..c39b14b2bfa3e8375fb1d908361f08fb3885c9c2 100644 (file)
@@ -1577,7 +1577,9 @@ syncrepl_rewrite_dn(
        rc = rewrite( si->si_rewrite, SUFFIXM_CTX, dn->bv_val, &sdn->bv_val );
        dn->bv_val[dn->bv_len] = nul;
 
-       if ( rc == REWRITE_REGEXEC_OK && sdn->bv_val )
+       if ( sdn->bv_val == dn->bv_val )
+               sdn->bv_val = NULL;
+       else if ( rc == REWRITE_REGEXEC_OK && sdn->bv_val )
                sdn->bv_len = strlen( sdn->bv_val );
        return rc;
 }