RFC: new testparam check

Noel Power nopower at suse.com
Tue Apr 11 16:33:19 UTC 2017


Hi Dave
See attached, please check if you are happy (and I added yours an
Andreas RB) Other than your changes I added the missing '=' to the test
names for completeness as I was making changes

Noel
On 11/04/17 16:54, David Disseldorp via samba-technical wrote:
> 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
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s3-script-tests-Test-for-illegal-value-detection-for.patch
Type: text/x-diff
Size: 1798 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170411/b82c15e7/0002-s3-script-tests-Test-for-illegal-value-detection-for.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Check-for-valid-values-for-global-conf-name-resolve-.patch
Type: text/x-diff
Size: 5012 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170411/b82c15e7/0001-Check-for-valid-values-for-global-conf-name-resolve-.diff>


More information about the samba-technical mailing list