After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 494817 - xdmcp doesn't work at all on some OS
xdmcp doesn't work at all on some OS
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other All
: Normal major
: ---
Assigned To: Brian Cameron
GDM maintainers
Depends on:
Blocks: 606724
 
 
Reported: 2007-11-08 01:20 UTC by Robert Nelson
Modified: 2010-07-02 19:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Suggested Fix (5.02 KB, patch)
2007-11-08 01:25 UTC, Robert Nelson
committed Details | Review
updated patch for GDM 2.28 (6.50 KB, patch)
2009-10-27 22:04 UTC, Brian Cameron
committed Details | Review
patch fixing remaining issues (26.77 KB, patch)
2010-01-12 05:29 UTC, Brian Cameron
committed Details | Review

Description Robert Nelson 2007-11-08 01:20:49 UTC
Please describe the problem:
xdmcp doesn't work on Solaris.  No packets are sent out the network.

Steps to reproduce:
1. Start a local or remote chooser.
2. 
3. 


Actual results:
The system isn't listed.

Expected results:
The system should be listed and be selectable.

Does this happen every time?
Yes

Other information:
The problem is caused by a difference in the way Solaris API's handle the length of the sockaddr supplied.  Solaris requires the exact length as specified by the AF_INET6 or AF_INET whereas Linux based systems only require that the length be greater or equal to the expected length.

Also the routine gdm_address_peek_local_list() incorrectly treats the ai_family member of the hints passed to getaddrinfo() as a bitmask.
Comment 1 Robert Nelson 2007-11-08 01:25:19 UTC
Created attachment 98752 [details] [review]
Suggested Fix

This is the fix for this bug.
Comment 2 Brian Cameron 2007-11-08 19:03:28 UTC
Fixed in 2.20.  I'll leave this bug open, though, since I notice that GDM SVN head has the same issue.  Basically all places where sizeof (struct sockaddr_storage) is used should be replaced by the macro in the patch.

The issue with hints is probably not an issue for SVN head since it uses a different mechanism for figuring out how to set ai_family.



Comment 3 Brian Cameron 2007-11-27 21:45:43 UTC
Some people on FreeBSD have reported that there is the same problem on their platform, so removing Solaris specific wording from Synopsis.
Comment 4 Brian Cameron 2009-10-27 22:04:53 UTC
Created attachment 146378 [details] [review]
updated patch for GDM 2.28


This issue exists in the new GDM, which will cause XDMCP to fail on some platforms when using IPv6 (Solaris, FreeBSD).  This patch is already in GDM 2.20 (it was added after the code forked for the new GDM), and it just adds a macro so that the structure size is set for IPv4 or IPv6 via a macro to the specific structure size.
Comment 5 Brian Cameron 2009-10-27 22:05:35 UTC
Re-opening since this bug needs to also be fixed in the new GDM 2.28 version.  I provided an updated patch which applies to the latest code.
Comment 6 Brian Cameron 2009-10-28 21:28:09 UTC
Fixed in master for 2.29.
Comment 7 Brian Cameron 2010-01-12 05:28:17 UTC
After doing further testing, I notice that XDMCP still does not work on Solaris.  I am attaching a patch that fixes the remaining issues.  This patch 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)".

- The patch also fixes a number of issues where NULL's being passed into
  printf() functions were causing issues, and ensures that this never happens.

Can this patch go upstream?
Comment 8 Brian Cameron 2010-01-12 05:29:22 UTC
Created attachment 151222 [details] [review]
patch fixing remaining issues

patch fixing remaining issues.
Comment 9 Ray Strode [halfline] 2010-01-13 14:37:22 UTC
Comment on attachment 151222 [details] [review]
patch fixing remaining issues

Thanks