s4:rpc_server: make use of dcerpc_binding_get_transport()
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jan 2014 18:01:34 +0000 (19:01 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 13 Feb 2014 10:54:17 +0000 (11:54 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/rpc_server/dcerpc_server.c
source4/rpc_server/lsa/dcesrv_lsa.c
source4/rpc_server/lsa/lsa_init.c
source4/rpc_server/lsa/lsa_lookup.c
source4/rpc_server/samr/dcesrv_samr.c

index c6d0d84214ac86ff0ee87095919fbb62eda7fb0a..fb652c5064928d938f40de7aef3a9617ddb890bb 100644 (file)
@@ -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);
 
index d8a5aefcd9ddf8f0f6d7d6e42a782e05e3b3324b..a7fc1862c53323168486928d9a1a315539aa4dc5 100644 (file)
@@ -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;
index bee6556dfceb083b3d7aa4ae0a3c698561ef497a..4cf79a2346022f5d6c6ff7c8ab09bd12cd3910e5 100644 (file)
@@ -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) {
index 693c0c97c184c49dca4e6d1870656ce707dbe7b6..8d92ba89d06610fe75555b4dacd23989dc4a2a5b 100644 (file)
@@ -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;
index 7279fe02f724f1ff6defa3a749b3cbcbe67c260a..e2f5f081b7867353a874bbc4ae5ea4dd3e5dbbaf 100644 (file)
@@ -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);