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:
Christian Kandeler
2011-11-09 17:38:19 +01:00
parent bddfae7182
commit 5d5db225a8
14 changed files with 57 additions and 53 deletions

View File

@@ -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)