startui: Remove /tmp/launch.sock as root
All checks were successful
Build and test / build (push) Successful in 1m51s

Fixes #47.
This avoids permission errors.
This commit is contained in:
apio 2024-09-07 17:33:32 +02:00
parent bb6759986e
commit e7d361ca51
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -95,6 +95,8 @@ Result<int> 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<int> 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<StringView>(launch_command, 1), pw->pw_uid, pw->pw_gid, groups.slice());
},