mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
libnetjoin: only close existing policy handles while unjoining.
Guenther
(This used to be commit 6dbed6e7b7
)
This commit is contained in:
parent
aa8bfd39eb
commit
dddc5725db
@ -1115,6 +1115,10 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
|
||||
struct samr_Ids name_types;
|
||||
union samr_UserInfo *info = NULL;
|
||||
|
||||
ZERO_STRUCT(sam_pol);
|
||||
ZERO_STRUCT(domain_pol);
|
||||
ZERO_STRUCT(user_pol);
|
||||
|
||||
status = cli_full_connection(&cli, NULL,
|
||||
r->in.dc_name,
|
||||
NULL, 0,
|
||||
@ -1216,8 +1220,12 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
|
||||
|
||||
done:
|
||||
if (pipe_hnd) {
|
||||
rpccli_samr_Close(pipe_hnd, mem_ctx, &domain_pol);
|
||||
rpccli_samr_Close(pipe_hnd, mem_ctx, &sam_pol);
|
||||
if (is_valid_policy_hnd(&domain_pol)) {
|
||||
rpccli_samr_Close(pipe_hnd, mem_ctx, &domain_pol);
|
||||
}
|
||||
if (is_valid_policy_hnd(&sam_pol)) {
|
||||
rpccli_samr_Close(pipe_hnd, mem_ctx, &sam_pol);
|
||||
}
|
||||
TALLOC_FREE(pipe_hnd);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user