[virt-viewer/f16] More SSH port fixes

Daniel P. Berrange berrange at fedoraproject.org
Sun Aug 14 21:06:42 UTC 2011


commit 57834b4d3e9f3c6cc4f542ca6210e05d77f5ea86
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Sun Aug 14 13:57:59 2011 -0700

    More SSH port fixes

 ...hport.patch => virt-viewer-0.4.1-sshport1.patch |    0
 virt-viewer-0.4.1-sshport2.patch                   |   21 +++++++++++
 virt-viewer-0.4.1-sshport3.patch                   |   37 ++++++++++++++++++++
 virt-viewer.spec                                   |   11 +++++-
 4 files changed, 67 insertions(+), 2 deletions(-)
---
diff --git a/virt-viewer-0.4.1-sshport.patch b/virt-viewer-0.4.1-sshport1.patch
similarity index 100%
rename from virt-viewer-0.4.1-sshport.patch
rename to virt-viewer-0.4.1-sshport1.patch
diff --git a/virt-viewer-0.4.1-sshport2.patch b/virt-viewer-0.4.1-sshport2.patch
new file mode 100644
index 0000000..0c48477
--- /dev/null
+++ b/virt-viewer-0.4.1-sshport2.patch
@@ -0,0 +1,21 @@
+commit 1c00bc2b9541a553c0f6502dadc61eb56edfa355
+Author: Guido Günther <agx at sigxcpu.org>
+Date:   Fri Aug 12 19:50:22 2011 +0200
+
+    Don't hardcode ssh port to 0
+    
+    Many thanks to Luca Capello <luca at pca.it> for debugging this.
+
+diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
+index 71284b6..2ad5710 100644
+--- a/src/virt-viewer-app.c
++++ b/src/virt-viewer-app.c
+@@ -1311,7 +1311,7 @@ virt_viewer_app_set_connect_info(VirtViewerApp *self,
+ 	priv->transport = g_strdup(transport);
+ 	priv->unixsock = g_strdup(unixsock);
+ 	priv->user = g_strdup(user);
+-	priv->port = 0;
++	priv->port = port;
+ 
+ 	virt_viewer_app_update_pretty_address(self);
+ }
diff --git a/virt-viewer-0.4.1-sshport3.patch b/virt-viewer-0.4.1-sshport3.patch
new file mode 100644
index 0000000..aa4392c
--- /dev/null
+++ b/virt-viewer-0.4.1-sshport3.patch
@@ -0,0 +1,37 @@
+commit 60145f31a6fb2c7331101ba4ee7d25d08dd7eb48
+Author: Guido Günther <agx at sigxcpu.org>
+Date:   Fri Aug 12 19:50:29 2011 +0200
+
+    Don't print incorrect port numbers
+    
+    The port isn't 22 when we connect to an alternate port given in
+    .ssh/config.
+
+diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
+index 2ad5710..c80d52f 100644
+--- a/src/virt-viewer-app.c
++++ b/src/virt-viewer-app.c
+@@ -635,6 +635,8 @@ virt_viewer_app_activate(VirtViewerApp *self)
+ 	if (priv->transport &&
+ 	    g_strcasecmp(priv->transport, "ssh") == 0 &&
+ 	    !priv->direct) {
++		gchar *p = NULL;
++
+ 		if (priv->gport) {
+ 			virt_viewer_app_trace(self, "Opening indirect TCP connection to display at %s:%s\n",
+ 					      priv->ghost, priv->gport);
+@@ -642,8 +644,12 @@ virt_viewer_app_activate(VirtViewerApp *self)
+ 			virt_viewer_app_trace(self, "Opening indirect UNIX connection to display at %s\n",
+ 					      priv->unixsock);
+ 		}
+-		virt_viewer_app_trace(self, "Setting up SSH tunnel via %s@%s:%d\n",
+-				      priv->user, priv->host, priv->port ? priv->port : 22);
++		if (priv->port)
++			p = g_strdup_printf(":%d", priv->port);
++
++		virt_viewer_app_trace(self, "Setting up SSH tunnel via %s@%s%s\n",
++				      priv->user, priv->host, p ? p : "");
++		g_free(p);
+ 
+ 		if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port,
+ 							  priv->user, priv->ghost,
diff --git a/virt-viewer.spec b/virt-viewer.spec
index 643aa9b..088e829 100644
--- a/virt-viewer.spec
+++ b/virt-viewer.spec
@@ -21,13 +21,15 @@
 
 Name: virt-viewer
 Version: 0.4.1
-Release: 2%{?dist}%{?extra_release}
+Release: 3%{?dist}%{?extra_release}
 Summary: Virtual Machine Viewer
 Group: Applications/System
 License: GPLv2+
 URL: http://virt-manager.org/
 Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
-Patch1: %{name}-%{version}-sshport.patch
+Patch1: %{name}-%{version}-sshport1.patch
+Patch2: %{name}-%{version}-sshport2.patch
+Patch3: %{name}-%{version}-sshport3.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: openssh-clients
 
@@ -83,6 +85,8 @@ browsers.
 %prep
 %setup -q
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 
@@ -138,6 +142,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %changelog
+* Sun Aug 14 2011 Daniel P. Berrange <berrange at redhat.com> - 0.4.1-3
+- More ssh tunnelling port fixes
+
 * Fri Aug 12 2011 Daniel P. Berrange <berrange at redhat.com> - 0.4.1-2
 - Fix ssh tunnelling
 


More information about the scm-commits mailing list