diff options
Diffstat (limited to 'source3/utils/net_rpc_registry.c')
-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); |