[PATCH] Allow to drop tldap search messages

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Allow to drop tldap search messages

Samba - samba-technical mailing list
Hi!

Review appreciated!

Thanks, Volker

patch.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Allow to drop tldap search messages

Samba - samba-technical mailing list
On Fri, Mar 17, 2017 at 06:09:59AM +0100, Volker Lendecke via samba-technical wrote:
> Hi!
>
> Review appreciated!

LGTM. Pushed !

> From fd34b4d2d7ad6a356111b1581653e141cb5c1517 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <[hidden email]>
> Date: Fri, 27 Jan 2017 16:03:03 +0100
> Subject: [PATCH] tldap: Allow dropping messages in tldap_search()
>
> For probing whether a connection is a live a rootdse search might be
> interesting where we don't really care for the result, only success or
> failure of the operation.
>
> Signed-off-by: Volker Lendecke <[hidden email]>
> ---
>  source3/lib/tldap.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
> index 5fcb43c..40064fd 100644
> --- a/source3/lib/tldap.c
> +++ b/source3/lib/tldap.c
> @@ -1995,7 +1995,7 @@ TLDAPRC tldap_search(struct tldap_context *ld,
>   rc = TLDAP_OPERATIONS_ERROR;
>   goto fail;
>   }
> - rc = tldap_search_all_recv(req, mem_ctx, &msgs, &result);
> + rc = tldap_search_all_recv(req, frame, &msgs, &result);
>   TALLOC_FREE(req);
>   if (!TLDAP_RC_IS_SUCCESS(rc)) {
>   goto fail;
> @@ -2004,7 +2004,9 @@ TLDAPRC tldap_search(struct tldap_context *ld,
>   TALLOC_FREE(ld->last_msg);
>   ld->last_msg = talloc_move(ld, &result);
>  
> - *pmsgs = msgs;
> + if (pmsgs != NULL) {
> + *pmsgs = talloc_move(mem_ctx, &msgs);
> + }
>  fail:
>   TALLOC_FREE(frame);
>   return rc;
> --
> 1.9.1
>