From bc4c7d4c1e6a86506aa2f895eafe98a22a90c68c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 30 Jan 2014 19:01:34 +0100 Subject: s4:rpc_server: make use of dcerpc_binding_get_transport() Signed-off-by: Stefan Metzmacher Reviewed-by: Guenther Deschner --- source4/rpc_server/dcerpc_server.c | 9 +++++++-- source4/rpc_server/lsa/dcesrv_lsa.c | 6 ++++-- source4/rpc_server/lsa/lsa_init.c | 6 ++++-- source4/rpc_server/lsa/lsa_lookup.c | 21 ++++++++++++++------- source4/rpc_server/samr/dcesrv_samr.c | 3 ++- 5 files changed, 31 insertions(+), 14 deletions(-) (limited to 'source4/rpc_server') diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index c6d0d84214a..fb652c50649 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -1471,6 +1471,8 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn) NTSTATUS status; struct dcesrv_socket_context *dcesrv_sock = talloc_get_type(srv_conn->private_data, struct dcesrv_socket_context); + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dcesrv_sock->endpoint->ep_description); struct dcesrv_connection *dcesrv_conn = NULL; int ret; struct tevent_req *subreq; @@ -1520,7 +1522,7 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn) return; } - if (dcesrv_sock->endpoint->ep_description->transport == NCACN_NP) { + if (transport == NCACN_NP) { dcesrv_conn->auth_state.session_key = dcesrv_inherited_session_key; dcesrv_conn->stream = talloc_move(dcesrv_conn, &srv_conn->tstream); @@ -1842,7 +1844,10 @@ NTSTATUS dcesrv_add_ep(struct dcesrv_context *dce_ctx, struct tevent_context *event_ctx, const struct model_ops *model_ops) { - switch (e->ep_description->transport) { + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(e->ep_description); + + switch (transport) { case NCACN_UNIX_STREAM: return dcesrv_add_ep_unix(dce_ctx, lp_ctx, e, event_ctx, model_ops); diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index d8a5aefcd9d..a7fc1862c53 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -144,7 +144,8 @@ static NTSTATUS dcesrv_lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_ static NTSTATUS dcesrv_lsa_Close(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_Close *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct dcesrv_handle *h; if (transport != NCACN_NP && transport != NCALRPC) { @@ -3622,7 +3623,8 @@ static NTSTATUS dcesrv_lsa_RetrievePrivateData(struct dcesrv_call_state *dce_cal static NTSTATUS dcesrv_lsa_GetUserName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_GetUserName *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); NTSTATUS status = NT_STATUS_OK; const char *account_name; const char *authority_name; diff --git a/source4/rpc_server/lsa/lsa_init.c b/source4/rpc_server/lsa/lsa_init.c index bee6556dfce..4cf79a23460 100644 --- a/source4/rpc_server/lsa/lsa_init.c +++ b/source4/rpc_server/lsa/lsa_init.c @@ -154,7 +154,8 @@ NTSTATUS dcesrv_lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_ NTSTATUS dcesrv_lsa_OpenPolicy2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_OpenPolicy2 *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); NTSTATUS status; struct lsa_policy_state *state; struct dcesrv_handle *handle; @@ -203,7 +204,8 @@ NTSTATUS dcesrv_lsa_OpenPolicy2(struct dcesrv_call_state *dce_call, TALLOC_CTX * NTSTATUS dcesrv_lsa_OpenPolicy(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_OpenPolicy *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct lsa_OpenPolicy2 r2; if (transport != NCACN_NP && transport != NCALRPC) { diff --git a/source4/rpc_server/lsa/lsa_lookup.c b/source4/rpc_server/lsa/lsa_lookup.c index 693c0c97c18..8d92ba89d06 100644 --- a/source4/rpc_server/lsa/lsa_lookup.c +++ b/source4/rpc_server/lsa/lsa_lookup.c @@ -686,7 +686,8 @@ NTSTATUS dcesrv_lsa_LookupSids2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_LookupSids2 *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct lsa_policy_state *state; struct dcesrv_handle *h; @@ -715,7 +716,8 @@ NTSTATUS dcesrv_lsa_LookupSids3(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_LookupSids3 *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct dcerpc_auth *auth_info = dce_call->conn->auth_state.auth_info; struct lsa_policy_state *policy_state; struct lsa_LookupSids2 q; @@ -773,7 +775,8 @@ NTSTATUS dcesrv_lsa_LookupSids3(struct dcesrv_call_state *dce_call, NTSTATUS dcesrv_lsa_LookupSids(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_LookupSids *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct lsa_LookupSids2 r2; NTSTATUS status; uint32_t i; @@ -911,7 +914,8 @@ NTSTATUS dcesrv_lsa_LookupNames3(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_LookupNames3 *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct lsa_policy_state *policy_state; struct dcesrv_handle *policy_handle; @@ -938,7 +942,8 @@ NTSTATUS dcesrv_lsa_LookupNames3(struct dcesrv_call_state *dce_call, NTSTATUS dcesrv_lsa_LookupNames4(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_LookupNames4 *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct dcerpc_auth *auth_info = dce_call->conn->auth_state.auth_info; struct lsa_policy_state *policy_state; struct lsa_LookupNames3 q; @@ -998,7 +1003,8 @@ NTSTATUS dcesrv_lsa_LookupNames2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_LookupNames2 *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct lsa_policy_state *state; struct dcesrv_handle *h; uint32_t i; @@ -1093,7 +1099,8 @@ NTSTATUS dcesrv_lsa_LookupNames2(struct dcesrv_call_state *dce_call, NTSTATUS dcesrv_lsa_LookupNames(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_LookupNames *r) { - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); struct lsa_LookupNames2 r2; NTSTATUS status; uint32_t i; diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index 7279fe02f72..e2f5f081b78 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -4296,7 +4296,8 @@ static NTSTATUS dcesrv_samr_ValidatePassword(struct dcesrv_call_state *dce_call, DATA_BLOB password; enum samr_ValidationStatus res; NTSTATUS status; - enum dcerpc_transport_t transport = dce_call->conn->endpoint->ep_description->transport; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(dce_call->conn->endpoint->ep_description); if (transport != NCACN_IP_TCP && transport != NCALRPC) { DCESRV_FAULT(DCERPC_FAULT_ACCESS_DENIED); -- cgit