diff options
Diffstat (limited to 'source3/lib/dbwrap/dbwrap.c')
-rw-r--r-- | source3/lib/dbwrap/dbwrap.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c index d5e9689895..38404a876c 100644 --- a/source3/lib/dbwrap/dbwrap.c +++ b/source3/lib/dbwrap/dbwrap.c @@ -130,16 +130,18 @@ struct db_record *dbwrap_fetch_locked(struct db_context *db, return db->fetch_locked(db, mem_ctx, key); } -TDB_DATA dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, - TDB_DATA key) +NTSTATUS dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, + TDB_DATA key, TDB_DATA *value) { - TDB_DATA result; + if (value == NULL) { + return NT_STATUS_INVALID_PARAMETER; + } - if (db->fetch(db, mem_ctx, key, &result) != 0) { - return make_tdb_data(NULL, 0); + if (db->fetch(db, mem_ctx, key, value) != 0) { + return NT_STATUS_NOT_FOUND; } - return result; + return NT_STATUS_OK; } bool dbwrap_exists(struct db_context *db, TDB_DATA key) |