s4:rpc_server/handles: 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:35 +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/handles.c

index 2362a89..b0cef1c 100644 (file)
@@ -43,6 +43,8 @@ struct dcesrv_handle *dcesrv_handle_create(struct dcesrv_call_state *call,
                                           uint8_t handle_type)
 {
        struct dcesrv_connection_context *context = call->context;
+       struct auth_session_info *session_info =
+               dcesrv_call_session_info(call);
        struct dcesrv_handle *h;
        struct dom_sid *sid;
 
@@ -51,7 +53,7 @@ struct dcesrv_handle *dcesrv_handle_create(struct dcesrv_call_state *call,
         */
        SMB_ASSERT((context->iface->flags & DCESRV_INTERFACE_FLAGS_HANDLES_NOT_USED) == 0);
 
-       sid = &context->conn->auth_state.session_info->security_token->sids[PRIMARY_USER_SID_INDEX];
+       sid = &session_info->security_token->sids[PRIMARY_USER_SID_INDEX];
 
        h = talloc_zero(context->conn->assoc_group, struct dcesrv_handle);
        if (!h) {
@@ -86,6 +88,8 @@ struct dcesrv_handle *dcesrv_handle_lookup(struct dcesrv_call_state *call,
                                           uint8_t handle_type)
 {
        struct dcesrv_connection_context *context = call->context;
+       struct auth_session_info *session_info =
+               dcesrv_call_session_info(call);
        struct dcesrv_handle *h;
        struct dom_sid *sid;
 
@@ -94,7 +98,7 @@ struct dcesrv_handle *dcesrv_handle_lookup(struct dcesrv_call_state *call,
         */
        SMB_ASSERT((context->iface->flags & DCESRV_INTERFACE_FLAGS_HANDLES_NOT_USED) == 0);
 
-       sid = &context->conn->auth_state.session_info->security_token->sids[PRIMARY_USER_SID_INDEX];
+       sid = &session_info->security_token->sids[PRIMARY_USER_SID_INDEX];
 
        if (ndr_policy_handle_empty(p)) {
                /* TODO: we should probably return a NULL handle here */