summaryrefslogtreecommitdiff
path: root/daemon/gdm-xdmcp-display-factory.c
diff options
context:
space:
mode:
authorOlivier Fourdan <fourdan@xfce.org>2012-06-25 16:13:34 -0400
committerRay Strode <rstrode@redhat.com>2012-06-25 16:13:34 -0400
commit398a1382bf439b21424ae9ad02f5362bf84465cb (patch)
tree152bb0c60e9e7ba4cab1d703249a4e29476738ad /daemon/gdm-xdmcp-display-factory.c
parent82969c73b162664c22cd64fb66e3afd909515a41 (diff)
downloadgdm-398a1382bf439b21424ae9ad02f5362bf84465cb.tar.gz
xdmcp: fix indirect queries
The XDMCP indirect query is supposed to be forwarded to the remote host by gdm_xdmcp_send_forward_query() from daemon/gdm-xdmcp-display-factory.c However, checking the return value of XdmcpFlush() we can see the call fails with "Invalid Argument". Looking at the gdm debug logs, the address (ic->chosen_address) used there is correct but the port is 0 instead of 177, so the indirect query is never forwarded to the selected host. The address is set in on_hostname_selected() from daemon/gdm-xdmcp-display-factory.c via getaddrinfo() but the service field passed to getaddrinfo() is NULL, while using the actual XDMCP port ("177") fixes the issue and the indirect connection is successful. committe://bugzilla.gnome.org/show_bug.cgi?id=665296
Diffstat (limited to 'daemon/gdm-xdmcp-display-factory.c')
-rw-r--r--daemon/gdm-xdmcp-display-factory.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index 71235362..a54a7342 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -1991,7 +1991,8 @@ on_hostname_selected (GdmXdmcpChooserDisplay *display,
int gaierr;
GdmAddress *address;
IndirectClient *ic;
-
+ gchar *xdmcp_port;
+
g_debug ("GdmXdmcpDisplayFactory: hostname selected: %s",
hostname ? hostname : "(null)");
@@ -2011,10 +2012,13 @@ on_hostname_selected (GdmXdmcpChooserDisplay *display,
/* this should convert IPv4 address to IPv6 if needed */
hints.ai_flags = AI_V4MAPPED;
- if ((gaierr = getaddrinfo (hostname, NULL, &hints, &ai_list)) != 0) {
+ xdmcp_port = g_strdup_printf ("%d", XDM_UDP_PORT);
+ if ((gaierr = getaddrinfo (hostname, xdmcp_port, &hints, &ai_list)) != 0) {
g_warning ("Unable to get address: %s", gai_strerror (gaierr));
+ g_free (xdmcp_port);
return;
}
+ g_free (xdmcp_port);
/* just take the first one */
ai = ai_list;