Browser: second fix for linked socket path

* Fix #8702
This commit is contained in:
Jonathan White 2022-10-29 12:29:50 -04:00
parent c231abe13d
commit 9b5b1d6dce
No known key found for this signature in database
GPG Key ID: 440FC65F2E0C6E01

View File

@ -38,14 +38,15 @@ namespace BrowserShared
// Put the socket in a dedicated directory.
// This directory will be easily mountable by sandbox containers.
QString subPath = path + "/app/org.keepassxc.KeePassXC/";
QString subPath = path + "/app/org.keepassxc.KeePassXC";
QDir().mkpath(subPath);
QString socketPath = subPath + serverName;
#ifndef KEEPASSXC_DIST_FLATPAK
QFile::remove(socketPath);
// Create a symlink at the legacy location for backwards compatibility.
QFile::link(socketPath, path + serverName);
const auto origSocketPath = path + serverName;
QFile::remove(origSocketPath);
QFile::link(socketPath, origSocketPath);
#endif
return socketPath;