[PATCH] Cleanups and parallel idmap_script

Michael Adam obnox at samba.org
Tue Feb 23 18:13:04 UTC 2016


On 2016-02-23 at 15:14 +0100, Volker Lendecke wrote:
> Hi!
> 
> Attached find a patchset that holds a few cleanups plus idmap_script
> parallelized. Greatly boosts performance for many groups at login
> time.
> 
> Review appreciated!

Great cleanup and another great demonstration
of tevent_req programming.

Pushed to autobuild with two tiny fixes:

> From d83087478a8353b504c7164122278cf7d0679e1d Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Wed, 17 Feb 2016 14:01:47 +0100
> Subject: [PATCH 12/12] idmap_script: Parallelize script calls
> 
> Fixes a case I've seen where a user with 200 group memberships timed out and
> can now log in.
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source3/winbindd/idmap_script.c | 622 ++++++++++++++++++++++++++++------------
>  1 file changed, 434 insertions(+), 188 deletions(-)
> 
> diff --git a/source3/winbindd/idmap_script.c b/source3/winbindd/idmap_script.c
> index a929d6e..81603eb 100644
> --- a/source3/winbindd/idmap_script.c
> +++ b/source3/winbindd/idmap_script.c
> 
>  static NTSTATUS idmap_script_unixids_to_sids(struct idmap_domain *dom,
> -				      struct id_map **ids)
> +					     struct id_map **ids)
>  {
> -	NTSTATUS ret;
> -	int i, num_mapped = 0;
> +	struct idmap_script_context *ctx = talloc_get_type_abort(
> +		dom->private_data, struct idmap_script_context);
> +	int ret;
> +	size_t i, num_ids, num_mapped;
>  
>  	DEBUG(10, ("%s called ...\n", __func__));
>  	/* Init status to avoid surprise ... */
>  	for (i = 0; ids[i]; i++) {
>  		ids[i]->status = ID_UNKNOWN;
>  	}
> +	num_ids = i;
> +
> +	ret = idmap_script_xids2sids(ids, num_ids, ctx->script);
> +	if (ret != 0) {
> +		DBG_DEBUG("idmap_script_sids2xids returned %s\n",
> +			  strerror(ret));

I fixed this dbg msg typo.

And I added  #include "system/filesys.h" to
source3/lib/sys_popen.c -- pipe() was no known.

Cheers - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160223/c5004258/signature.sig>


More information about the samba-technical mailing list