diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-02-20 14:59:42 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-02-20 05:31:19 +0100 |
commit | e201033e84b54b13acc751db2b67cff159e12a0e (patch) | |
tree | db4bf7e6c250802dbb957b8fa8973697f475a2d0 /lib/tdb_wrap | |
parent | 53aac0bc9384db68c5ff469b07ae757ca1051cec (diff) | |
download | samba-e201033e84b54b13acc751db2b67cff159e12a0e.tar.gz samba-e201033e84b54b13acc751db2b67cff159e12a0e.tar.bz2 samba-e201033e84b54b13acc751db2b67cff159e12a0e.zip |
tdb_wrap: prevent tdbs called ".ntdb" or without extensions.
This is another belt-and-braces check in case someone decides to turn
on the fancy new .ntdb extension, and we haven't converted it to ntdb.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/tdb_wrap')
-rw-r--r-- | lib/tdb_wrap/tdb_wrap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/tdb_wrap/tdb_wrap.c b/lib/tdb_wrap/tdb_wrap.c index b96469d735..0f49be126c 100644 --- a/lib/tdb_wrap/tdb_wrap.c +++ b/lib/tdb_wrap/tdb_wrap.c @@ -23,6 +23,7 @@ #include "lib/util/dlinklist.h" #include "lib/tdb_wrap/tdb_wrap.h" #include "lib/param/param.h" +#include "ccan/str/str.h" /* Log tdb messages via DEBUG(). @@ -145,6 +146,13 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx, struct tdb_wrap *result; struct tdb_wrap_private *w; + /* If they specify a .ntdb extension, but the code hasn't been + * converted, we want to complain. */ + if (name && strends(name, ".ntdb")) { + DEBUG(2, ("tdb(%s): This code does not yet understand ntdb. Please report.\n", name)); + return NULL; + } + result = talloc(mem_ctx, struct tdb_wrap); if (result == NULL) { return NULL; |