SSH: Shorten the temporary directory even more

Creating a sub-directory of Creator's master temp dir makes the socket
path too long on macOS, so use a normal QTemporaryDir.

Fixes: QTCREATORBUG-21748
Change-Id: I4992e43032838e6f625162cd40ae101d21c62fdc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2019-04-25 17:57:37 +02:00
parent b961c84c57
commit 2782303253

View File

@@ -36,7 +36,6 @@
#include <utils/fileutils.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <utils/temporarydirectory.h>
#include <QByteArrayList>
#include <QDir>
@@ -149,7 +148,7 @@ struct SshConnection::SshConnectionPrivate
SshConnectionInfo connInfo;
SshProcess masterProcess;
QString errorString;
std::unique_ptr<TemporaryDirectory> masterSocketDir;
std::unique_ptr<QTemporaryDir> masterSocketDir;
State state = Unconnected;
const bool sharingEnabled = SshSettings::connectionSharingEnabled();
};
@@ -351,8 +350,7 @@ void SshConnection::doConnectToHost()
}
if (!d->sharingEnabled)
emitConnected();
QTC_ASSERT(TemporaryDirectory::masterTemporaryDirectory(), return);
d->masterSocketDir.reset(new TemporaryDirectory("ssh-XXXXXX"));
d->masterSocketDir.reset(new QTemporaryDir);
if (!d->masterSocketDir->isValid()) {
emitError(tr("Cannot establish SSH connection: Failed to create temporary "
"directory for control socket: %1")