Compare commits

...

2 Commits

Author SHA1 Message Date
ad3cea7e78
gui: Rename "launch" to "execd"
All checks were successful
Build and test / build (push) Successful in 1m42s
2024-12-11 20:34:47 +01:00
865a913502
wind: Fix help message when unprivileged
wind --user=<NAME> is not supported anymore. We'll setuid() and setgid() to wind:wind on our own.
2024-12-11 20:30:40 +01:00
7 changed files with 17 additions and 17 deletions

View File

@ -11,7 +11,7 @@ add_subdirectory(libui)
add_subdirectory(wind)
add_subdirectory(apps)
luna_service(launch.cpp launch)
luna_service(execd.cpp execd)
luna_service(run.cpp run)
luna_service(loginui.cpp loginui)
target_link_libraries(loginui PRIVATE ui)

View File

@ -115,7 +115,7 @@ Result<int> luna_main(int, char**)
TRY(os::EventLoop::the().register_signal_handler(SIGQUIT, sigquit_handler));
launcher_client = TRY(os::IPC::Client::connect("/tmp/launch.sock", false));
launcher_client = TRY(os::IPC::Client::connect("/tmp/execd.sock", false));
ui::Rect screen = app.screen_rect();

View File

@ -1,5 +1,5 @@
/**
* @file launch.cpp
* @file execd.cpp
* @author apio (cloudapio.eu)
* @brief Background process that handles detached launching of apps.
*
@ -42,7 +42,7 @@ void handle_ipc_message(os::IPC::ClientConnection& client, u8 id, void*)
switch (id)
{
case os::Launcher::LAUNCH_DETACHED_ID: handle_launch_detached_message(client); break;
default: os::eprintln("launch: Invalid IPC message from client!"); return;
default: os::eprintln("execd: Invalid IPC message from client!"); return;
}
}
@ -55,11 +55,11 @@ Result<int> luna_main(int argc, char** argv)
{
TRY(os::Security::pledge("stdio wpath cpath unix proc exec", NULL));
StringView socket_path = "/tmp/launch.sock";
StringView socket_path = "/tmp/execd.sock";
os::ArgumentParser parser;
parser.add_description("Background process that handles detached launching of apps."_sv);
parser.add_system_program_info("launch"_sv);
parser.add_system_program_info("execd"_sv);
parser.parse(argc, argv);
signal(SIGCHLD, sigchld_handler);
@ -87,7 +87,7 @@ Result<int> luna_main(int argc, char** argv)
if (fds[0].revents & POLLIN)
{
auto client = TRY(server->accept());
os::println("launch: New client connected!");
os::println("execd: New client connected!");
TRY(fds.try_append({ .fd = client.fd(), .events = POLLIN, .revents = 0 }));
auto connection = TRY(os::IPC::ClientConnection::adopt_connection(move(client)));
@ -99,7 +99,7 @@ Result<int> luna_main(int argc, char** argv)
if (fds[i + 1].revents & POLLIN) clients[i]->check_for_messages();
if (fds[i + 1].revents & POLLHUP)
{
os::println("launch: Client %zu disconnected", i);
os::println("execd: Client %zu disconnected", i);
fds.remove_at(i + 1);
auto client = clients.remove_at(i);
client->disconnect();

View File

@ -22,7 +22,7 @@ Result<int> luna_main(int argc, char** argv)
parser.add_positional_argument(program, "program", true);
parser.parse(argc, argv);
OwnedPtr<os::IPC::Client> launcher_client = TRY(os::IPC::Client::connect("/tmp/launch.sock", false));
OwnedPtr<os::IPC::Client> launcher_client = TRY(os::IPC::Client::connect("/tmp/execd.sock", false));
os::println("Requesting to start program '%s'...", program.chars());

View File

@ -73,8 +73,8 @@ Result<int> luna_main(int argc, char** argv)
if (geteuid() != 0)
{
os::eprintln("error: wind must be run as root to initialize resources, run with --user=<USERNAME> to drop "
"privileges afterwards");
os::eprintln("error: wind must be run as root to initialize resources, the server will drop "
"privileges automatically afterwards");
return 1;
}

View File

@ -123,17 +123,17 @@ Result<int> luna_main(int argc, char** argv)
setenv("HOME", pw->pw_dir, 1);
setenv("SHELL", pw->pw_shell, 1);
// We also need to wait for this one, since taskbar requires launch.sock.
// We also need to wait for this one, since taskbar requires execd.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());
(void)os::FileSystem::remove("/tmp/execd.sock");
StringView execd_command[] = { "/usr/bin/execd" };
spawn_process_as_user(Slice<StringView>(execd_command, 1), pw->pw_uid, pw->pw_gid, groups.slice());
},
1000);
if (!success)
{
os::eprintln("startui: failed to start launch server, timed out");
os::eprintln("startui: failed to start execd, timed out");
return 1;
}

View File

@ -21,7 +21,7 @@ Result<int> luna_main(int argc, char** argv)
return err(errno);
}
if (strstr(ps.ps_name, "/usr/bin/launch")) { kill(ps.ps_pid, SIGTERM); }
if (strstr(ps.ps_name, "/usr/bin/execd")) { kill(ps.ps_pid, SIGTERM); }
}
return 0;