summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_backend_db.c15
-rw-r--r--source3/registry/reg_objects.c6
2 files changed, 14 insertions, 7 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;
}
diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c
index 3e6ca67e80..c27685c97e 100644
--- a/source3/registry/reg_objects.c
+++ b/source3/registry/reg_objects.c
@@ -170,13 +170,15 @@ static WERROR regsubkey_ctr_index_for_keyname(struct regsubkey_ctr *ctr,
uint32_t *idx)
{
TDB_DATA data;
+ NTSTATUS status;
if ((ctr == NULL) || (keyname == NULL)) {
return WERR_INVALID_PARAM;
}
- data = dbwrap_fetch_bystring_upper(ctr->subkeys_hash, ctr, keyname);
- if (data.dptr == NULL) {
+ status = dbwrap_fetch_bystring_upper(ctr->subkeys_hash, ctr, keyname,
+ &data);
+ if (!NT_STATUS_IS_OK(status)) {
return WERR_NOT_FOUND;
}