From e0f7d69896de43fcf28237bec7db0b5c4899ad07 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 5 Oct 2007 08:25:15 +0000 Subject: [PATCH] more about ITS#5168 --- servers/slapd/filter.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index d94a1ab47d..3216f7e466 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -32,6 +32,7 @@ #include #include "slap.h" +#include "lutil.h" static int get_filter_list( Operation *op, @@ -545,6 +546,7 @@ filter2bv_x( Operation *op, Filter *f, struct berval *fstr ) int i; Filter *p; struct berval tmp; + char uuid[ LDAP_LUTIL_UUIDSTR_BUFSIZE ]; static struct berval ber_bvfalse = BER_BVC( "(?=false)" ), ber_bvtrue = BER_BVC( "(?=true)" ), @@ -561,7 +563,14 @@ filter2bv_x( Operation *op, Filter *f, struct berval *fstr ) switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: - filter_escape_value_x( &f->f_av_value, &tmp, op->o_tmpmemctx ); + if ( f->f_av_desc->ad_type->sat_syntax == slap_schema.si_ad_entryUUID->ad_type->sat_syntax ) { + tmp.bv_len = lutil_uuidstr_from_normalized( f->f_av_value.bv_val, + f->f_av_value.bv_len, uuid, LDAP_LUTIL_UUIDSTR_BUFSIZE ); + assert( tmp.bv_len > 0 ); + tmp.bv_val = uuid; + } else { + filter_escape_value_x( &f->f_av_value, &tmp, op->o_tmpmemctx ); + } fstr->bv_len = f->f_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(=)") - 1 ); -- 2.47.2