[PATCH] Make loadparm more common

Andrew Bartlett abartlet at samba.org
Tue Apr 1 16:43:13 MDT 2014


On Tue, 2014-04-01 at 08:43 +0200, Volker Lendecke wrote:
> On Tue, Apr 01, 2014 at 05:21:02PM +1300, Andrew Bartlett wrote:
> > At this point, what I would like to see is these patches reviewed:
> > http://git.catalyst.net.nz/gitweb?p=samba.git;a=commitdiff;h=5fa1a3cd62e0dcefc5364f83046db025fc0e65b9
> 
> This has a talloc_zero(NULL,...). Would it be possible to
> use talloc_tos() here?

No, I'm not willing to add any more talloc_tos() to this area of the
code.  Almost all the odd unexpected failures caused by this patch set
were due to new talloc_tos() calls, because not all callers had a
talloc_stackframe().  

Additionally, it would have to be un-done again before the code is made
common later in the series, and we don't use talloc_tos() in the top
level code. 

> > http://git.catalyst.net.nz/gitweb?p=samba.git;a=commitdiff;h=909fb5a6c7df2e2cc7e48d5814eb2cff53ee6664
> 
> While in general a good direction, this one has the snippet
> 
> -                               SAFE_FREE(f->subfname);
> -                               f->subfname = SMB_STRDUP(n2);
> +                               TALLOC_FREE(f->subfname);
> +                               f->subfname = talloc_strdup(f, n2);
>                                 TALLOC_FREE(n2);
> 
> SMB_STRDUP panics on failure, talloc_strdup does not. So we
> need NULL checks in these scenarios. I haven't checked all
> places where this is done.

I'll get Garming to look at all these when he next comes in. 

> > http://git.catalyst.net.nz/gitweb?p=samba.git;a=commitdiff;h=5c9f5892c4e3304e2e3f11be0a41d087f9df6d9c
> 
> Obviously good. R-B me.

Thanks, I'll add that. 

> > http://git.catalyst.net.nz/gitweb?p=samba.git;a=commitdiff;h=746cbfcd93c38e5bb66e892fa2ef0d0d11888703
> 
> Just for simplicity, can we make it such that the equivalent
> piece of code in source3/param/loadparm.c looks exactly the
> same? If we touch the code, we should unify the code lines
> 1:1.

I'm a little confused, as that is what is being done here, but just
isn't all done in this commit.  Eventually they become identical, then
merge. 

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba






More information about the samba-technical mailing list