From 7a85e25402fb188fe2d6b2ce36ea69548f6d7027 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 28 Aug 2005 14:50:41 +0000 Subject: [PATCH] prettify matchedDN --- servers/slapd/back-meta/compare.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-meta/compare.c b/servers/slapd/back-meta/compare.c index 0b5adf6b35..82d407fe73 100644 --- a/servers/slapd/back-meta/compare.c +++ b/servers/slapd/back-meta/compare.c @@ -289,13 +289,19 @@ finish:; * At least one compare failed with matched portion, * and none was successful */ - } else if ( match != NULL && match[0] != '\0' ) { - struct berval matched; + } else if ( match != NULL && match[ 0 ] != '\0' ) { + struct berval matched, pmatched; ber_str2bv( match, 0, 0, &matched ); dc.ctx = "matchedDN"; ldap_back_dn_massage( &dc, &matched, &mmatch ); + if ( dnPretty( NULL, &mmatch, &pmatched, NULL ) == LDAP_SUCCESS ) { + if ( mmatch.bv_val != match ) { + free( mmatch.bv_val ); + } + mmatch = pmatched; + } } if ( rres != LDAP_SUCCESS ) { -- 2.39.5