Fix matchedDn detection

This commit is contained in:
Howard Chu 2003-04-07 10:51:57 +00:00
parent df05038f9e
commit bb305eee0b
2 changed files with 7 additions and 6 deletions

View File

@ -317,7 +317,7 @@ fail:;
/*
* Rewrite the matched portion of the search base, if required
*/
if ( match != NULL ) {
if ( match && *match ) {
struct berval dn, mdn;
#ifdef ENABLE_REWRITE

View File

@ -92,12 +92,12 @@ ldap_back_dn_massage(
int
ldap_back_dn_massage(
dncookie *dc,
struct berval *dn,
struct berval *odn,
struct berval *res
)
{
int i, src, dst;
struct berval pretty = {0,NULL};
struct berval pretty = {0,NULL}, *dn = odn;
assert( res );
@ -157,13 +157,14 @@ ldap_back_dn_massage(
break;
}
}
if (pretty.bv_val) {
ch_free(pretty.bv_val);
dn = odn;
}
/* Nothing matched, just return the original DN */
if (res->bv_val == NULL) {
*res = *dn;
}
if (pretty.bv_val) {
ch_free(pretty.bv_val);
}
return 0;
}