]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:cli_pipe: pass target_service to cli_rpc_pipe_open_with_creds()
authorStefan Metzmacher <metze@samba.org>
Wed, 6 Nov 2024 13:16:27 +0000 (14:16 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 5 Dec 2024 16:46:37 +0000 (16:46 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libsmb/passchange.c
source3/rpc_client/cli_pipe.c
source3/rpc_client/cli_pipe.h
source3/rpcclient/rpcclient.c
source3/utils/net_rpc.c
source3/winbindd/winbindd_cm.c

index e1b4a9824551309284c6a55c1a02bc3c259024c0..16253eabff62308eb45cac302937b126a42c9004 100644 (file)
@@ -163,6 +163,7 @@ NTSTATUS remote_password_change(const char *remote_machine,
                                                      NCACN_NP,
                                                      DCERPC_AUTH_TYPE_NTLMSSP,
                                                      DCERPC_AUTH_LEVEL_PRIVACY,
+                                                     NULL, /* target_service */
                                                      remote_machine,
                                                      remote_sockaddr,
                                                      creds,
index 188b7fe283859db91a2ecaeee7c9747704783951..4c70c406dbdeb70901ee22a38b030f269c1501e2 100644 (file)
@@ -4265,20 +4265,24 @@ NTSTATUS cli_rpc_pipe_open_with_creds(struct cli_state *cli,
                                      enum dcerpc_transport_t transport,
                                      enum dcerpc_AuthType auth_type,
                                      enum dcerpc_AuthLevel auth_level,
-                                     const char *server,
+                                     const char *target_service,
+                                     const char *target_hostname,
                                      const struct sockaddr_storage *remote_sockaddr,
                                      struct cli_credentials *creds,
                                      struct rpc_pipe_client **presult)
 {
        struct rpc_pipe_client *result;
        struct pipe_auth_data *auth = NULL;
-       const char *target_service = table->authservices->names[0];
        NTSTATUS status;
 
+       if (target_service == NULL) {
+               target_service = table->authservices->names[0];
+       }
+
        status = cli_rpc_pipe_open(cli,
                                   transport,
                                   table,
-                                  server,
+                                  target_hostname,
                                   remote_sockaddr,
                                   &result);
        if (!NT_STATUS_IS_OK(status)) {
@@ -4286,8 +4290,10 @@ NTSTATUS cli_rpc_pipe_open_with_creds(struct cli_state *cli,
        }
 
        status = rpccli_generic_bind_data_from_creds(result,
-                                                    auth_type, auth_level,
-                                                    server, target_service,
+                                                    auth_type,
+                                                    auth_level,
+                                                    target_hostname,
+                                                    target_service,
                                                     creds,
                                                     &auth);
        if (!NT_STATUS_IS_OK(status)) {
index 2639cba884f067d64f4192ce94dbe79551dd608b..d6e472afcf6db7650eb6ed433eade4e641608e25 100644 (file)
@@ -104,7 +104,8 @@ NTSTATUS cli_rpc_pipe_open_with_creds(struct cli_state *cli,
                                      enum dcerpc_transport_t transport,
                                      enum dcerpc_AuthType auth_type,
                                      enum dcerpc_AuthLevel auth_level,
-                                     const char *server,
+                                     const char *target_service,
+                                     const char *target_hostname,
                                      const struct sockaddr_storage *remote_sockaddr,
                                      struct cli_credentials *creds,
                                      struct rpc_pipe_client **presult);
index c08a75d4359f79b025cce9dd79127e0ba4b40058..dea0b24976d8b700e8a9429181ff9570c592bc99 100644 (file)
@@ -958,6 +958,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
                                        transport,
                                        auth_type,
                                        auth_level,
+                                       NULL, /* target_service */
                                        remote_name,
                                        remote_sockaddr,
                                        creds,
index 384c2218d4395aba7b6592f1d643ab43b613060b..f8da9dabb0b4ddf5f0637747e879e418f7256570 100644 (file)
@@ -214,6 +214,7 @@ int run_rpc_command(struct net_context *c,
                                        NCACN_IP_TCP : NCACN_NP,
                                        DCERPC_AUTH_TYPE_NTLMSSP,
                                        DCERPC_AUTH_LEVEL_PRIVACY,
+                                       NULL, /* target_service */
                                        smbXcli_conn_remote_name(cli->conn),
                                        smbXcli_conn_remote_sockaddr(cli->conn),
                                        c->creds, &pipe_hnd);
index cffab6bd0352b309025e201f47f0306bba0a7bc8..2a2eb3da72b02a07df001875dc34d14d71c156c7 100644 (file)
@@ -2573,6 +2573,7 @@ retry:
                                              NCACN_NP,
                                              DCERPC_AUTH_TYPE_SPNEGO,
                                              conn->auth_level,
+                                             NULL, /* target_service */
                                              remote_name,
                                              remote_sockaddr,
                                              creds,
@@ -2913,6 +2914,7 @@ retry:
                (conn->cli, &ndr_table_lsarpc, NCACN_NP,
                 DCERPC_AUTH_TYPE_SPNEGO,
                 conn->auth_level,
+                NULL, /* target_service */
                 remote_name,
                 remote_sockaddr,
                 creds,