[PATCH] lib/tdb: TDB_ALLOW_NESTING flag (port from ctdb)

Stefan (metze) Metzmacher metze at samba.org
Mon Aug 17 03:08:15 MDT 2009


Rusty Russell schrieb:
> Ported from ctdb change 3e49e41c21eb8c53084aa8cc7fd3557bdd8eb7b6
> ("New attempt at TDB transaction nesting allow/disallow").
> 
> Unfortunately, this is an API change if you were using nested transactions.
> I've added the flag where needed to make quicktest (source4) and test
> (source3) pass again.
> 
> As a general rule, nested transactions are dangerous: if you don't know you're
> nesting, you can do a tdb_transaction_commit() which "succeeds", then gets
> wiped by a crash, close, or outer tdb_transaction_cancel().
> 
> Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

The real problem is that this causes problems with existing applications
and we need to change the tdb library version...

Also the patch should be split up into a tdb patch and multiple patches
for the callers.

metze
> ---
>  lib/tdb/common/transaction.c      |   11 +++++++++++
>  lib/tdb/include/tdb.h             |    4 +++-
>  source3/include/reg_db.h          |    2 +-
>  source3/lib/account_pol.c         |    4 ++--
>  source3/lib/ldb/ldb_tdb/ldb_tdb.c |    1 +
>  source3/passdb/secrets.c          |    2 +-
>  source4/lib/ldb/ldb_tdb/ldb_tdb.c |    2 +-
>  7 files changed, 20 insertions(+), 6 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20090817/f9b197e5/attachment.pgp>


More information about the samba-technical mailing list