diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-01-20 22:58:39 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-01-20 22:58:39 +0000 |
| commit | 99b4dc9929d02e30061a97eaf63ec1fea45077f3 (patch) | |
| tree | 01d88203b2e2b3bcea2fd2a55285fc675582f159 /src | |
| parent | 2bc24d6889abdf892a17c73ccd82f22dd1765a29 (diff) | |
Support connecting to other users sessions by using <user>/<session>
Diffstat (limited to 'src')
| -rw-r--r-- | src/remote.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/remote.cc b/src/remote.cc index e15d4d0f..ca9e987c 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; } |
