diff options
Diffstat (limited to 'lib/dbwrap/dbwrap_tdb.c')
-rw-r--r-- | lib/dbwrap/dbwrap_tdb.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c index ece7b9d8b5..1452ff7e8a 100644 --- a/lib/dbwrap/dbwrap_tdb.c +++ b/lib/dbwrap/dbwrap_tdb.c @@ -24,6 +24,7 @@ #include "lib/tdb_wrap/tdb_wrap.h" #include "lib/util/util_tdb.h" #include "system/filesys.h" +#include "ccan/str/str.h" struct db_tdb_ctx { struct tdb_wrap *wtdb; @@ -385,6 +386,12 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, struct db_tdb_ctx *db_tdb; struct stat st; + /* Extra paranoia. */ + if (name && strends(name, ".ntdb")) { + DEBUG(0, ("can't try to open %s with tdb!\n", name)); + return NULL; + } + result = talloc_zero(mem_ctx, struct db_context); if (result == NULL) { DEBUG(0, ("talloc failed\n")); |