Commit bb305eee authored by Howard Chu's avatar Howard Chu
Browse files

Fix matchedDn detection

parent df05038f
......@@ -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
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment