From 77460a90756dcaa54ec12bbcd30a5266286103d7 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 8 Nov 2005 16:33:45 +0000 Subject: r11579: syncing up perf counter code cfrom trunk (This used to be commit 59c00924b67aa3d37a933731a56d03963ec7f1b5) --- source3/utils/net_rpc_registry.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c index 7397c88d95..289fb59fea 100644 --- a/source3/utils/net_rpc_registry.c +++ b/source3/utils/net_rpc_registry.c @@ -117,11 +117,14 @@ static NTSTATUS rpc_registry_enumerate_internal(const DOM_SID *domain_sid, return werror_to_ntstatus(result); } - result = rpccli_reg_open_entry(pipe_hnd, mem_ctx, &pol_hive, subpath, MAXIMUM_ALLOWED_ACCESS, &pol_key ); - if ( !W_ERROR_IS_OK(result) ) { - d_printf("Unable to open [%s]\n", argv[0]); - return werror_to_ntstatus(result); + if ( strlen( subpath ) != 0 ) { + result = rpccli_reg_open_entry(pipe_hnd, mem_ctx, &pol_hive, subpath, MAXIMUM_ALLOWED_ACCESS, &pol_key ); + if ( !W_ERROR_IS_OK(result) ) { + d_printf("Unable to open [%s]\n", argv[0]); + return werror_to_ntstatus(result); + } } + memcpy( &pol_key, &pol_hive, sizeof(POLICY_HND) ); /* get the subkeys */ @@ -183,7 +186,8 @@ static NTSTATUS rpc_registry_enumerate_internal(const DOM_SID *domain_sid, out: /* cleanup */ - rpccli_reg_close(pipe_hnd, mem_ctx, &pol_key ); + if ( strlen( subpath ) != 0 ) + rpccli_reg_close(pipe_hnd, mem_ctx, &pol_key ); rpccli_reg_close(pipe_hnd, mem_ctx, &pol_hive ); return werror_to_ntstatus(result); -- cgit