diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/dbwrap/dbwrap.c | 6 | ||||
-rw-r--r-- | source3/lib/dbwrap/dbwrap.h | 1 | ||||
-rw-r--r-- | source3/lib/dbwrap/dbwrap_private.h | 1 | ||||
-rw-r--r-- | source3/lib/dbwrap/dbwrap_tdb.c | 2 |
4 files changed, 10 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c index 82b1c54ac4..21d46ea895 100644 --- a/source3/lib/dbwrap/dbwrap.c +++ b/source3/lib/dbwrap/dbwrap.c @@ -161,6 +161,7 @@ static struct db_record *dbwrap_fetch_locked_internal( return NULL; } (void)talloc_steal(rec, lock_order); + rec->db = db; TALLOC_FREE(frame); return rec; } @@ -183,6 +184,11 @@ struct db_record *dbwrap_try_fetch_locked(struct db_context *db, ? db->try_fetch_locked : db->fetch_locked); } +struct db_context *dbwrap_record_get_db(struct db_record *rec) +{ + return rec->db; +} + struct dbwrap_fetch_state { TALLOC_CTX *mem_ctx; TDB_DATA data; diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h index 6fd5999a9d..ff41e647ef 100644 --- a/source3/lib/dbwrap/dbwrap.h +++ b/source3/lib/dbwrap/dbwrap.h @@ -37,6 +37,7 @@ struct db_record *dbwrap_fetch_locked(struct db_context *db, struct db_record *dbwrap_try_fetch_locked(struct db_context *db, TALLOC_CTX *mem_ctx, TDB_DATA key); +struct db_context *dbwrap_record_get_db(struct db_record *rec); NTSTATUS dbwrap_delete(struct db_context *db, TDB_DATA key); NTSTATUS dbwrap_store(struct db_context *db, TDB_DATA key, diff --git a/source3/lib/dbwrap/dbwrap_private.h b/source3/lib/dbwrap/dbwrap_private.h index b24e3b370c..28da1add53 100644 --- a/source3/lib/dbwrap/dbwrap_private.h +++ b/source3/lib/dbwrap/dbwrap_private.h @@ -26,6 +26,7 @@ #include "dbwrap/dbwrap_open.h" struct db_record { + struct db_context *db; TDB_DATA key, value; NTSTATUS (*store)(struct db_record *rec, TDB_DATA data, int flag); NTSTATUS (*delete_rec)(struct db_record *rec); diff --git a/source3/lib/dbwrap/dbwrap_tdb.c b/source3/lib/dbwrap/dbwrap_tdb.c index e1b26e4e09..9450be0e65 100644 --- a/source3/lib/dbwrap/dbwrap_tdb.c +++ b/source3/lib/dbwrap/dbwrap_tdb.c @@ -276,6 +276,7 @@ static int db_tdb_traverse_func(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, rec.store = db_tdb_store; rec.delete_rec = db_tdb_delete; rec.private_data = ctx->db->private_data; + rec.db = ctx->db; return ctx->f(&rec, ctx->private_data); } @@ -316,6 +317,7 @@ static int db_tdb_traverse_read_func(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA d rec.store = db_tdb_store_deny; rec.delete_rec = db_tdb_delete_deny; rec.private_data = ctx->db->private_data; + rec.db = ctx->db; return ctx->f(&rec, ctx->private_data); } |