[PATCH] winbind msrpc query_user_list should return OK instead of NO_MEMORY

Jeremy Allison jra at samba.org
Wed Nov 2 22:11:04 UTC 2016


On Wed, Nov 02, 2016 at 05:23:06PM +0100, Andreas Schneider wrote:
> Hi,
> 
> the attached patch fixes https://bugzilla.samba.org/show_bug.cgi?id=12405
> 
> 
> Review and push appreciated!

Looks correct - pushed. Thanks !

Jeremy.

> 	Andreas
> 
> -- 
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             asn at samba.org
> www.samba.org

> From 7eaccfdfcf16d8a7915a6bbe9721aa6eb6d5a0e7 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <asn at samba.org>
> Date: Wed, 2 Nov 2016 17:19:09 +0100
> Subject: [PATCH] s3-winbind: Do not return NO_MEMORY if we have an empty user
>  list
> 
> The domain child for the MACHINE ACCOUNT might fail with
> NT_STATUS_NO_MEMORY because an emtpy user list is returned.
> 
> *pnum_info is already set to 0 at the beginngin so we should just
> declare victory here!
> 
> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12405
> 
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  source3/winbindd/winbindd_rpc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
> index 386396a..7b355ba 100644
> --- a/source3/winbindd/winbindd_rpc.c
> +++ b/source3/winbindd/winbindd_rpc.c
> @@ -88,6 +88,10 @@ NTSTATUS rpc_query_user_list(TALLOC_CTX *mem_ctx,
>  		num_dom_users = disp_info.info1.count;
>  
>  		num_info += num_dom_users;
> +		/* If there are no user to enumerate we're done */
> +		if (num_info == 0) {
> +			return NT_STATUS_OK;
> +		}
>  
>  		info = talloc_realloc(mem_ctx,
>  					    info,
> -- 
> 2.10.1
> 




More information about the samba-technical mailing list