summaryrefslogtreecommitdiff
path: root/lib/dbwrap/dbwrap_tdb.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-06-22 15:07:43 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-06-22 07:35:17 +0200
commit9d97bf3f47a591a71e96cad8a87ef13a2b277c9c (patch)
treef78151ab3e9a9ea72f89f933652669035272ff88 /lib/dbwrap/dbwrap_tdb.c
parent1acf548eb75c9641e4e2c07167b42bc4380f9158 (diff)
downloadsamba-9d97bf3f47a591a71e96cad8a87ef13a2b277c9c.tar.gz
samba-9d97bf3f47a591a71e96cad8a87ef13a2b277c9c.tar.bz2
samba-9d97bf3f47a591a71e96cad8a87ef13a2b277c9c.zip
dbwrap: dbwrap_local_open()
This simply opens a tdb: it will eventually switch depending on the extension. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/dbwrap/dbwrap_tdb.c')
-rw-r--r--lib/dbwrap/dbwrap_tdb.c7
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"));