In libnet join code, try lsa query with level 12 first.
authorGünther Deschner <gd@samba.org>
Tue, 18 Dec 2007 09:31:12 +0000 (10:31 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 21 Dec 2007 14:29:10 +0000 (15:29 +0100)
Guenther
(This used to be commit f0e8d744c92d2602722e04be6266196941362d63)

source3/libnet/libnet_join.c

index f787a2d632366e9155b930f99dce47e0dc356c3b..18421056daf845c4d1e66ee17c005a7f38259cc8 100644 (file)
@@ -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);