[PATCH] make schannel.tdb TDB_CLEAR_IF_FIRST

Jeremy Allison jra at samba.org
Fri Jun 25 13:44:40 MDT 2010


On Thu, Jun 24, 2010 at 09:22:53AM +1000, Andrew Bartlett wrote:
> On Wed, 2010-06-23 at 14:26 +1000, Andrew Bartlett wrote:
> > On Tue, 2010-06-15 at 10:06 +1000, Andrew Bartlett wrote: 
> > > On Mon, 2010-06-14 at 21:00 +0200, Volker Lendecke wrote:
> > > > On Mon, Jun 14, 2010 at 02:14:09PM -0400, simo wrote:
> > > > > Looks like the other way around AFAIK.
> > > > > You use always TDB_CLEAR_IF_FIRST and just make sure you open (and keep
> > > > > open) the TDB in main(). So the main() one is always the first and
> > > > > always cleans the TDB on restart, while any other caller cannot clear it
> > > > > because it is not the "first" (does not have the lock).
> > > > 
> > > > Please watch out -- we have a little different semantics in
> > > > Samba3. If you want to use CLEAR_IF_FIRST, make sure you
> > > > have it already open in the parent, see for example
> > > > 4cdbe07b2563.
> > > 
> > > Thanks, that is *exactly* the kind of example I needed.  I'll knock up a
> > > patch and post it here for review.  
> 
> Attached again is my proposed set of changes.  They pass 'make test' in
> Samba3 and Samba4, and I've manually verified that the
> TDB_CLEAR_IF_FIRST behaviour is applied correctly (by inspection with
> tdbdump while conduction schannel operations against Samba3)
> 
> I think I've followed the pattern given above correctly.  If someone
> could please push/review/comment I would very much appreciate it. 

Reviewed and pushed (I only added one change after the
fact to change using talloc_autofree_context() to use
talloc stackframe in the S3 code as I've had issues
with talloc objects with destructors causing problems
when fork'ed children exit).

Thanks Andrew !

Jeremy.


More information about the samba-technical mailing list