summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libnet/libnet_join.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index f787a2d632..18421056da 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -73,14 +73,6 @@ static NTSTATUS do_DomainJoin(TALLOC_CTX *mem_ctx,
goto done;
}
- status = rpccli_lsa_query_info_policy(pipe_hnd, mem_ctx, &lsa_pol,
- 5,
- &r->out.netbios_domain_name,
- &r->out.domain_sid);
- if (!NT_STATUS_IS_OK(status)) {
- goto done;
- }
-
status = rpccli_lsa_query_info_policy2(pipe_hnd, mem_ctx, &lsa_pol,
12,
&r->out.netbios_domain_name,
@@ -89,6 +81,16 @@ static NTSTATUS do_DomainJoin(TALLOC_CTX *mem_ctx,
NULL,
&r->out.domain_sid);
+ if (!NT_STATUS_IS_OK(status)) {
+ status = rpccli_lsa_query_info_policy(pipe_hnd, mem_ctx, &lsa_pol,
+ 5,
+ &r->out.netbios_domain_name,
+ &r->out.domain_sid);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
+ }
+
rpccli_lsa_Close(pipe_hnd, mem_ctx, &lsa_pol);
cli_rpc_pipe_close(pipe_hnd);