s4:rpc_server/common: make use dcesrv_call_session_info()
authorStefan Metzmacher <metze@samba.org>
Sat, 3 Nov 2018 00:19:51 +0000 (01:19 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 12 Jan 2019 02:13:33 +0000 (03:13 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/rpc_server/common/forward.c
source4/rpc_server/common/server_info.c

index 45ce6dc..7d60bd7 100644 (file)
@@ -72,7 +72,8 @@ void dcesrv_irpc_forward_rpc_call(struct dcesrv_call_state *dce_call, TALLOC_CTX
        struct dcesrv_forward_state *st;
        struct dcerpc_binding_handle *binding_handle;
        struct tevent_req *subreq;
-       struct security_token *token;
+       struct auth_session_info *session_info =
+               dcesrv_call_session_info(dce_call);
 
        st = talloc(mem_ctx, struct dcesrv_forward_state);
        if (st == NULL) {
@@ -105,8 +106,8 @@ void dcesrv_irpc_forward_rpc_call(struct dcesrv_call_state *dce_call, TALLOC_CTX
        dcerpc_binding_handle_set_timeout(binding_handle, timeout);
 
        /* add security token to the handle*/
-       token = dce_call->conn->auth_state.session_info->security_token;
-       irpc_binding_handle_add_security_token(binding_handle, token);
+       irpc_binding_handle_add_security_token(binding_handle,
+                                              session_info->security_token);
 
        /* forward the call */
        subreq = dcerpc_binding_handle_call_send(st, dce_call->event_ctx,
index 836e6d1..6e475bc 100644 (file)
@@ -206,10 +206,12 @@ struct ldb_context *dcesrv_samdb_connect_as_system(
                dce_call->conn->remote_address,
                0);
        if (samdb) {
+               struct auth_session_info *session_info =
+                       dcesrv_call_session_info(dce_call);
                ldb_set_opaque(
                        samdb,
                        DSDB_NETWORK_SESSION_INFO,
-                       dce_call->conn->auth_state.session_info);
+                       session_info);
        }
        return samdb;
 }