summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-01-30 13:44:31 +0100
committerMichael Adam <obnox@samba.org>2011-01-30 14:09:04 +0100
commitb1f800a0d17e9a927cb5d998438b3fdb6b302b13 (patch)
tree3b14a94cd65e8fb61d89e00a4b9131149aace920 /source3/registry
parente81ddbcadedd30a76abc16246eaf7c60d19029bf (diff)
downloadsamba-b1f800a0d17e9a927cb5d998438b3fdb6b302b13.tar.gz
samba-b1f800a0d17e9a927cb5d998438b3fdb6b302b13.tar.bz2
samba-b1f800a0d17e9a927cb5d998438b3fdb6b302b13.zip
s3:registry: in deletekey_recursive, fix return code upon error.
correctly keep the werr from inside the transaction when the opearation inside the transaction fails. What is the correct behaviour if the cancel operation fails?
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_api.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c
index a98eaf8271..acce7ab1b4 100644
--- a/source3/registry/reg_api.c
+++ b/source3/registry/reg_api.c
@@ -840,14 +840,21 @@ static WERROR reg_deletekey_recursive_trans(struct registry_key *parent,
werr = reg_deletekey_recursive_internal(parent, path, del_key);
if (!W_ERROR_IS_OK(werr)) {
+ WERROR werr2;
+
DEBUG(1, (__location__ " failed to delete key '%s' from key "
"'%s': %s\n", path, parent->key->name,
win_errstr(werr)));
- werr = regdb_transaction_cancel();
- if (!W_ERROR_IS_OK(werr)) {
+
+ werr2 = regdb_transaction_cancel();
+ if (!W_ERROR_IS_OK(werr2)) {
DEBUG(0, ("reg_deletekey_recursive_trans: "
"error cancelling transaction: %s\n",
- win_errstr(werr)));
+ win_errstr(werr2)));
+ /*
+ * return the original werr or the
+ * error from cancelling the transaction?
+ */
}
} else {
werr = regdb_transaction_commit();