SSH: Shorten the path name of the control socket

The maximum path length for a UNIX domain socket is much lower than for
other file types.

Fixes: QTCREATORBUG-21748
Change-Id: I5e27169f356d7a2960a817e308a1f5d4858b6f7d
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
This commit is contained in:
Christian Kandeler
2018-12-20 17:46:18 +01:00
parent eef5131962
commit e5558cd0c5

View File

@@ -108,7 +108,7 @@ struct SshConnection::SshConnectionPrivate
QString socketFilePath() const QString socketFilePath() const
{ {
QTC_ASSERT(masterSocketDir, return QString()); QTC_ASSERT(masterSocketDir, return QString());
return masterSocketDir->path() + "/control_socket"; return masterSocketDir->path() + "/cs";
} }
QStringList connectionOptions() const QStringList connectionOptions() const
@@ -352,7 +352,7 @@ void SshConnection::doConnectToHost()
if (!d->sharingEnabled) if (!d->sharingEnabled)
emitConnected(); emitConnected();
QTC_ASSERT(TemporaryDirectory::masterTemporaryDirectory(), return); QTC_ASSERT(TemporaryDirectory::masterTemporaryDirectory(), return);
d->masterSocketDir.reset(new TemporaryDirectory("qtc-ssh-XXXXXX")); d->masterSocketDir.reset(new TemporaryDirectory("ssh-XXXXXX"));
if (!d->masterSocketDir->isValid()) { if (!d->masterSocketDir->isValid()) {
emitError(tr("Cannot establish SSH connection: Failed to create temporary " emitError(tr("Cannot establish SSH connection: Failed to create temporary "
"directory for control socket: %1") "directory for control socket: %1")