mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 20:37:35 +00:00
LaunchServer+SystemServer: Move the portal to a user-specific directory
Various changes are needed to support this: - The directory is created by Core::Account on login (and located in /tmp). - Service's sockets are now deleted on exit (to allow re-creation) - SystemServer needs to handle SIGTERM to correctly destroy services.
This commit is contained in:
parent
cc0d53d6a6
commit
70846d701c
21 changed files with 47 additions and 26 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <AK/Random.h>
|
||||
#include <AK/ScopeGuard.h>
|
||||
#include <LibCore/Account.h>
|
||||
#include <LibCore/Directory.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibCore/UmaskScope.h>
|
||||
#include <errno.h>
|
||||
|
@ -150,6 +151,10 @@ bool Account::login() const
|
|||
if (setuid(m_uid) < 0)
|
||||
return false;
|
||||
|
||||
auto const temporary_directory = String::formatted("/tmp/{}", m_uid);
|
||||
if (auto result = Core::Directory::create(temporary_directory, Core::Directory::CreateDirectories::No); result.is_error())
|
||||
dbgln("{}", result.release_error());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ auto Launcher::Details::from_details_str(String const& details_str) -> NonnullRe
|
|||
class ConnectionToLaunchServer final
|
||||
: public IPC::ConnectionToServer<LaunchClientEndpoint, LaunchServerEndpoint>
|
||||
, public LaunchClientEndpoint {
|
||||
IPC_CLIENT_CONNECTION(ConnectionToLaunchServer, "/tmp/portal/launch")
|
||||
IPC_CLIENT_CONNECTION(ConnectionToLaunchServer, "/tmp/100/portal/launch")
|
||||
private:
|
||||
ConnectionToLaunchServer(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
|
||||
: IPC::ConnectionToServer<LaunchClientEndpoint, LaunchServerEndpoint>(*this, move(socket))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue