From e7d361ca51e765f7999341a672534c5796fc45ef Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 7 Sep 2024 17:33:32 +0200 Subject: [PATCH] startui: Remove /tmp/launch.sock as root Fixes #47. This avoids permission errors. --- system/startui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/startui.cpp b/system/startui.cpp index 65bd4ca3..86f9ae88 100644 --- a/system/startui.cpp +++ b/system/startui.cpp @@ -95,6 +95,8 @@ Result luna_main(int argc, char** argv) setsid(); // First of all, start the display server, in case we haven't been started by loginui. + // FIXME: What if we're started after a wind process has previously run but exited, so we think there's a wind + // process when there isn't. if (!os::FileSystem::exists("/tmp/wind.sock")) { // We need to wait for this one, since its sockets are required later. @@ -121,6 +123,7 @@ Result luna_main(int argc, char** argv) // We also need to wait for this one, since taskbar requires launch.sock. bool success = os::IPC::Notifier::run_and_wait( [&] { + (void)os::FileSystem::remove("/tmp/launch.sock"); StringView launch_command[] = { "/usr/bin/launch" }; spawn_process_as_user(Slice(launch_command, 1), pw->pw_uid, pw->pw_gid, groups.slice()); },