summaryrefslogtreecommitdiff
path: root/source3/printing/spoolssd.c
diff options
context:
space:
mode:
authorSamuel Cabrero <scabrero@samba.org>2019-12-05 11:45:54 +0100
committerSamuel Cabrero <scabrero@sn-devel-184>2020-03-20 15:36:35 +0000
commit9bdf3ccde6550093daf7e5bdf4dc25cbd2c9a41d (patch)
tree95601e3629d5f466fdb5100ec2d95c36fbc95b4d /source3/printing/spoolssd.c
parent0c326e9688d09c73e14e1913420bc734ad702d48 (diff)
downloadsamba-9bdf3ccde6550093daf7e5bdf4dc25cbd2c9a41d.tar.gz
s3:rpc_server: Switch to core dcerpc server loop
This commit finally switches the RPC server implementation. At the same we have to do other related changes to keep code compiling and test environments running. First avoid moving the session_info into the allocated pipes_struct memory context as it is owned now by the core RPC server, and the s3compat pidl compiler will update the pipes_struct session_info before dispatching the call with dcesrv_call->auth_state->session_info. Also, fix a segfault in the endpoint mapper daemon when it tries to delete the endpoints previously registered over a NCALRPC connection. If we have: rpc_server : epmapper = external rpc_server : lsarpc = external rpc_daemon : epmd = fork rpc_daemon : lsasd = fork The sequence is: * The endpoint mapper starts (start_epmd in source3/smbd/server.c) * The lsarpc daemon starts (start_lsasd in source3/smbd/server.c) * The lsarpc daemon creates the sockets and registers its endpoints (rpc_ep_register in source3/rpc_server/lsasd.c) * The endpoint registration code opens a NCALRPC connection to the endpoint mapper daemon (ep_register in source3/librpc/rpc/dcerpc_ep.c) and keeps it open to re-register if the endpoint mapper daemon dies (rpc_ep_register_loop in source3/rpc_server/rpc_ep_register.c) * When the endpoint mapper daemon accepts a NCALRPC connection it sets a termination function (srv_epmapper_delete_endpoints) * Suppose the lsarpc daemon exits. The NCALRPC connection termination function is called. * The termination function tries to delete all endpoints registered by that connection by calling _epm_Delete * _epm_Delete calls is_privileged_pipe which access to pipes_struct->session_info. As the call to _epm_Delete occurs outside of the PIDL generated code, the pipes_stuct->session_info is NULL. This commit also sets pipes_struct->session_info from the dcerpc_connection before calling _epm_Delete. As the core rpc server supports security context multiplexing we need to pass the dcesrv_connection to the termination function and let the implementation pick a auth context. In the case of the endpoint mapper the termination function has to pick one of type NCALRPC_AS_SYSTEM to check if the connection is privileged and delete the endpoints registered by the connection being closed. Finally, the samba.tests.dcerpc.raw_protocol testsuite passes against the ad_member environment. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/printing/spoolssd.c')
-rw-r--r--source3/printing/spoolssd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index 3bd7e55001c..70d14914f5b 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -341,7 +341,8 @@ static int spoolss_children_main(struct tevent_context *ev_ctx,
return ret;
}
-static void spoolss_client_terminated(struct pipes_struct *p, void *pvt)
+static void spoolss_client_terminated(struct dcesrv_connection *conn,
+ void *pvt)
{
struct spoolss_children_data *data;