From e55a3f694b130374a732af0f3337a1dbacf162e2 Mon Sep 17 00:00:00 2001 From: Sebastian Livoni <29739749+sebastianlivoni@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:47:43 +0100 Subject: [PATCH] Change BrowserShared socket path to group container --- src/browser/BrowserShared.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/browser/BrowserShared.cpp b/src/browser/BrowserShared.cpp index 6fd2cf7ee..eac634183 100644 --- a/src/browser/BrowserShared.cpp +++ b/src/browser/BrowserShared.cpp @@ -53,7 +53,18 @@ namespace BrowserShared #elif defined(Q_OS_WIN) // Windows uses named pipes return serverName + "_" + qgetenv("USERNAME"); -#else // Q_OS_MACOS and others +#elif defined(Q_OS_MACOS) + // Get the home directory and append the desired subdirectory + QString homePath = QDir::homePath(); + QString subPath = homePath + "/Library/Group Containers/org.keepassxc.KeePassXC"; + + // Make sure the directory exists + QDir().mkpath(subPath); + + QString socketPath = subPath + serverName; + + return socketPath; +#else // others return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + serverName; #endif }