summaryrefslogtreecommitdiff
path: root/daemon/gdm-xdmcp-display-factory.c
diff options
context:
space:
mode:
authorBrian Cameron <Brian.Cameron@sun.com>2010-01-13 09:33:23 -0500
committerRay Strode <rstrode@redhat.com>2010-01-13 09:33:23 -0500
commite533f4b72568cdc3d7f7ec6cec09d9392b11d54c (patch)
tree56979113260da86ace65069bb43ff33acce1d30e /daemon/gdm-xdmcp-display-factory.c
parent4b1263a30b2ffa9c4df8d69f857d4eefce289f55 (diff)
downloadgdm-e533f4b72568cdc3d7f7ec6cec09d9392b11d54c.tar.gz
Fix up XDMCP for Solaris
After doing further testing, I notice that XDMCP still does not work on Solaris. This commit fixes: - In gdm-address.c, there was a problem where a failure in gdm_address_get_hostname could cause an infinite loop since it would call gdm_address_debug, which would then call gdm_address_get_hostname again. I fixed this by making gdm_address_debug call a private _gdm_address_debug function and gdm_address_get_hostname calls _gdm_adress_debug rather than gdm_address_debug. - Two calls in gdm-address.c were using "sizeof (struct sockaddr_storage)" and changing this to "(int) gdm_sockaddr_len (address->ss)" works better. This is the same issue as fixed in the previous patch. I just missed these spots before. - In daemon/gdm-xdmcp-display-factory.c in the on_hostname_selected() function it is necessary to set hints.ai_socktype to "SOCK_DGRAM" or else I would get this error: WARNING: Unable get address: service name not available for the specified socket type - In daemon/gdm-xdmcp-display-factory.c in the decode_packet() function and in gui/simple-chooser/gdm-host-chooser-widget.c it is necessary to set ss_len to "gdm_sockaddr_len (&clnt_ss)" instead of "sizeof (clnt_ss)". - In gui/simple-chooser/gdm-host-chooser-widget.c in find_broacast_address it is also necessary to check for "(errno != ENXIO)". See https://bugzilla.gnome.org/show_bug.cgi?id=494817
Diffstat (limited to 'daemon/gdm-xdmcp-display-factory.c')
-rw-r--r--daemon/gdm-xdmcp-display-factory.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index f557eda5..7b5fb531 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -1518,9 +1518,12 @@ create_address_from_request (ARRAY8 *req_addr,
memset (&hints, 0, sizeof (hints));
hints.ai_family = family;
- hints.ai_flags = AI_V4MAPPED; /* this should convert IPv4 address to IPv6 if needed */
+ /* this should convert IPv4 address to IPv6 if needed */
+ hints.ai_flags = AI_V4MAPPED;
+ hints.ai_socktype = SOCK_DGRAM;
+
if ((gaierr = getaddrinfo (host, serv, &hints, &ai_list)) != 0) {
- g_warning ("Unable get address: %s", gai_strerror (gaierr));
+ g_warning ("Unable to get address: %s", gai_strerror (gaierr));
return FALSE;
}
@@ -1997,9 +2000,11 @@ on_hostname_selected (GdmXdmcpChooserDisplay *display,
memset (&hints, 0, sizeof (hints));
hints.ai_family = gdm_address_get_family_type (address);
- hints.ai_flags = AI_V4MAPPED; /* this should convert IPv4 address to IPv6 if needed */
+ /* this should convert IPv4 address to IPv6 if needed */
+ hints.ai_flags = AI_V4MAPPED;
+
if ((gaierr = getaddrinfo (hostname, NULL, &hints, &ai_list)) != 0) {
- g_warning ("Unable get address: %s", gai_strerror (gaierr));
+ g_warning ("Unable to get address: %s", gai_strerror (gaierr));
return;
}
@@ -2837,12 +2842,12 @@ decode_packet (GIOChannel *source,
return TRUE;
}
- ss_len = sizeof (clnt_ss);
res = XdmcpFill (factory->priv->socket_fd, &factory->priv->buf, (XdmcpNetaddr)&clnt_ss, &ss_len);
if G_UNLIKELY (! res) {
g_debug ("GdmXdmcpDisplayFactory: Could not create XDMCP buffer!");
return TRUE;
}
+ ss_len = (int)gdm_sockaddr_len (&clnt_ss);
res = XdmcpReadHeader (&factory->priv->buf, &header);
if G_UNLIKELY (! res) {