cli_netlogon: Pass server_dns_domain through rpccli_create_netlogon_creds
authorVolker Lendecke <vl@samba.org>
Wed, 6 Sep 2017 11:48:18 +0000 (13:48 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 16 Sep 2017 06:36:17 +0000 (08:36 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/libnet/libnet_join.c
source3/rpc_client/cli_netlogon.c
source3/rpc_client/cli_netlogon.h

index 591c177..36b9add 100644 (file)
@@ -1153,6 +1153,7 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx,
 
        status = rpccli_create_netlogon_creds(netlogon_pipe->desthost,
                                              r->in.domain_name,
+                                             "", /* Never unsecure in AD */
                                              r->out.account_name,
                                              r->in.secure_channel_type,
                                              r->in.msg_ctx,
index dad4d6f..ced83da 100644 (file)
@@ -88,6 +88,7 @@ NTSTATUS rpccli_pre_open_netlogon_creds(void)
 
 NTSTATUS rpccli_create_netlogon_creds(const char *server_computer,
                                      const char *server_netbios_domain,
+                                     const char *server_dns_domain,
                                      const char *client_account,
                                      enum netr_SchannelType sec_chan_type,
                                      struct messaging_context *msg_ctx,
@@ -115,7 +116,7 @@ NTSTATUS rpccli_create_netlogon_creds(const char *server_computer,
                                                   sec_chan_type,
                                                   server_computer,
                                                   server_netbios_domain,
-                                                  "",
+                                                  server_dns_domain,
                                                   mem_ctx, netlogon_creds);
        TALLOC_FREE(frame);
        if (!NT_STATUS_IS_OK(status)) {
@@ -133,6 +134,7 @@ NTSTATUS rpccli_create_netlogon_creds_with_creds(struct cli_credentials *creds,
 {
        enum netr_SchannelType sec_chan_type;
        const char *server_netbios_domain;
+       const char *server_dns_domain;
        const char *client_account;
 
        sec_chan_type = cli_credentials_get_secure_channel_type(creds);
@@ -142,9 +144,11 @@ NTSTATUS rpccli_create_netlogon_creds_with_creds(struct cli_credentials *creds,
 
        client_account = cli_credentials_get_username(creds);
        server_netbios_domain = cli_credentials_get_domain(creds);
+       server_dns_domain = cli_credentials_get_realm(creds);
 
        return rpccli_create_netlogon_creds(server_computer,
                                            server_netbios_domain,
+                                           server_dns_domain,
                                            client_account,
                                            sec_chan_type,
                                            msg_ctx, mem_ctx,
index bef0def..33f0a7e 100644 (file)
@@ -35,6 +35,7 @@ struct dcerpc_binding_handle;
 NTSTATUS rpccli_pre_open_netlogon_creds(void);
 NTSTATUS rpccli_create_netlogon_creds(const char *server_computer,
                                      const char *server_netbios_domain,
+                                     const char *server_dns_domain,
                                      const char *client_account,
                                      enum netr_SchannelType sec_chan_type,
                                      struct messaging_context *msg_ctx,