Package list virt-viewer / d0817dd
Fix ssh access if no listen tag is set on the domain Thanks: Attila Kinali Closes: #696435 Guido G√ľnther 8 years ago
2 changed file(s) with 34 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 From: Attila Kinali <attila@kinali.ch>
1 Date: Thu, 18 Apr 2013 08:15:16 +0200
2 Subject: Fix ssh access if no listen tag is set on the domain
3
4 Closes: #696435
5 ---
6 src/virt-viewer.c | 11 +++++++++--
7 1 file changed, 9 insertions(+), 2 deletions(-)
8
9 diff --git a/src/virt-viewer.c b/src/virt-viewer.c
10 index 572e9e6..8ca9c63 100644
11 --- a/src/virt-viewer.c
12 +++ b/src/virt-viewer.c
13 @@ -354,10 +354,17 @@ virt_viewer_extract_connect_info(VirtViewer *self,
14 if (!ghost ||
15 (strcmp(ghost, "0.0.0.0") == 0 ||
16 strcmp(ghost, "::") == 0)) {
17 + char *replace = NULL;
18 + if(strcmp(transport, "ssh") == 0)
19 + {
20 + replace = "localhost";
21 + } else {
22 + replace = host;
23 + }
24 DEBUG_LOG("Guest graphics listen '%s' is NULL or a wildcard, replacing with '%s'",
25 - ghost ? ghost : "", host);
26 + ghost ? ghost : "", replace);
27 g_free(ghost);
28 - ghost = g_strdup(host);
29 + ghost = g_strdup(replace);
30 }
31
32 virt_viewer_app_set_connect_info(app, host, ghost, gport, gtlsport,transport, unixsock, user, port, NULL);
00 0001-Fail-if-opening-the-connection-fails.patch
11 0002-Don-t-fail-early-if-virDomainOpenGraphics-fails.patch
2 0003-Fix-ssh-access-if-no-listen-tag-is-set-on-the-domain.patch