1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

s3:dbwrap: add specific dbwrap_exists() implementation to dbwrap_tdb

Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Gregor Beck 2011-07-04 10:27:17 +02:00 committed by Michael Adam
parent 87b68cea5b
commit 5953839b18

View File

@ -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: