forked from qt-creator/qt-creator
SSH: Don't allow external access to process runner's connection object.
It does not belong to the runner anymore after the process has finished, so we must prevent anyone from getting a copy. (This includes a minor API fix for RemoteLinux code that depended on the connection being available.) Change-Id: Icc28dc3c820f4c2210bb6fb08171cd6a84534dee Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
@@ -71,8 +71,7 @@ void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams,
|
||||
return;
|
||||
}
|
||||
|
||||
connect(&d->deployProcess, SIGNAL(connectionError(Utils::SshError)),
|
||||
SLOT(handleConnectionFailure()));
|
||||
connect(&d->deployProcess, SIGNAL(connectionError()), SLOT(handleConnectionFailure()));
|
||||
connect(&d->deployProcess, SIGNAL(processClosed(int)), SLOT(handleKeyUploadFinished(int)));
|
||||
const QByteArray command = "test -d .ssh "
|
||||
"|| mkdir .ssh && chmod 0700 .ssh && echo '"
|
||||
@@ -82,9 +81,8 @@ void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams,
|
||||
|
||||
void SshKeyDeployer::handleConnectionFailure()
|
||||
{
|
||||
const QString errorMsg = d->deployProcess.connection()->errorString();
|
||||
cleanup();
|
||||
emit error(tr("Connection failed: %1").arg(errorMsg));
|
||||
emit error(tr("Connection failed: %1").arg(d->deployProcess.lastConnectionErrorString()));
|
||||
}
|
||||
|
||||
void SshKeyDeployer::handleKeyUploadFinished(int exitStatus)
|
||||
|
||||
Reference in New Issue
Block a user