]> 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)
committerJule Anger <janger@samba.org>
Thu, 12 Jun 2025 11:27:15 +0000 (11:27 +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 3231d0bfff2d5a7e01ce1969cd13eafea42650d1..e7482173cef78a380719aeb864f418e69c5b44d9 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 95b6baf32b031fbf2122666bee4bc885cc1c9d67..b81020482e6a89b6bad0753d578514e881fedd0e 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 4e4de84b6e390b469ffd67d7e6fc4ba9aba93a39..86cd9a5600b80e95cc42714b5da4f7e20944d9f4 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 9d59876970a8afc3c762e66734c37d1d16f007fe..e07b6fb0f3215dd9b6eac0c967fce99c7be51f03 100644 (file)
@@ -2639,6 +2639,7 @@ retry:
                                              NCACN_NP,
                                              DCERPC_AUTH_TYPE_SPNEGO,
                                              conn->auth_level,
+                                             NULL, /* target_service */
                                              remote_name,
                                              remote_sockaddr,
                                              creds,
@@ -2974,6 +2975,7 @@ retry:
                (conn->cli, &ndr_table_lsarpc, NCACN_NP,
                 DCERPC_AUTH_TYPE_SPNEGO,
                 conn->auth_level,
+                NULL, /* target_service */
                 remote_name,
                 remote_sockaddr,
                 creds,