diff options
author | Michael Adam <obnox@samba.org> | 2011-08-24 13:08:13 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-11 14:17:56 +0200 |
commit | 0e28448a780cf231ae38fe03a85cf6e1ea9dded0 (patch) | |
tree | 91878c39866520bc06d968cd44cd8a86995cc8ad /source3/registry | |
parent | 25a9978c2c4d00eb64b212170f64f5cc136e032a (diff) | |
download | samba-0e28448a780cf231ae38fe03a85cf6e1ea9dded0.tar.gz samba-0e28448a780cf231ae38fe03a85cf6e1ea9dded0.tar.bz2 samba-0e28448a780cf231ae38fe03a85cf6e1ea9dded0.zip |
s3:dbwrap: convert dbwrap_fetch(), dbwrap_fetch_bystring() and dbwrap_fetch_bystring_upper() to NTSTATUS
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_backend_db.c | 15 | ||||
-rw-r--r-- | source3/registry/reg_objects.c | 6 |
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; } |