]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/unique.c
ITS#5710 fix stupid updateCookie hack, use explicit o_dont_replicate flag
[openldap] / servers / slapd / overlays / unique.c
index 0f6479b2a732aa829b88bbeedfdb938b115f478f..4a17e5a25652660381b6e4df06ed123b1febce22 100644 (file)
@@ -197,6 +197,15 @@ unique_new_domain_uri ( unique_domain_uri **urip,
                        goto exit;
                }
 
+               if ( be->be_nsuffix == NULL ) {
+                       snprintf( c->cr_msg, sizeof( c->cr_msg ),
+                                 "suffix must be set" );
+                       Debug ( LDAP_DEBUG_CONFIG, "unique config: %s\n",
+                               c->cr_msg, NULL, NULL );
+                       rc = ARG_BAD_CONF;
+                       goto exit;
+               }
+
                if ( !dnIsSuffix ( &uri->ndn, &be->be_nsuffix[0] ) ) {
                        snprintf( c->cr_msg, sizeof( c->cr_msg ),
                                  "dn <%s> is not a suffix of backend base dn <%s>",
@@ -973,7 +982,7 @@ unique_search(
        unique_counter uq = { NULL, 0 };
        int rc;
 
-       Debug(LDAP_DEBUG_TRACE, "==> unique_search %s\n", key, 0, 0);
+       Debug(LDAP_DEBUG_TRACE, "==> unique_search %s\n", key->bv_val, 0, 0);
 
        nop->ors_filter = str2filter_x(nop, key->bv_val);
        if(nop->ors_filter == NULL) {
@@ -1004,7 +1013,7 @@ unique_search(
 
        nop->o_bd = on->on_info->oi_origdb;
        rc = nop->o_bd->be_search(nop, &nrs);
-       filter_free_x(nop, nop->ors_filter);
+       filter_free_x(nop, nop->ors_filter, 1);
        op->o_tmpfree( key->bv_val, op->o_tmpmemctx );
 
        if(rc != LDAP_SUCCESS && rc != LDAP_NO_SUCH_OBJECT) {