summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-03-17 01:31:47 +0100
committerMichael Adam <obnox@samba.org>2008-03-17 08:22:33 +0100
commit18a407de8c4cdb1513d6c949a5e61db2787b5af2 (patch)
treeb2a7739deef39b376a54dee2ba81a15fe3cf0ce6 /source3/registry
parent40e6ec16ee51d81ad75fb80bf4658796614ffa1a (diff)
downloadsamba-18a407de8c4cdb1513d6c949a5e61db2787b5af2.tar.gz
samba-18a407de8c4cdb1513d6c949a5e61db2787b5af2.tar.bz2
samba-18a407de8c4cdb1513d6c949a5e61db2787b5af2.zip
registry: untangle assignments and if statements in regdb_set_secdesc().
Michael (This used to be commit d553b5d72569c1496bfa3de703c9bf15a9a6cb60)
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_backend_db.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index c13e0ec3f1..8a35e8c44d 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -916,19 +916,19 @@ static WERROR regdb_set_secdesc(const char *key,
char *tdbkey;
WERROR err = WERR_NOMEM;
TDB_DATA tdbdata;
+ int tdb_ret;
+
ZERO_STRUCT(ps);
- if (!(tdbkey = talloc_asprintf(mem_ctx, "%s/%s", REG_SECDESC_PREFIX,
- key))) {
+ tdbkey = talloc_asprintf(mem_ctx, "%s/%s", REG_SECDESC_PREFIX, key);
+ if (tdbkey == NULL) {
goto done;
}
normalize_dbkey(tdbkey);
if (secdesc == NULL) {
/* assuming a delete */
- int tdb_ret;
-
tdb_ret = dbwrap_trans_delete(regdb,
string_term_tdb_data(tdbkey));
if (tdb_ret == -1) {
@@ -947,8 +947,9 @@ static WERROR regdb_set_secdesc(const char *key,
goto done;
}
- if (dbwrap_trans_store(regdb, string_term_tdb_data(tdbkey),
- tdbdata, 0) == -1) {
+ tdb_ret = dbwrap_trans_store(regdb, string_term_tdb_data(tdbkey),
+ tdbdata, 0);
+ if (tdb_ret == -1) {
err = ntstatus_to_werror(map_nt_error_from_unix(errno));
goto done;
}