mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
LibCore+LibIPC: Recognise %uid in path
This patch allows to insert "%uid" in `IPC_CLIENT_CONNECTION` declaration and in SystemServer's ini files. This pattern is replaced then replaced by the UID of the owner of the service. It opens a path for seamlessly managed, per-user portal.
This commit is contained in:
parent
c5b7c9f479
commit
1b36348d8b
Notes:
sideshowbarker
2024-07-17 09:56:35 +09:00
Author: https://github.com/LucasChollet
Commit: 1b36348d8b
Pull-request: https://github.com/SerenityOS/serenity/pull/14673
Reviewed-by: https://github.com/linusg
21 changed files with 33 additions and 21 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibCore/Account.h>
|
||||
#include <LibCore/Stream.h>
|
||||
#include <LibIPC/Connection.h>
|
||||
|
||||
|
@ -17,7 +18,8 @@ public:
|
|||
template<typename Klass = klass, class... Args> \
|
||||
static ErrorOr<NonnullRefPtr<klass>> try_create(Args&&... args) \
|
||||
{ \
|
||||
auto socket = TRY(Core::Stream::LocalSocket::connect(socket_path)); \
|
||||
auto parsed_socket_path { Core::Account::parse_path_with_uid(socket_path) }; \
|
||||
auto socket = TRY(Core::Stream::LocalSocket::connect(move(parsed_socket_path))); \
|
||||
/* We want to rate-limit our clients */ \
|
||||
TRY(socket->set_blocking(true)); \
|
||||
\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue