]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_client: let cli_rpc_pipe_open_schannel() use rpccli_connect_netlogon() for...
authorStefan Metzmacher <metze@samba.org>
Thu, 19 Sep 2024 05:41:09 +0000 (07:41 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2024 15:22:46 +0000 (15:22 +0000)
This way we could reuse the connection already created...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/rpc_client/cli_pipe_schannel.c

index c33fc5baa179be209ae7a79302d5e5a7183b94fb..abfdd8d5b5ac5d4676909110f62f8b8d5a892f41 100644 (file)
@@ -73,6 +73,22 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
                return status;
        }
 
+       if (table == &ndr_table_netlogon) {
+               status = rpccli_connect_netlogon(cli,
+                                                transport,
+                                                remote_name,
+                                                remote_sockaddr,
+                                                netlogon_creds,
+                                                false, /* force_reauth */
+                                                cli_creds,
+                                                &result);
+               if (!NT_STATUS_IS_OK(status)) {
+                       TALLOC_FREE(frame);
+                       return status;
+               }
+               goto done;
+       }
+
        status = rpccli_setup_netlogon_creds(cli, transport,
                                             netlogon_creds,
                                             false, /* force_reauth */
@@ -110,6 +126,7 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
                }
        }
 
+done:
        *presult = result;
        if (pcreds != NULL) {
                *pcreds = talloc_move(mem_ctx, &netlogon_creds);