summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap')
-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: