Bug 55680 - xcb_get_auth_info fails even if getpeername() succeeds
Summary: xcb_get_auth_info fails even if getpeername() succeeds
Status: RESOLVED INVALID
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: unspecified
Hardware: All OpenBSD
: medium major
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-05 21:23 UTC by Matthieu Herrb
Modified: 2012-10-07 13:15 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (1015 bytes, text/plain)
2012-10-05 21:23 UTC, Matthieu Herrb
Details

Description Matthieu Herrb 2012-10-05 21:23:46 UTC
Created attachment 68141 [details]
proposed patch

The code is trying getpeername() and falling back to getsockname() if
the first fails, but fails to set gotsockname=1 if the getpeername()
call succeeds.

This bug is preventing mit magic cooling  from beeing sent from Unix
domain clients on OpenBSD (and probably other BSDs too).
Comment 1 Uli Schlachter 2012-10-07 11:06:47 UTC
That patch looks wrong (and I am not talking about that tabulator). Effictively, it completely removes getsockname variable since now both cases set it to 1.

Could you tell us more about the issue that you are trying to fix? On Linux, getpeername() succeeds, too, and libxcb still works. Also, I am pretty sure that libxcb isn't broken since years on BSD and no one noticed.
Comment 2 Matthieu Herrb 2012-10-07 11:20:46 UTC
(In reply to comment #0)
> Created attachment 68141 [details]
> proposed patch
> 
> The code is trying getpeername() and falling back to getsockname() if
> the first fails, but fails to set gotsockname=1 if the getpeername()
> call succeeds.
> 
> This bug is preventing mit magic cooling  from beeing sent from Unix
                                   ^^^^^^^
                                   cookie
> domain clients on OpenBSD (and probably other BSDs too).
Comment 3 Matthieu Herrb 2012-10-07 13:12:00 UTC
(In reply to comment #1)
> That patch looks wrong (and I am not talking about that tabulator).
> Effictively, it completely removes getsockname variable since now both cases
> set it to 1.
> 
> Could you tell us more about the issue that you are trying to fix? On Linux,
> getpeername() succeeds, too, and libxcb still works. Also, I am pretty sure
> that libxcb isn't broken since years on BSD and no one noticed.


My issue is running xdm using Xnest on display :1 (in order to test xdm session related stuff), using 

:1 local /usr/X11R6/bin/Xnest :1

in /etx/X11/xdm/Xservers

In that mode, xrdb (used by the login widget) fails to connect to the X server and end up with an ugly widget. Furthermore, the client session also fails to connect. This used to work before xcb 1.8 (but I'm not sure  exactly when it broke).

Now I see that my analysis of the issue is indeed wrong. My patch fixes it by some kind of magic coincidence.
I'll dig further and reopen a bug later.
Comment 4 Uli Schlachter 2012-10-07 13:15:39 UTC
If you have some known good&bad versions, doing a git bisect might help figuring out what happened.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.