From fb41dfb77ff8b7822befcfb877e84ccdf06ab830 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 21 Sep 2011 12:58:59 +0930 Subject: tdb_compat: add "TDB_COMPAT_USE_TDB2" environment variable When BUILD_TDB2 is defined, add TDB_VERSION1 flag to all tdb_open() calls, unless this flag is set. This means we use the tdb1 on-disk format unless the user specifically asks for tdb2. We'd love to do this using loadparm, but we need to work with both Samba 3 and Samba 4's loadparm, and they're not unified yet. Signed-off-by: Rusty Russell --- lib/tdb_compat/tdb_compat.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/tdb_compat') diff --git a/lib/tdb_compat/tdb_compat.c b/lib/tdb_compat/tdb_compat.c index d5d8f09c64..b37e6cc7ba 100644 --- a/lib/tdb_compat/tdb_compat.c +++ b/lib/tdb_compat/tdb_compat.c @@ -96,6 +96,10 @@ tdb_open_compat_(const char *name, int hash_size, { union tdb_attribute cif, log, hash, max_dead, hsize, *attr = NULL; + if (!getenv("TDB_COMPAT_USE_TDB2")) { + tdb_flags |= TDB_VERSION1; + } + if (log_fn) { log.log.base.attr = TDB_ATTRIBUTE_LOG; log.log.base.next = NULL; -- cgit