summaryrefslogtreecommitdiff
path: root/src/remote.hh
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2024-11-11 13:28:27 +0100
committerMaxime Coste <mawww@kakoune.org>2024-11-12 08:54:19 +1100
commitd86e505fad397251a8a618c545a7d78f43a70a34 (patch)
tree75faa59c1fafa0e9b510b88e5eee12ec40fba3a8 /src/remote.hh
parent919934177d6f3149b523c476ab41c37e1ba51034 (diff)
Fail rename-session instead of creating overlong socket paths
Commit 9cf8a3ccd (Check for buffer overflow when constructing the socket path., 2022-04-07) made $ kak -s $(printf %0100d) fail but forgot to do the same for $ kak -e "rename-session $(printf %0100d)" which silently succeeds, only to fail at the next $ echo nop | kak -p $(printf %0100d) Fatal error: socket path too long: '/run/user/1000/kakoune/0000...' Let's fail earlier. While at it, don't validate "m_session" redundantly. I'm not sure if we should validate the socket names in "kak -clear"; I guess it doesn't matter.
Diffstat (limited to 'src/remote.hh')
-rw-r--r--src/remote.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/remote.hh b/src/remote.hh
index 99e60cbd..dc6bc41f 100644
--- a/src/remote.hh
+++ b/src/remote.hh
@@ -46,7 +46,7 @@ private:
void send_command(StringView session, StringView command);
String get_user_name();
const String& session_directory();
-String session_path(StringView session);
+String session_path(StringView session, bool assume_valid = false);
struct Server : public Singleton<Server>
{