mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-07 14:18:15 +08:00
Fix matchedDn detection
This commit is contained in:
parent
df05038f9e
commit
bb305eee0b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user