From 4f4f455f132eda4855ecc2c6329a86dbfd4227e7 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 22 Jan 2021 14:18:21 +0100 Subject: [PATCH] Add a todo for a failsafe for the socket cleanup --- src/common/communication/common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/communication/common.h b/src/common/communication/common.h index e38b5164..a855f9c1 100644 --- a/src/common/communication/common.h +++ b/src/common/communication/common.h @@ -217,6 +217,11 @@ class Sockets { */ virtual ~Sockets() { try { + // TODO: Check whether `base_dir` is actually in `/tmp` or + // `$XDG_RUNTIME_DIR`, don't do anything if it's not. Someone + // has deleted their entire home directory while messing with + // `yabridge-host.exe`'s arguments, and that sounds like + // something that would be easy to prevent. boost::filesystem::remove_all(base_dir); } catch (const boost::filesystem::filesystem_error&) { // There should not be any filesystem errors since only one side