From: Michael Schuster Date: Tue, 18 Aug 2020 17:31:11 +0000 (+0200) Subject: Windows shell extensions: Change NCUtil Pipe name from ownCloud to APPLICATION_EXECUTABLE X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~216^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=11632da7ea36c8c501866aa220cb28365cf110cc;p=nextcloud-desktop.git 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 --- 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 #include @@ -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