diff options
author | Gerald Carter <jerry@samba.org> | 2005-11-08 16:33:45 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:21 -0500 |
commit | 77460a90756dcaa54ec12bbcd30a5266286103d7 (patch) | |
tree | aac95461d5cf4b3c0d9dc450bb78e8c2f6fef2d9 /source3/utils | |
parent | 38b54d063d7fd262902324e5da15205542878adf (diff) | |
download | samba-77460a90756dcaa54ec12bbcd30a5266286103d7.tar.gz samba-77460a90756dcaa54ec12bbcd30a5266286103d7.tar.bz2 samba-77460a90756dcaa54ec12bbcd30a5266286103d7.zip |
r11579: syncing up perf counter code cfrom trunk
(This used to be commit 59c00924b67aa3d37a933731a56d03963ec7f1b5)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc_registry.c | 14 |
1 files changed, 9 insertions, 5 deletions
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); |