summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-07-04 10:27:17 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:55 +0200
commit5953839b1890eaf36a3d9a3fd7febe65524a9980 (patch)
tree941a0fe163cd47ac843bf67152c627fe405b24e6 /source3/lib
parent87b68cea5bdec1849a275b37ea8a80a73d036734 (diff)
downloadsamba-5953839b1890eaf36a3d9a3fd7febe65524a9980.tar.gz
samba-5953839b1890eaf36a3d9a3fd7febe65524a9980.tar.bz2
samba-5953839b1890eaf36a3d9a3fd7febe65524a9980.zip
s3:dbwrap: add specific dbwrap_exists() 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 63d27296a6..8964510c15 100644
--- a/source3/lib/dbwrap/dbwrap_tdb.c
+++ b/source3/lib/dbwrap/dbwrap_tdb.c
@@ -181,6 +181,13 @@ static int db_tdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
return 0;
}
+static int db_tdb_exists(struct db_context *db, TDB_DATA key)
+{
+ struct db_tdb_ctx *ctx = talloc_get_type_abort(
+ db->private_data, struct db_tdb_ctx);
+ return tdb_exists(ctx->wtdb->tdb, key);
+}
+
static int db_tdb_parse(struct db_context *db, TDB_DATA key,
int (*parser)(TDB_DATA key, TDB_DATA data,
void *private_data),
@@ -375,6 +382,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
result->transaction_start = db_tdb_transaction_start;
result->transaction_commit = db_tdb_transaction_commit;
result->transaction_cancel = db_tdb_transaction_cancel;
+ result->exists = db_tdb_exists;
return result;
fail: