RFC: new testparam check

David Disseldorp ddiss at suse.de
Tue Apr 11 15:54:22 UTC 2017


Thanks Noel - The tests look good.
A couple of minor things I missed on the previous pass...
Feel free to add my reviewed-by tag to both patches after fixing.

On Tue, 11 Apr 2017 14:42:00 +0100, Noel Power via samba-technical wrote:

> diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
> index cedf8facb8d..f5f27990875 100644
> --- a/lib/param/loadparm.c
> +++ b/lib/param/loadparm.c
...
> +bool handle_name_resolve_order(struct loadparm_context *lp_ctx,
> +			       struct loadparm_service *service,
> +			       const char *pszParmValue, char **ptr)
> +{
> +	const char **valid_values =
> +			str_list_make_v3_const(NULL,
> +					       DEFAULT_NAME_RESOLVE_ORDER,
> +					       NULL);
> +	const char **values_to_set =
> +			str_list_make_v3_const(lp_ctx->globals->ctx,
> +					       pszParmValue,
> +					       NULL);

Please check for str_list_make_v3_const() allocation failures here.

...
> diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
> index 57220a64282..ccd37b1cc5e 100644
> --- a/source3/param/loadparm.c
> +++ b/source3/param/loadparm.c
> @@ -609,7 +609,10 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
>  	lpcfg_string_set(Globals.ctx, &Globals.logon_path,
>  			 "\\\\%N\\%U\\profile");
>  
> -	Globals.name_resolve_order = str_list_make_v3_const(NULL, "lmhosts wins host bcast", NULL);
> +	Globals.name_resolve_order =
> +			str_list_make_v3_const(NULL,
> +					       DEFAULT_NAME_RESOLVE_ORDER,
> +					       NULL);

This should use Globals.ctx as the talloc_ctx.

>  	lpcfg_string_set(Globals.ctx, &Globals.password_server, "*");
>  
>  	Globals.algorithmic_rid_base = BASE_RID;

Cheers, David



More information about the samba-technical mailing list