From bfa0d158345bfd0d70e4003617d083716f5860a2 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 10 Apr 2007 02:38:54 +0000 Subject: [PATCH] Fix prev commit, filter construction with URI filters --- servers/slapd/overlays/unique.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; -- 2.39.5