diff options
-rw-r--r-- | ldap/servers/slapd/plugin_internal_op.c | 6 | ||||
-rw-r--r-- | ldap/servers/slapd/psearch.c | 5 | ||||
-rw-r--r-- | ldap/servers/slapd/search.c | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/ldap/servers/slapd/plugin_internal_op.c b/ldap/servers/slapd/plugin_internal_op.c index 63a46e1b..c73d0d79 100644 --- a/ldap/servers/slapd/plugin_internal_op.c +++ b/ldap/servers/slapd/plugin_internal_op.c @@ -458,6 +458,7 @@ slapi_free_search_results_internal(Slapi_PBlock *pb) For dn based search: SLAPI_TARGET_DN set to search base + SLAPI_ORIGINAL_TARGET_DN set to original un-normalized search base SLAPI_SEARCH_SCOPE set to search scope SLAPI_SEARCH_STRFILTER set to search filter SLAPI_CONTROLS_ARG set to request controls if present @@ -717,6 +718,7 @@ static int search_internal_callback_pb (Slapi_PBlock *pb, void *callback_data, * changed base search strings */ slapi_pblock_get(pb, SLAPI_SEARCH_TARGET, &original_base); + slapi_pblock_set(pb, SLAPI_ORIGINAL_TARGET_DN, slapi_ch_strdup(original_base)); op_shared_search (pb, 1); @@ -733,6 +735,10 @@ done: if(original_base != new_base) slapi_ch_free((void**)new_base); + /* we strdup'd this above - need to free */ + slapi_pblock_get(pb, SLAPI_ORIGINAL_TARGET_DN, &original_base); + slapi_ch_free_string(&original_base); + return(rc); } diff --git a/ldap/servers/slapd/psearch.c b/ldap/servers/slapd/psearch.c index f1df43a6..d7b89495 100644 --- a/ldap/servers/slapd/psearch.c +++ b/ldap/servers/slapd/psearch.c @@ -360,6 +360,11 @@ ps_send_results( void *arg ) slapi_pblock_set( ps->ps_pblock, SLAPI_SEARCH_TARGET, NULL ); slapi_ch_free_string(&base); + /* we strdup'd this in search.c - need to free */ + slapi_pblock_get( ps->ps_pblock, SLAPI_ORIGINAL_TARGET_DN, &base ); + slapi_pblock_set( ps->ps_pblock, SLAPI_ORIGINAL_TARGET_DN, NULL ); + slapi_ch_free_string(&base); + slapi_pblock_get( ps->ps_pblock, SLAPI_SEARCH_STRFILTER, &fstr ); slapi_pblock_set( ps->ps_pblock, SLAPI_SEARCH_STRFILTER, NULL ); slapi_ch_free_string(&fstr); diff --git a/ldap/servers/slapd/search.c b/ldap/servers/slapd/search.c index 471d3157..c8210158 100644 --- a/ldap/servers/slapd/search.c +++ b/ldap/servers/slapd/search.c @@ -224,6 +224,7 @@ do_search( Slapi_PBlock *pb ) } slapi_pblock_set( pb, SLAPI_SEARCH_TARGET, base ); + slapi_pblock_set( pb, SLAPI_ORIGINAL_TARGET_DN, slapi_ch_strdup(base) ); slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, &scope ); slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, &deref ); slapi_pblock_set( pb, SLAPI_SEARCH_FILTER, filter ); @@ -269,6 +270,9 @@ free_and_return:; if (psearch){ operation->o_flags &= ~OP_FLAG_PS; } + /* we strdup'd this above - need to free */ + slapi_pblock_get(pb, SLAPI_ORIGINAL_TARGET_DN, &base); + slapi_ch_free_string(&base); } } |