From 99b4dc9929d02e30061a97eaf63ec1fea45077f3 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 20 Jan 2016 22:58:39 +0000 Subject: [PATCH] Support connecting to other users sessions by using / --- src/remote.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/remote.cc b/src/remote.cc index e15d4d0ff..ca9e987cc 100644 --- a/src/remote.cc +++ b/src/remote.cc @@ -415,7 +415,10 @@ static sockaddr_un session_addr(StringView session) { sockaddr_un addr; addr.sun_family = AF_UNIX; - format_to(addr.sun_path, "/tmp/kakoune/{}/{}", getpwuid(geteuid())->pw_name, session); + if (find(session, '/')!= session.end()) + format_to(addr.sun_path, "/tmp/kakoune/{}", session); + else + format_to(addr.sun_path, "/tmp/kakoune/{}/{}", getpwuid(geteuid())->pw_name, session); return addr; }