Codebase list virt-viewer / debian/0.4.0-1 debian / patches / 0001-Don-t-hardcode-sshport.patch
debian/0.4.0-1

Tree @debian/0.4.0-1 (Download .tar.gz)

0001-Don-t-hardcode-sshport.patch @debian/0.4.0-1raw · history · blame

From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Sat, 23 Jul 2011 18:01:29 +0200
Subject: Don't hardcode sshport

this unbreaks using different ports via .ssh/config
---
 src/virt-viewer.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index 5321580..9622446 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -896,14 +896,12 @@ virt_viewer_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;
--