From: Howard Chu Date: Tue, 10 Apr 2007 02:38:54 +0000 (+0000) Subject: Fix prev commit, filter construction with URI filters X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~536 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bfa0d158345bfd0d70e4003617d083716f5860a2;p=openldap Fix prev commit, filter construction with URI filters --- diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c index dd7c005143..5075d20db7 100644 --- a/servers/slapd/overlays/unique.c +++ b/servers/slapd/overlays/unique.c @@ -1139,12 +1139,12 @@ unique_modify( if ( !ks ) continue; if ( uri->filter && uri->filter->bv_len ) - ks += uri->filter->bv_len; - key = op->o_tmpalloc(ks, op->o_tmpmemctx); + ks += uri->filter->bv_len + STRLENOF ("(&)"); + kp = key = op->o_tmpalloc(ks, op->o_tmpmemctx); if ( uri->filter && uri->filter->bv_len ) - kp += sprintf ("(&(%s)", uri->filter->bv_val); - kp = key + sprintf(key, "(|"); + kp += sprintf (kp, "(&%s", uri->filter->bv_val); + kp += sprintf(kp, "(|"); for(m = op->orm_modlist; m; m = m->sml_next) if ( (m->sml_op & LDAP_MOD_OP) @@ -1256,12 +1256,12 @@ unique_modrdn( if ( !ks ) continue; if ( uri->filter && uri->filter->bv_len ) - ks += uri->filter->bv_len; - key = op->o_tmpalloc(ks, op->o_tmpmemctx); + ks += uri->filter->bv_len + STRLENOF ("(&)"); + kp = key = op->o_tmpalloc(ks, op->o_tmpmemctx); if ( uri->filter && uri->filter->bv_len ) - kp += sprintf ("(&(%s)", uri->filter->bv_val); - kp = key + sprintf(key, "(|"); + kp += sprintf (kp, "(&%s", uri->filter->bv_val); + kp += sprintf(kp, "(|"); for ( i=0; newrdn[i]; i++) { bv[0] = newrdn[i]->la_value;