From 5865cf4dd98bfe9c780d4ed4b8fe630a4a9949d0 Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Mon, 18 Feb 2019 20:27:31 +0100 Subject: [PATCH] s3:spoolss: Set remote and local address for accepted connections Signed-off-by: Samuel Cabrero Reviewed-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- source3/printing/spoolssd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c index bb0c03c32a..cfd275418d 100644 --- a/source3/printing/spoolssd.c +++ b/source3/printing/spoolssd.c @@ -381,8 +381,6 @@ static void spoolss_client_terminated(void *pvt) struct spoolss_new_client { struct spoolss_children_data *data; - struct tsocket_address *srv_addr; - struct tsocket_address *cli_addr; }; static void spoolss_handle_client(struct tevent_req *req); @@ -426,12 +424,14 @@ static void spoolss_handle_client(struct tevent_req *req) const DATA_BLOB ping = data_blob_null; int ret; int sd; + struct tsocket_address *srv_addr = NULL; + struct tsocket_address *cli_addr = NULL; client = tevent_req_callback_data(req, struct spoolss_new_client); data = client->data; - ret = prefork_listen_recv(req, client, &sd, NULL, - &client->srv_addr, &client->cli_addr); + ret = prefork_listen_recv(req, data, &sd, NULL, + &srv_addr, &cli_addr); /* this will free the request too */ talloc_free(client); @@ -452,8 +452,8 @@ static void spoolss_handle_client(struct tevent_req *req) data->msg_ctx, NCACN_NP, SPOOLSS_PIPE_NAME, - NULL, /* remote client address */ - NULL, /* local server address */ + cli_addr, + srv_addr, sd, NULL, /* disconnect function */ spoolss_client_terminated, -- 2.34.1