summaryrefslogtreecommitdiff
path: root/Userland/Services/SystemServer/Service.cpp
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2022-07-19 21:01:04 +0200
committerLinus Groh <mail@linusgroh.de>2022-08-14 21:52:35 +0100
commit1b36348d8b9676546e81eb86c2336dcdf8ff4e2f (patch)
tree481684a0c5aa9d21357863ce9fb5961cf7199e5b /Userland/Services/SystemServer/Service.cpp
parentc5b7c9f4799508ed6f940755243ab47dc55558ce (diff)
downloadserenity-1b36348d8b9676546e81eb86c2336dcdf8ff4e2f.zip
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.
Diffstat (limited to 'Userland/Services/SystemServer/Service.cpp')
-rw-r--r--Userland/Services/SystemServer/Service.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Services/SystemServer/Service.cpp b/Userland/Services/SystemServer/Service.cpp
index 2f8d6f57be..c8a4da259b 100644
--- a/Userland/Services/SystemServer/Service.cpp
+++ b/Userland/Services/SystemServer/Service.cpp
@@ -322,7 +322,7 @@ Service::Service(Core::ConfigFile const& config, StringView name)
// Need i here to iterate along with all other vectors.
for (unsigned i = 0; i < socket_paths.size(); i++) {
- String& path = socket_paths.at(i);
+ auto const path = Core::Account::parse_path_with_uid(socket_paths.at(i), m_account.has_value() ? m_account.value().uid() : Optional<uid_t> {});
// Socket path (plus NUL) must fit into the structs sent to the Kernel.
VERIFY(path.length() < UNIX_PATH_MAX);