This provides an extra safety check that everyone is using one or the
other: you can't create a tdb file if there's an ntdb file.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
ntdb_flags, open_flags, mode, lock_order);
#endif
} else {
+ if (!streq(ntdbname, tdbname) && file_exist(ntdbname)) {
+ DEBUG(0, ("Refusing to open '%s' when '%s' exists\n",
+ tdbname, ntdbname));
+ goto out;
+ }
db = db_open_tdb(mem_ctx, lp_ctx, tdbname, hash_size,
tdb_flags, open_flags, mode,
lock_order);