From 3fef6c2069e890c39c296a31bbf3faf2ecbd67e8 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Wed, 12 Oct 2022 13:13:56 -0400 Subject: [PATCH] connection: Move dbus socket to well known path in XDG_RUNTIME_DIR As dbus has now changed to make tmpdir behave the same as dir, socket creation fails when the directory does not exist, and it is no longer automatically removed upon exit. Instead, switch to a well known name under XDG_RUNTIME_DIR, as only one instance of the dbus service can exist at a time, per user. --- connection/serverdbusaddress.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/connection/serverdbusaddress.cpp b/connection/serverdbusaddress.cpp index 67fe0a2..19f46d4 100644 --- a/connection/serverdbusaddress.cpp +++ b/connection/serverdbusaddress.cpp @@ -15,8 +15,8 @@ #include #include - #include +#include #include @@ -61,7 +61,8 @@ DynamicAddress::DynamicAddress() QDBusServer* DynamicAddress::connect() { - QLatin1String dbusAddress("unix:tmpdir=/tmp/maliit-server"); + auto runtimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); + auto dbusAddress = QLatin1String("unix:path=%1/maliit-server").arg(runtimeDir); QDBusServer *server = new QDBusServer(dbusAddress); -- 2.39.0