summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/svcctl/srv_svcctl_reg.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/rpc_server/svcctl/srv_svcctl_reg.c b/source3/rpc_server/svcctl/srv_svcctl_reg.c
index d262ff83b7..eb0c2bddb6 100644
--- a/source3/rpc_server/svcctl/srv_svcctl_reg.c
+++ b/source3/rpc_server/svcctl/srv_svcctl_reg.c
@@ -30,6 +30,7 @@
#include "rpc_client/cli_winreg.h"
#include "rpc_server/svcctl/srv_svcctl_reg.h"
#include "auth.h"
+#include "registry/reg_backend_db.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_REGISTRY
@@ -575,6 +576,19 @@ bool svcctl_init_winreg(struct messaging_context *msg_ctx)
goto done;
}
+ result = regdb_open();
+ if (!W_ERROR_IS_OK(result)) {
+ DEBUG(10, ("regdb_open failed: %s\n",
+ win_errstr(result)));
+ goto done;
+ }
+ result = regdb_transaction_start();
+ if (!W_ERROR_IS_OK(result)) {
+ DEBUG(10, ("regdb_transaction_start failed: %s\n",
+ win_errstr(result)));
+ goto done;
+ }
+
status = dcerpc_winreg_int_hklm_openkey(tmp_ctx,
get_session_info_system(),
msg_ctx,
@@ -674,6 +688,20 @@ done:
dcerpc_winreg_CloseKey(h, tmp_ctx, &key_hnd, &result);
}
+ if (ok) {
+ result = regdb_transaction_commit();
+ if (!W_ERROR_IS_OK(result)) {
+ DEBUG(10, ("regdb_transaction_commit failed: %s\n",
+ win_errstr(result)));
+ }
+ } else {
+ result = regdb_transaction_cancel();
+ if (!W_ERROR_IS_OK(result)) {
+ DEBUG(10, ("regdb_transaction_cancel failed: %s\n",
+ win_errstr(result)));
+ }
+ }
+ regdb_close();
return ok;
}