mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 12:19:03 +03:00
Revert "Disambiguate socket API pathes on Windows with user name"
This commit is contained in:
parent
e70b78d14b
commit
b43a9421d2
3 changed files with 4 additions and 17 deletions
2
binary
2
binary
|
@ -1 +1 @@
|
||||||
Subproject commit a56480559ddda3af36b63bb42cfc6cfe05ebc6db
|
Subproject commit ac422574995d2339d98fff552f11450b18d7bcff
|
|
@ -31,24 +31,12 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#define BUFSIZE 512
|
|
||||||
|
|
||||||
std::wstring getUserName() {
|
|
||||||
DWORD len = BUFSIZE;
|
|
||||||
TCHAR buf[BUFSIZE];
|
|
||||||
if (GetUserName(buf, &len)) {
|
|
||||||
return std::wstring(&buf[0], len);
|
|
||||||
} else {
|
|
||||||
return std::wstring();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This code is run in a thread
|
// This code is run in a thread
|
||||||
void RemotePathChecker::workerThreadLoop()
|
void RemotePathChecker::workerThreadLoop()
|
||||||
{
|
{
|
||||||
auto pipename = std::wstring(L"\\\\.\\pipe\\");
|
auto pipename = std::wstring(L"\\\\.\\pipe\\");
|
||||||
pipename += L"ownCloud\\";
|
pipename += L"ownCloud";
|
||||||
pipename += getUserName();
|
|
||||||
|
|
||||||
bool connected = false;
|
bool connected = false;
|
||||||
CommunicationSocket socket;
|
CommunicationSocket socket;
|
||||||
|
@ -253,4 +241,4 @@ RemotePathChecker::FileState RemotePathChecker::_StrToFileState(const std::wstri
|
||||||
}
|
}
|
||||||
|
|
||||||
return StateNone;
|
return StateNone;
|
||||||
}
|
}
|
|
@ -67,8 +67,7 @@ SocketApi::SocketApi(QObject* parent)
|
||||||
|
|
||||||
if (Utility::isWindows()) {
|
if (Utility::isWindows()) {
|
||||||
socketPath = QLatin1String("\\\\.\\pipe\\")
|
socketPath = QLatin1String("\\\\.\\pipe\\")
|
||||||
+ QLatin1String("ownCloud") + '\\'
|
+ QLatin1String("ownCloud");
|
||||||
+ QString::fromLocal8Bit(qgetenv("USERNAME"));
|
|
||||||
// TODO: once the windows extension supports multiple
|
// TODO: once the windows extension supports multiple
|
||||||
// client connections, switch back to the theme name
|
// client connections, switch back to the theme name
|
||||||
// See issue #2388
|
// See issue #2388
|
||||||
|
|
Loading…
Reference in a new issue