Windows shell extensions: Change NCUtil Pipe name from ownCloud to APPLICATION_EXECUTABLE
authorMichael Schuster <michael@schuster.ms>
Tue, 18 Aug 2020 17:31:11 +0000 (19:31 +0200)
committerMichael Schuster <michael@schuster.ms>
Thu, 20 Aug 2020 16:50:05 +0000 (18:50 +0200)
Avoid interference with foreign pipes as this is always a bad idea ;p

Signed-off-by: Michael Schuster <michael@schuster.ms>
shell_integration/windows/NCUtil/CommunicationSocket.cpp
shell_integration/windows/WinShellExtConstants.h.in
src/gui/socketapi.cpp

index cda36c1b8fc8a48aba9b053a6ce6ecf7e4648145..e0ac699ae5e532496666812b61fec3f1056cb5db 100644 (file)
@@ -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;
 }
index cc0b4e32fb13f586da37c17f5f7a8cb02f3650a8..0303ac174b1cddc4310da156d3714fd6d37d798e 100644 (file)
@@ -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@"
index f58c38e4e4be532035f9d0781c5d709baf1288ff..40c93d1f6946b14bb8f970aad9f904b64d359ec6 100644 (file)
@@ -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