summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-08-16 14:43:29 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:55 +0200
commit97fef0c2fd7dc622bb11cfc374e88f82b77086cf (patch)
tree79e39ffeda3fa5f13838726ed9b5a310cacc0376 /source3/lib
parent3dc607c0c6f5b22c95aa88b334f9c0cd2dc8f226 (diff)
downloadsamba-97fef0c2fd7dc622bb11cfc374e88f82b77086cf.tar.gz
samba-97fef0c2fd7dc622bb11cfc374e88f82b77086cf.tar.bz2
samba-97fef0c2fd7dc622bb11cfc374e88f82b77086cf.zip
s3:dbwrap: add specific dbwrap_wipe() implementation to dbwrap_tdb
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap/dbwrap_tdb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap_tdb.c b/source3/lib/dbwrap/dbwrap_tdb.c
index 8964510c15..b838539307 100644
--- a/source3/lib/dbwrap/dbwrap_tdb.c
+++ b/source3/lib/dbwrap/dbwrap_tdb.c
@@ -188,6 +188,13 @@ static int db_tdb_exists(struct db_context *db, TDB_DATA key)
return tdb_exists(ctx->wtdb->tdb, key);
}
+static int db_tdb_wipe(struct db_context *db)
+{
+ struct db_tdb_ctx *ctx = talloc_get_type_abort(
+ db->private_data, struct db_tdb_ctx);
+ return tdb_wipe_all(ctx->wtdb->tdb);
+}
+
static int db_tdb_parse(struct db_context *db, TDB_DATA key,
int (*parser)(TDB_DATA key, TDB_DATA data,
void *private_data),
@@ -383,6 +390,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
result->transaction_commit = db_tdb_transaction_commit;
result->transaction_cancel = db_tdb_transaction_cancel;
result->exists = db_tdb_exists;
+ result->wipe = db_tdb_wipe;
return result;
fail: