From a4f57572e65f97b2ea9ca748b5ad2762913b4703 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:57:55 +0100 Subject: [PATCH] sesman: Copy IP address to pre_session_item struct struct pre_session_item has an entry for the start_ip_addr which is not being filled in. This is not normally needed, as the IP address of the session is passed into the session another way, but it is needed if the session selection Policy contains the 'I' selector. --- sesman/scp_process.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sesman/scp_process.c b/sesman/scp_process.c index f05e7db4..8105fc6b 100644 --- a/sesman/scp_process.c +++ b/sesman/scp_process.c @@ -102,6 +102,14 @@ process_sys_login_request(struct pre_session_item *psi) } else { + /* + * Copy the IP address of the requesting user, anticipating a + * successful login. We need this so we can search for a session + * with a matching IP address if required. + */ + g_snprintf(psi->start_ip_addr, sizeof(psi->start_ip_addr), + "%s", ip_addr); + /* Create a sesexec process to handle the login * * We won't check for the user being valid here, as this might