1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

dcesrv_core: Add dcesrv_loop_next_packet()

This is used by the helpers of samba-dcerpcd: When accepting a DCERPC
client, normally the server engine would read the initial bind
packet. In case of samba-dcerpcd the bind packet will already be read
from the socket, so we need to inject it into the rpc server engine
externally.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Volker Lendecke 2021-01-21 15:28:31 +01:00
parent 95659031e4
commit da90c02b16
2 changed files with 27 additions and 0 deletions

View File

@ -2909,6 +2909,28 @@ static void dcesrv_read_fragment_done(struct tevent_req *subreq)
return;
}
dcesrv_loop_next_packet(dce_conn, pkt, buffer);
}
/**
* @brief Start the dcesrv loop, inducing the bind as a blob
*
* Like dcesrv_connection_loop_start() but used from connections
* where the caller has already read the dcerpc bind packet from
* the socket and is available as a DATA_BLOB.
*
* @param[in] dce_conn The connection to start
* @param[in] pkt The parsed bind packet
* @param[in] buffer The full binary bind including auth data
*/
void dcesrv_loop_next_packet(
struct dcesrv_connection *dce_conn,
struct ncacn_packet *pkt,
DATA_BLOB buffer)
{
struct tevent_req *subreq = NULL;
NTSTATUS status;
status = dcesrv_process_ncacn_packet(dce_conn, pkt, buffer);
if (!NT_STATUS_IS_OK(status)) {
dcesrv_terminate_connection(dce_conn, nt_errstr(status));

View File

@ -640,6 +640,11 @@ _PUBLIC_ void dcesrv_sock_report_output_data(struct dcesrv_connection *dce_conn)
_PUBLIC_ NTSTATUS dcesrv_connection_loop_start(struct dcesrv_connection *conn);
_PUBLIC_ void dcesrv_loop_next_packet(
struct dcesrv_connection *dce_conn,
struct ncacn_packet *pkt,
DATA_BLOB buffer);
_PUBLIC_ NTSTATUS dcesrv_call_dispatch_local(struct dcesrv_call_state *call);
_PUBLIC_ const struct dcesrv_interface *find_interface_by_syntax_id(