summaryrefslogtreecommitdiff
path: root/src/remote.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-11-06 11:55:56 +0800
committerMaxime Coste <mawww@kakoune.org>2017-11-06 11:55:56 +0800
commit0a081b9f31e80efae0f3bbf07497a8e673b61eaa (patch)
tree9c6b5ded086d6f14902c0f9c8940969a6b3a9538 /src/remote.cc
parent4a00807ad911d454aa453627e54d98c27a2bad50 (diff)
Do not allow rename-session to introduce '/' in session names
Diffstat (limited to 'src/remote.cc')
-rw-r--r--src/remote.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/remote.cc b/src/remote.cc
index 5a785aa1..f5ab1072 100644
--- a/src/remote.cc
+++ b/src/remote.cc
@@ -808,6 +808,9 @@ Server::Server(String session_name)
bool Server::rename_session(StringView name)
{
+ if (contains(name, '/'))
+ throw runtime_error{"Cannot create sessions with '/' in their name"};
+
String old_socket_file = format("{}/kakoune/{}/{}", tmpdir(),
getpwuid(geteuid())->pw_name, m_session);
String new_socket_file = format("{}/kakoune/{}/{}", tmpdir(),