[virt-tools-list] [PATCH] virt-viewer: Don't hardcode sshport

Guido Günther agx at sigxcpu.org
Sat Jul 23 16:30:41 UTC 2011


this unbreaks using different ports via .ssh/config

---
 src/virt-viewer-app.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 687927c..06cde0d 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -742,14 +742,12 @@ virt_viewer_app_open_tunnel_ssh(const char *sshhost,
 	char portstr[50];
 	int n = 0;
 
-	if (!sshport)
-		sshport = 22;
-
-	sprintf(portstr, "%d", sshport);
-
 	cmd[n++] = "ssh";
-	cmd[n++] = "-p";
-	cmd[n++] = portstr;
+	if (!sshport) {
+		cmd[n++] = "-p";
+		sprintf(portstr, "%d", sshport);
+		cmd[n++] = portstr;
+	}
 	if (sshuser) {
 		cmd[n++] = "-l";
 		cmd[n++] = sshuser;
-- 
1.7.5.4




More information about the virt-tools-list mailing list