diff options
Diffstat (limited to 'source3/lib/dbwrap/dbwrap.c')
-rw-r--r-- | source3/lib/dbwrap/dbwrap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c index 6a6d4c64e5..5b87fd3154 100644 --- a/source3/lib/dbwrap/dbwrap.c +++ b/source3/lib/dbwrap/dbwrap.c @@ -22,6 +22,7 @@ #include "includes.h" #include "dbwrap/dbwrap.h" #include "dbwrap/dbwrap_private.h" +#include "util_tdb.h" /* * Fall back using fetch_locked if no genuine fetch operation is provided @@ -64,3 +65,16 @@ int dbwrap_fallback_parse_record(struct db_context *db, TDB_DATA key, TALLOC_FREE(data.dptr); return res; } + + +TDB_DATA dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, + TDB_DATA key) +{ + TDB_DATA result; + + if (db->fetch(db, mem_ctx, key, &result) != 0) { + return make_tdb_data(NULL, 0); + } + + return result; +} |