[PATCH] Handle non-constant strings properly and share the param_globals structure

Andreas Schneider asn at samba.org
Thu Feb 20 10:17:29 MST 2014


On Friday 14 February 2014 13:26:46 Garming Sam wrote:
> Hi,

Hi Garming,
 
> So the attached patches are some of the work I've been doing on loadparm.
> 
> The lib/param code has been changed to handle non-constant strings
> correctly. This involved changing the code to pass down a memory context
> in certain parts of the code.
> 
> We can now use the same globals structure across the two loadparms,
> eliminating the need to call lp_functions from the lib/param code. By
> doing this, it means that we no longer need to dynamically generate the
> s3_param.h file and loadparm_ctx_table and they have now been removed.
> 
> Also included is a couple suggested tidyups.
> 

In the first patch, please change NULL pointer checks like:

if (!ntvfs->ctx->fs_type) {

to

if (ntvfs->ctx->fs_type == NULL) {


In several locations it is already correct :)

Could you please fix them?


Instead of adding TALLOC_FREE(tmp_ctx) everywhere, I would like to have

NTSTATUS myfunc()
{
	NTSTATUS status = NT_STATUS_UNSUCCESSFUL;

...

	if (something wrong) {
		status = NT_STATUS_NO_MEMORY;
		goto out;
	}

...

	status = NT_STATUS_OK;
out:
	talloc_free(tmp_ctx);

	return status;
}

The other patches look quite good.


Best regards,




	-- andreas

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



More information about the samba-technical mailing list