1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

s3:rpc_server: Remove direct registry access from svcctl_init_winreg

Once we do registry access via a pipe into a different process, a
registry client won't be able to directly do registry transactions
anymore. In this case, I argue that doing this in a transactioned way
is overkill anyway. svcctl_init_winreg() just sets up some registry
keys, and if that leaves behind some stale entries if it fails
somewhere in the middle, it does not really matter because the only
one looking at these registry keys is the svcctl service, and that
only starts up if the init function was successfully run.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Volker Lendecke 2021-06-13 07:48:01 +02:00
parent a60c7b4ff2
commit f83f7bd6bd

View File

@ -572,19 +572,6 @@ 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,
@ -684,20 +671,6 @@ 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();
talloc_free(tmp_ctx);
return ok;
}