1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00

s3:cli_pipe: pass target_service to cli_rpc_pipe_open_with_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2024-11-06 14:16:27 +01:00
parent 4dbbfcb004
commit f59b8ac136
6 changed files with 18 additions and 6 deletions

View File

@ -163,6 +163,7 @@ NTSTATUS remote_password_change(const char *remote_machine,
NCACN_NP, NCACN_NP,
DCERPC_AUTH_TYPE_NTLMSSP, DCERPC_AUTH_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_PRIVACY, DCERPC_AUTH_LEVEL_PRIVACY,
NULL, /* target_service */
remote_machine, remote_machine,
remote_sockaddr, remote_sockaddr,
creds, creds,

View File

@ -4265,20 +4265,24 @@ NTSTATUS cli_rpc_pipe_open_with_creds(struct cli_state *cli,
enum dcerpc_transport_t transport, enum dcerpc_transport_t transport,
enum dcerpc_AuthType auth_type, enum dcerpc_AuthType auth_type,
enum dcerpc_AuthLevel auth_level, enum dcerpc_AuthLevel auth_level,
const char *server, const char *target_service,
const char *target_hostname,
const struct sockaddr_storage *remote_sockaddr, const struct sockaddr_storage *remote_sockaddr,
struct cli_credentials *creds, struct cli_credentials *creds,
struct rpc_pipe_client **presult) struct rpc_pipe_client **presult)
{ {
struct rpc_pipe_client *result; struct rpc_pipe_client *result;
struct pipe_auth_data *auth = NULL; struct pipe_auth_data *auth = NULL;
const char *target_service = table->authservices->names[0];
NTSTATUS status; NTSTATUS status;
if (target_service == NULL) {
target_service = table->authservices->names[0];
}
status = cli_rpc_pipe_open(cli, status = cli_rpc_pipe_open(cli,
transport, transport,
table, table,
server, target_hostname,
remote_sockaddr, remote_sockaddr,
&result); &result);
if (!NT_STATUS_IS_OK(status)) { 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, status = rpccli_generic_bind_data_from_creds(result,
auth_type, auth_level, auth_type,
server, target_service, auth_level,
target_hostname,
target_service,
creds, creds,
&auth); &auth);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {

View File

@ -104,7 +104,8 @@ NTSTATUS cli_rpc_pipe_open_with_creds(struct cli_state *cli,
enum dcerpc_transport_t transport, enum dcerpc_transport_t transport,
enum dcerpc_AuthType auth_type, enum dcerpc_AuthType auth_type,
enum dcerpc_AuthLevel auth_level, enum dcerpc_AuthLevel auth_level,
const char *server, const char *target_service,
const char *target_hostname,
const struct sockaddr_storage *remote_sockaddr, const struct sockaddr_storage *remote_sockaddr,
struct cli_credentials *creds, struct cli_credentials *creds,
struct rpc_pipe_client **presult); struct rpc_pipe_client **presult);

View File

@ -958,6 +958,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
transport, transport,
auth_type, auth_type,
auth_level, auth_level,
NULL, /* target_service */
remote_name, remote_name,
remote_sockaddr, remote_sockaddr,
creds, creds,

View File

@ -214,6 +214,7 @@ int run_rpc_command(struct net_context *c,
NCACN_IP_TCP : NCACN_NP, NCACN_IP_TCP : NCACN_NP,
DCERPC_AUTH_TYPE_NTLMSSP, DCERPC_AUTH_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_PRIVACY, DCERPC_AUTH_LEVEL_PRIVACY,
NULL, /* target_service */
smbXcli_conn_remote_name(cli->conn), smbXcli_conn_remote_name(cli->conn),
smbXcli_conn_remote_sockaddr(cli->conn), smbXcli_conn_remote_sockaddr(cli->conn),
c->creds, &pipe_hnd); c->creds, &pipe_hnd);

View File

@ -2573,6 +2573,7 @@ retry:
NCACN_NP, NCACN_NP,
DCERPC_AUTH_TYPE_SPNEGO, DCERPC_AUTH_TYPE_SPNEGO,
conn->auth_level, conn->auth_level,
NULL, /* target_service */
remote_name, remote_name,
remote_sockaddr, remote_sockaddr,
creds, creds,
@ -2913,6 +2914,7 @@ retry:
(conn->cli, &ndr_table_lsarpc, NCACN_NP, (conn->cli, &ndr_table_lsarpc, NCACN_NP,
DCERPC_AUTH_TYPE_SPNEGO, DCERPC_AUTH_TYPE_SPNEGO,
conn->auth_level, conn->auth_level,
NULL, /* target_service */
remote_name, remote_name,
remote_sockaddr, remote_sockaddr,
creds, creds,