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>
This commit is contained in:
Michael Schuster 2020-08-18 19:31:11 +02:00
parent 0ba5df597f
commit 11632da7ea
No known key found for this signature in database
GPG key ID: 00819E3BF4177B28
3 changed files with 8 additions and 2 deletions

View 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;
}

View 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@"

View 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