From c0980268604df92afa5df6bb4fa1bc284e86a004 Mon Sep 17 00:00:00 2001 From: echicken <echicken@bbs.electronicchicken.com> Date: Fri, 24 Feb 2023 18:30:43 +0000 Subject: [PATCH] Avoid ip info probably not pertaining to this client --- xtrn/wttr.in/locator.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xtrn/wttr.in/locator.js b/xtrn/wttr.in/locator.js index 55c17512f8..9ee9dc18eb 100644 --- a/xtrn/wttr.in/locator.js +++ b/xtrn/wttr.in/locator.js @@ -14,6 +14,8 @@ function getAddress() { */ const f = new File(system.temp_path + 'sbbs-ws-' + client.socket.remote_port + '.ip'); if (!f.exists) return; + if (f.date < client.connect_time) return; // Avoid stale ws ip files + if (f.date - client.connect_time > 5) return; // Avoid ws ip files probably not belonging to this user (5 seconds arbitrary) if (!f.open('r')) return; const addr = f.read(); f.close(); -- GitLab