summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/dbwrap/dbwrap_local_open.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/dbwrap/dbwrap_local_open.c b/lib/dbwrap/dbwrap_local_open.c
index 87c7c68418..c2eb7b73ee 100644
--- a/lib/dbwrap/dbwrap_local_open.c
+++ b/lib/dbwrap/dbwrap_local_open.c
@@ -214,6 +214,11 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
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);