svn commit: samba r23290 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_26/source/nsswitch

Michael Adam ma at sernet.de
Fri Jun 1 23:01:39 GMT 2007


On Fri, Jun 01, 2007 at 03:21:30PM -0700, Jeremy Allison wrote:
> On Fri, Jun 01, 2007 at 12:18:17PM +0000, obnox at samba.org wrote:
> > Author: obnox
> > Date: 2007-06-01 12:18:16 +0000 (Fri, 01 Jun 2007)
> > New Revision: 23290
> > 
> > WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23290
> > 
> > Changeset:
> > Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
> > ===================================================================
> > --- branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c	2007-06-01 12:01:53 UTC (rev 23289)
> > +++ branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c	2007-06-01 12:18:16 UTC (rev 23290)
> > @@ -1054,7 +1054,7 @@
> >  				{
> >  					sid_copy(&(*sid_mem)[*num_names],
> >  						 &sid_mem_nocache[i]);
> > -					(*names)[*num_names] = talloc_move(names, &names_nocache[i]);
> > +					(*names)[*num_names] = talloc_move(*names, &names_nocache[i]);
> >  					(*name_types)[*num_names] = name_types_nocache[i];
> >  					(*num_names)++;
> >  				}
> 
> Hmmm. I'd probably change "*names" to mem_ctx, there's no
> real need for a heirarchy here, right ? You just want to
> make sure both "names" and "(*names)[*num_names]" are
> allocated from the passed in mem_ctx, correct ?

Correct. What is the benefit of using mem_ctx?

Volker told me a couple of days ago that the using the
array as parent context for talloc'ing entries is the
most natural thing.

Maybe using mem_ctx, when the heirarchy is not needed,
is more obvious that it the argument is treated as a talloc 
context? (in this case I _know_ I have talloced the array,
so i can safely use it as a talloc contecxt). What else? 
Is it better (with respect to the administrative efforts) 
to keep the hierarchy flat?

Any enlightenment appreciated!

Michael

-- 
Michael Adam <ma at sernet.de>
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.SerNet.DE, mailto: Info @ SerNet.DE


More information about the samba-technical mailing list