tdb_chainlock() in tdb1, tdb2 and tdb_compat ?

Rusty Russell rusty at
Wed May 9 23:02:21 MDT 2012

On Thu, 12 Apr 2012 13:55:59 -0700, Jeremy Allison <jra at> wrote:
> > So hypothetical callers checking
> > 
> > if (tdb_chainlock(...) == -1) {
> > 	/* error path */
> > }
> > 
> > silently would become wrong.
> Ouch. This is a *BIG* API problem (IMHO). Any tdb_compat()
> layer has to provide *exact* tdb1 semantics or we're setting
> ourselves up for a world of pain with different semantics
> called from code that doesn't expect it.

Indeed, that's why I audited SAMBA for all such uses.  I have a patch
which does some very nasty things to check for such abuse.

The intent for tdb_compat was to be temporary, though it's lasted longer
than I'd hoped as we tried to make sure people could still select tdb1
if we broke things.


More information about the samba-technical mailing list