[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) {


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()


	if (something wrong) {
		goto out;


	status = NT_STATUS_OK;

	return status;

The other patches look quite good.

Best regards,

	-- andreas

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

More information about the samba-technical mailing list