From 30675624798eee29ae2ae34075e51084dc8b8218 Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Fri, 28 Oct 2022 10:26:22 -0400 Subject: [PATCH 1/2] Closing recording file descriptors on more occasions --- pyrdp/mitm/TCPMITM.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrdp/mitm/TCPMITM.py b/pyrdp/mitm/TCPMITM.py index faafc98de..831945cfd 100644 --- a/pyrdp/mitm/TCPMITM.py +++ b/pyrdp/mitm/TCPMITM.py @@ -99,10 +99,10 @@ def onClientDisconnection(self, reason): if self.recorder.recordFilename: self.statCounter.logReport(self.log, {"replayFilename": self.recorder.recordFilename}) - self.recorder.finalize() else: self.statCounter.logReport(self.log) + self.recorder.finalize() self.server.disconnect(True) self.state.clientIp = None @@ -123,6 +123,7 @@ def onServerDisconnection(self, reason): """ self.recordConnectionClose() + self.recorder.finalize() self.log.info("Server connection closed. %(reason)s", {"reason": reason.value}) self.client.disconnect(True) From 8efd2bf9950074ebb84b79a9cf5500b5f0e67574 Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Fri, 28 Oct 2022 10:28:53 -0400 Subject: [PATCH 2/2] Updated CHANGELOG --- CHANGELOG.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 79a0a5f6f..080451fb5 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -45,7 +45,7 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[ * Fixed `pyrdp-player` on macOS platforms ({uri-issue}362[#362]) * Fixed `pyrdp-convert` pcap processing when victim IP and MITM IP are the same ({uri-issue}366[#366]) * Fixed NLA redirection problems if original target and NLA redirection target are the same ({uri-issue}342[#342], {uri-issue}343[#343]) -* Fixed leak of file descriptors due to missing close on replay file recording ({uri-issue}392[#392], {uri-issue}413[#413]) +* Fixed leak of file descriptors due to missing close on replay file recording ({uri-issue}392[#392], {uri-issue}413[#413], {uri-issue}415[#415]) * Added a missing dependency for the GUI on Ubuntu 20.04 LTS ({uri-issue}348[#348], {uri-issue}351[#351], {uri-issue}355[#355]) * No longer assuming every connection will have VirtualChannels ({uri-issue}375[#375]) * Some minor protocol-level fixes ({uri-issue}408[#408])