From 5045281e17d7f90e1f31b7bf9ffdea9b59b99373 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 25 Jul 2011 22:16:20 +0200 Subject: s3-rpc_client: Close policy handles before creating defaults. We reopen the hive and key so close them before reopen. --- source3/rpc_client/cli_winreg_spoolss.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3') diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c index ebdd419a65..e3d8a3d205 100644 --- a/source3/rpc_client/cli_winreg_spoolss.c +++ b/source3/rpc_client/cli_winreg_spoolss.c @@ -1666,6 +1666,21 @@ WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, } if (!W_ERROR_IS_OK(result)) { if (W_ERROR_EQUAL(result, WERR_BADFILE)) { + WERROR ignore; + + if (is_valid_policy_hnd(&key_hnd)) { + dcerpc_winreg_CloseKey(winreg_handle, + tmp_ctx, + &key_hnd, + &ignore); + } + + if (is_valid_policy_hnd(&hive_hnd)) { + dcerpc_winreg_CloseKey(winreg_handle, + tmp_ctx, + &hive_hnd, + &ignore); + } goto create_default; } goto done; -- cgit