diff options
author | Michael Schuster <michael@schuster.ms> | 2020-08-18 20:31:11 +0300 |
---|---|---|
committer | Michael Schuster <michael@schuster.ms> | 2020-08-20 19:50:05 +0300 |
commit | 11632da7ea36c8c501866aa220cb28365cf110cc (patch) | |
tree | fcdc42c9cbd40f7c96d24efcd1eba45d98ff1647 | |
parent | 0ba5df597fe707811418a934c73a0c6ded88a90a (diff) |
Windows shell extensions: Change NCUtil Pipe name from ownCloud to APPLICATION_EXECUTABLE
Avoid interference with foreign pipes as this is always a bad idea ;p
Signed-off-by: Michael Schuster <michael@schuster.ms>
-rw-r--r-- | shell_integration/windows/NCUtil/CommunicationSocket.cpp | 4 | ||||
-rw-r--r-- | shell_integration/windows/WinShellExtConstants.h.in | 3 | ||||
-rw-r--r-- | src/gui/socketapi.cpp | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/shell_integration/windows/NCUtil/CommunicationSocket.cpp b/shell_integration/windows/NCUtil/CommunicationSocket.cpp index cda36c1b8..e0ac699ae 100644 --- a/shell_integration/windows/NCUtil/CommunicationSocket.cpp +++ b/shell_integration/windows/NCUtil/CommunicationSocket.cpp @@ -14,6 +14,7 @@ #include "CommunicationSocket.h" #include "StringUtil.h" +#include "WinShellExtConstants.h" #include <iostream> #include <vector> @@ -42,7 +43,8 @@ std::wstring getUserName() { std::wstring CommunicationSocket::DefaultPipePath() { auto pipename = std::wstring(LR"(\\.\pipe\)"); - pipename += L"ownCloud-"; + pipename += std::wstring(UTIL_PIPE_APP_NAME); + pipename += L"-"; pipename += getUserName(); return pipename; } diff --git a/shell_integration/windows/WinShellExtConstants.h.in b/shell_integration/windows/WinShellExtConstants.h.in index cc0b4e32f..0303ac174 100644 --- a/shell_integration/windows/WinShellExtConstants.h.in +++ b/shell_integration/windows/WinShellExtConstants.h.in @@ -42,3 +42,6 @@ #define OVERLAY_NAME_WARNING L" @APPLICATION_SHORTNAME@Warning" #define OVERLAY_DESCRIPTION L"@APPLICATION_SHORTNAME@ overlay handler" + +// NCUtil +#define UTIL_PIPE_APP_NAME L"@APPLICATION_EXECUTABLE@" diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index f58c38e4e..40c93d1f6 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -178,7 +178,8 @@ SocketApi::SocketApi(QObject *parent) if (Utility::isWindows()) { socketPath = QLatin1String(R"(\\.\pipe\)") - + QLatin1String("ownCloud-") + + QLatin1String(APPLICATION_EXECUTABLE) + + QLatin1String("-") + QString::fromLocal8Bit(qgetenv("USERNAME")); // TODO: once the windows extension supports multiple // client connections, switch back to the theme name |