summaryrefslogtreecommitdiff
path: root/source3/registry/reg_backend_db.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/registry/reg_backend_db.c')
-rw-r--r--source3/registry/reg_backend_db.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index e22a73ad05..7dfaf52406 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -1431,13 +1431,17 @@ static TDB_DATA regdb_fetch_key_internal(struct db_context *db,
{
char *path = NULL;
TDB_DATA data;
+ NTSTATUS status;
path = normalize_reg_path(mem_ctx, key);
if (!path) {
return make_tdb_data(NULL, 0);
}
- data = dbwrap_fetch_bystring(db, mem_ctx, path);
+ status = dbwrap_fetch_bystring(db, mem_ctx, path, &data);
+ if (!NT_STATUS_IS_OK(status)) {
+ data = tdb_null;
+ }
TALLOC_FREE(path);
return data;
@@ -1796,9 +1800,10 @@ static NTSTATUS regdb_store_values_internal(struct db_context *db,
goto done;
}
- old_data = dbwrap_fetch_bystring(db, ctx, keystr);
+ status = dbwrap_fetch_bystring(db, ctx, keystr, &old_data);
- if ((old_data.dptr != NULL)
+ if (NT_STATUS_IS_OK(status)
+ && (old_data.dptr != NULL)
&& (old_data.dsize == data.dsize)
&& (memcmp(old_data.dptr, data.dptr, data.dsize) == 0))
{
@@ -1871,8 +1876,8 @@ static WERROR regdb_get_secdesc(TALLOC_CTX *mem_ctx, const char *key,
goto done;
}
- data = dbwrap_fetch_bystring(regdb, tmp_ctx, tdbkey);
- if (data.dptr == NULL) {
+ status = dbwrap_fetch_bystring(regdb, tmp_ctx, tdbkey, &data);
+ if (!NT_STATUS_IS_OK(status)) {
err = WERR_BADFILE;
goto done;
}