From 8113d53bb421217040a8184ba00f61308e8959d6 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 22 Jun 2012 09:44:41 +0930 Subject: util: ntdb_new() supports NTDB_CLEAR_IF_FIRST. There are various issues with NTDB_CLEAR_IF_FIRST which makes it better if we don't have to use it, but much of the code does, so we fake up support here. Signed-off-by: Rusty Russell --- lib/util/util_ntdb.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/util/util_ntdb.h') diff --git a/lib/util/util_ntdb.h b/lib/util/util_ntdb.h index a5eab7f436..d65d8b6f7b 100644 --- a/lib/util/util_ntdb.h +++ b/lib/util/util_ntdb.h @@ -27,6 +27,21 @@ struct loadparm_context; union ntdb_attribute; + +/* You only need this on databases with NTDB_CLEAR_IF_FIRST */ +int ntdb_reopen(struct ntdb_context *ntdb); + +/* You only need to do this if you have NTDB_CLEAR_IF_FIRST databases, and + * the parent will go away before this child. */ +int ntdb_reopen_all(void); + +/* + * This is like TDB_CLEAR_IF_FIRST, for use with ntdb_new. + * + * It's a bad idea for new code. + */ +#define NTDB_CLEAR_IF_FIRST 1048576 + /*************************************************************** Open an NTDB using talloc: it will be allocated off the context, and all NTDB_DATA.dptr are allocated as children of the ntdb context. -- cgit