From 39bdbf0a9164739141e4634583fb7c9cd35c0991 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Thu, 10 Sep 2009 22:23:21 +0200 Subject: [PATCH] s3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_schannel(). Guenther (cherry picked from commit bea8e5fa6038d5abd2ec1e12f9005c4a04abb79f) (cherry picked from commit 5b44f54a18b60fe3814623f351025335a0273916) --- source3/auth/auth_domain.c | 2 +- source3/include/proto.h | 3 +++ source3/libnet/libnet_join.c | 3 ++- source3/rpc_client/cli_pipe.c | 9 ++++++--- source3/rpcclient/rpcclient.c | 1 + source3/utils/net_rpc.c | 2 +- source3/utils/net_rpc_join.c | 5 +++-- source3/winbindd/winbindd_cm.c | 7 ++++--- 8 files changed, 21 insertions(+), 11 deletions(-) diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index f11dbe60ee1..45150ab1425 100644 --- a/source3/auth/auth_domain.c +++ b/source3/auth/auth_domain.c @@ -175,7 +175,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, if (lp_client_schannel()) { /* We also setup the creds chain in the open_schannel call. */ result = cli_rpc_pipe_open_schannel( - *cli, &ndr_table_netlogon.syntax_id, + *cli, &ndr_table_netlogon.syntax_id, NCACN_NP, PIPE_AUTH_LEVEL_PRIVACY, domain, &netlogon_pipe); } else { result = cli_rpc_pipe_open_noauth( diff --git a/source3/include/proto.h b/source3/include/proto.h index 96c1d930160..8a5936351a3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5315,12 +5315,14 @@ NTSTATUS get_schannel_session_key(struct cli_state *cli, struct rpc_pipe_client **presult); NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli, const struct ndr_syntax_id *interface, + enum dcerpc_transport_t transport, enum pipe_auth_level auth_level, const char *domain, const struct dcinfo *pdc, struct rpc_pipe_client **presult); NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli, const struct ndr_syntax_id *interface, + enum dcerpc_transport_t transport, enum pipe_auth_level auth_level, const char *domain, const char *username, @@ -5328,6 +5330,7 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli, struct rpc_pipe_client **presult); NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, const struct ndr_syntax_id *interface, + enum dcerpc_transport_t transport, enum pipe_auth_level auth_level, const char *domain, struct rpc_pipe_client **presult); diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 5309452a3d2..03832cffe5a 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -1070,7 +1070,8 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name, } status = cli_rpc_pipe_open_schannel_with_key( - cli, &ndr_table_netlogon.syntax_id, PIPE_AUTH_LEVEL_PRIVACY, + cli, &ndr_table_netlogon.syntax_id, NCACN_NP, + PIPE_AUTH_LEVEL_PRIVACY, netbios_domain_name, netlogon_pipe->dc, &pipe_hnd); cli_shutdown(cli); diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 5b8a2d42646..9990f1b7a01 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3887,6 +3887,7 @@ NTSTATUS get_schannel_session_key(struct cli_state *cli, NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli, const struct ndr_syntax_id *interface, + enum dcerpc_transport_t transport, enum pipe_auth_level auth_level, const char *domain, const struct dcinfo *pdc, @@ -3896,7 +3897,7 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli, struct cli_pipe_auth_data *auth; NTSTATUS status; - status = cli_rpc_pipe_open(cli, NCACN_NP, interface, &result); + status = cli_rpc_pipe_open(cli, transport, interface, &result); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -3982,6 +3983,7 @@ static NTSTATUS get_schannel_session_key_auth_ntlmssp(struct cli_state *cli, NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli, const struct ndr_syntax_id *interface, + enum dcerpc_transport_t transport, enum pipe_auth_level auth_level, const char *domain, const char *username, @@ -4003,7 +4005,7 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli, } status = cli_rpc_pipe_open_schannel_with_key( - cli, interface, auth_level, domain, netlogon_pipe->dc, + cli, interface, transport, auth_level, domain, netlogon_pipe->dc, &result); /* Now we've bound using the session key we can close the netlog pipe. */ @@ -4022,6 +4024,7 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli, NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, const struct ndr_syntax_id *interface, + enum dcerpc_transport_t transport, enum pipe_auth_level auth_level, const char *domain, struct rpc_pipe_client **presult) @@ -4041,7 +4044,7 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, } status = cli_rpc_pipe_open_schannel_with_key( - cli, interface, auth_level, domain, netlogon_pipe->dc, + cli, interface, transport, auth_level, domain, netlogon_pipe->dc, &result); /* Now we've bound using the session key we can close the netlog pipe. */ diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index ae2a820a340..17ca5e77c47 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -614,6 +614,7 @@ static NTSTATUS do_cmd(struct cli_state *cli, case PIPE_AUTH_TYPE_SCHANNEL: ntresult = cli_rpc_pipe_open_schannel( cli, cmd_entry->interface, + NCACN_NP, pipe_default_auth_level, lp_workgroup(), &cmd_entry->rpc_pipe); diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 168659a4dbf..7fafa1b5877 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -157,7 +157,7 @@ int run_rpc_command(struct net_context *c, &ndr_table_netlogon.syntax_id))) { /* Always try and create an schannel netlogon pipe. */ nt_status = cli_rpc_pipe_open_schannel( - cli, interface, + cli, interface, NCACN_NP, PIPE_AUTH_LEVEL_PRIVACY, domain_name, &pipe_hnd); if (!NT_STATUS_IS_OK(nt_status)) { diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c index f0e6fe7041e..127b3065ea7 100644 --- a/source3/utils/net_rpc_join.c +++ b/source3/utils/net_rpc_join.c @@ -100,7 +100,8 @@ NTSTATUS net_rpc_join_ok(struct net_context *c, const char *domain, } ntret = cli_rpc_pipe_open_schannel_with_key( - cli, &ndr_table_netlogon.syntax_id, PIPE_AUTH_LEVEL_PRIVACY, + cli, &ndr_table_netlogon.syntax_id, NCACN_NP, + PIPE_AUTH_LEVEL_PRIVACY, domain, netlogon_pipe->dc, &pipe_hnd); if (!NT_STATUS_IS_OK(ntret)) { @@ -415,7 +416,7 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv) struct rpc_pipe_client *netlogon_schannel_pipe; result = cli_rpc_pipe_open_schannel_with_key( - cli, &ndr_table_netlogon.syntax_id, + cli, &ndr_table_netlogon.syntax_id, NCACN_NP, PIPE_AUTH_LEVEL_PRIVACY, domain, pipe_hnd->dc, &netlogon_schannel_pipe); diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index ac22ed43367..85333cf77a0 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -2089,7 +2089,8 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, goto anonymous; } result = cli_rpc_pipe_open_schannel_with_key - (conn->cli, &ndr_table_samr.syntax_id, PIPE_AUTH_LEVEL_PRIVACY, + (conn->cli, &ndr_table_samr.syntax_id, NCACN_NP, + PIPE_AUTH_LEVEL_PRIVACY, domain->name, p_dcinfo, &conn->samr_pipe); if (!NT_STATUS_IS_OK(result)) { @@ -2225,7 +2226,7 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, goto anonymous; } result = cli_rpc_pipe_open_schannel_with_key - (conn->cli, &ndr_table_lsarpc.syntax_id, + (conn->cli, &ndr_table_lsarpc.syntax_id, NCACN_NP, PIPE_AUTH_LEVEL_PRIVACY, domain->name, p_dcinfo, &conn->lsa_pipe); @@ -2372,7 +2373,7 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain, */ result = cli_rpc_pipe_open_schannel_with_key( - conn->cli, &ndr_table_netlogon.syntax_id, + conn->cli, &ndr_table_netlogon.syntax_id, NCACN_NP, PIPE_AUTH_LEVEL_PRIVACY, domain->name, netlogon_pipe->dc, &conn->netlogon_pipe); -- 2.11.4.GIT