pidl: Set dce_call in pipes_struct before dispatching call
authorSamuel Cabrero <scabrero@suse.de>
Tue, 29 Oct 2019 11:36:30 +0000 (12:36 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 24 May 2020 23:55:37 +0000 (23:55 +0000)
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
source3/rpc_server/rpc_pipes.h
source3/rpc_server/spoolss/srv_iremotewinspool.c

index 2c75072889237d4cc378035afae02920255ed270..18ebdb8c7e388ab8785fdfe476c7efb11516fbda 100644 (file)
@@ -344,6 +344,7 @@ sub boilerplate_iface($)
        $self->pidl("p = dcesrv_get_pipes_struct(dce_call->conn);");
        $self->pidl("/* Update pipes struct opnum */");
        $self->pidl("p->opnum = opnum;");
+       $self->pidl("p->dce_call = dce_call;");
        $self->pidl("/* Update pipes struct session info */");
        $self->pidl("pipe_session_info = p->session_info;");
        $self->pidl("p->session_info = dce_call->auth_state->session_info;");
@@ -388,6 +389,7 @@ sub boilerplate_iface($)
        $self->pidl("}");
        $self->pidl("");
 
+       $self->pidl("p->dce_call = NULL;");
        $self->pidl("/* Restore session info */");
        $self->pidl("p->session_info = pipe_session_info;");
        $self->pidl("p->auth.auth_type = 0;");
index 9df438d33a5259cc5394585191f7ab968f733194..0ab464bc0930114c4ef53bfbc269ed4bf0b736fa 100644 (file)
@@ -96,6 +96,7 @@ struct pipes_struct {
 
        /* handle database to use on this pipe. */
        struct handle_list *pipe_handles;
+       struct dcesrv_call_state *dce_call;
 
        /* call id retrieved from the pdu header */
        uint32_t call_id;
index 9e064a84b9a0841bc972e7ff2472ae4ca483777a..368c33508f5dc5a6e5aedbdfea161a26a377d030 100644 (file)
@@ -131,6 +131,7 @@ static NTSTATUS iremotewinspool__op_dispatch_internal(struct dcesrv_call_state *
        p = dcesrv_get_pipes_struct(dce_call->conn);
        /* Update pipes struct opnum */
        p->opnum = opnum;
+       p->dce_call = dce_call;
        /* Update pipes struct session info */
        pipe_session_info = p->session_info;
        p->session_info = dce_call->auth_state->session_info;
@@ -1268,6 +1269,7 @@ fail:
                unbecome_authenticated_pipe_user();
        }
 
+       p->dce_call = NULL;
        /* Restore session info */
        p->session_info = pipe_session_info;
        p->auth.auth_type = 0;