summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-04-09 18:15:12 +0200
committerVolker Lendecke <vlendec@samba.org>2011-04-11 22:09:58 +0200
commitd1ded271b6e8f8ff7f09c4830411e389d26b1b10 (patch)
tree6c33725487861889b63456c8965c40fd1cda2a72 /source3/rpc_server
parenta5495e70cc5f7659ab94d8570195edf3bd41072b (diff)
downloadsamba-d1ded271b6e8f8ff7f09c4830411e389d26b1b10.tar.gz
samba-d1ded271b6e8f8ff7f09c4830411e389d26b1b10.tar.bz2
samba-d1ded271b6e8f8ff7f09c4830411e389d26b1b10.zip
s3: Wrap creating the svcctl keys in a transaction
This makes the startup of smbd in make test much quicker and thus more reliable (cherry picked from commit f1aa38b414e97d8687d0bebf65baa384f75301b4) Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Apr 11 22:09:58 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/rpc_server')
-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;
}