From 3197c1793a229ffa13c22f70bf01f669b41449b8 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Tue, 4 Oct 2022 16:19:08 +0200 Subject: [PATCH] Base: Launch Clipboard at session start-up The clipboard service hasn't been ported to user-based portals with others services as it is needed at `GUI::Application` creation and thus before the first login, as the `LoginServer` needs one. This problem as been solved thanks to session-based portals, a clipboard portal is now created at boot for the "login" session and another for each "user" session. With a user-based portal, the "login" portal would have needed to be created for the `root` user, exposing us to security issues. It now, can be owned by the `window` user. --- Base/etc/SystemServer.ini | 4 ++-- Base/home/anon/.config/SystemServer.ini | 5 +++++ Userland/Libraries/LibGUI/Clipboard.cpp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Base/etc/SystemServer.ini b/Base/etc/SystemServer.ini index e46fc17cf5f..31e0d90f82a 100644 --- a/Base/etc/SystemServer.ini +++ b/Base/etc/SystemServer.ini @@ -20,10 +20,10 @@ User=window StdIO=/dev/tty0 [Clipboard] -Socket=/tmp/portal/clipboard +Socket=/tmp/session/%sid/portal/clipboard SocketPermissions=600 Priority=low -User=anon +User=window [Shell@tty0] Executable=/bin/Shell diff --git a/Base/home/anon/.config/SystemServer.ini b/Base/home/anon/.config/SystemServer.ini index 874d08342e1..aca32a25566 100644 --- a/Base/home/anon/.config/SystemServer.ini +++ b/Base/home/anon/.config/SystemServer.ini @@ -1,3 +1,8 @@ +[Clipboard] +Socket=/tmp/session/%sid/portal/clipboard +SocketPermissions=600 +Priority=low + [ConfigServer] Socket=/tmp/session/%sid/portal/config SocketPermissions=600 diff --git a/Userland/Libraries/LibGUI/Clipboard.cpp b/Userland/Libraries/LibGUI/Clipboard.cpp index a0b8598d2a1..7246d854ad0 100644 --- a/Userland/Libraries/LibGUI/Clipboard.cpp +++ b/Userland/Libraries/LibGUI/Clipboard.cpp @@ -16,7 +16,7 @@ namespace GUI { class ConnectionToClipboardServer final : public IPC::ConnectionToServer , public ClipboardClientEndpoint { - IPC_CLIENT_CONNECTION(ConnectionToClipboardServer, "/tmp/portal/clipboard"sv) + IPC_CLIENT_CONNECTION(ConnectionToClipboardServer, "/tmp/session/%sid/portal/clipboard"sv) private: ConnectionToClipboardServer(NonnullOwnPtr socket)