diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2021-04-14 21:35:49 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-15 21:04:49 +0200 |
commit | 5b95850e28ce25c7a7af6138aaff7da3f1829f75 (patch) | |
tree | 0b5fb9adfdb1658c6c75cbfc32cb3e135a0c3ff2 /Userland/Libraries/LibCore/LocalServer.h | |
parent | 4316e817dbe4147d714b9e5914452e9629358cb7 (diff) | |
download | serenity-5b95850e28ce25c7a7af6138aaff7da3f1829f75.zip |
SystemServer+LibCore: Allow service to request multiple sockets
SystemServer only allowed a single socket to be created for a service
before this. Now, SystemServer will allow any amount of sockets. The
sockets can be defined like so:
[SomeService]
Socket=/tmp/portal/socket1,/tmp/portal/socket2,/tmp/portal/socket3
SocketPermissions=660,600
The last item in SocketPermissions is applied to the remainder of the
sockets in the Socket= line, so multiple sockets can have the same
permissions without having to repeat them.
Defining multiple sockets is not allowed for socket-activated services
at the moment, and wouldn't make much sense anyway.
This patch also makes socket takeovers more robust by removing the
assumption that the socket will always be passed in fd 3. Now, the
SOCKET_TAKEOVER environment variable carries information about which
endpoint corresponds to which socket, like so:
SOCKET_TAKEOVER=/tmp/portal/socket1:3 /tmp/portal/socket2:4
and LocalServer/LocalService will parse this automatically and select
the correct one. The old behavior of getting the default socket is
preserved so long as the service only requests a single socket in
SystemServer.ini.
Diffstat (limited to 'Userland/Libraries/LibCore/LocalServer.h')
-rw-r--r-- | Userland/Libraries/LibCore/LocalServer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/LocalServer.h b/Userland/Libraries/LibCore/LocalServer.h index bcb4fa6c00..912de55225 100644 --- a/Userland/Libraries/LibCore/LocalServer.h +++ b/Userland/Libraries/LibCore/LocalServer.h @@ -36,7 +36,7 @@ class LocalServer : public Object { public: virtual ~LocalServer() override; - bool take_over_from_system_server(); + bool take_over_from_system_server(String const& path = String()); bool is_listening() const { return m_listening; } bool listen(const String& address); |