[Xcb] Question about a xcb_util.c commit

Uli Schlachter psychon at znc.in
Fri Jun 10 15:27:34 UTC 2016


Hi,

Am 10.06.2016 um 16:30 schrieb David Coppa:
> Hi all,
> 
> I have a question regarding this particular commit, "Fallback to
> TCP if no protocol is specified and the UNIX connection fails",
> that you can see at
> https://cgit.freedesktop.org/xcb/libxcb/commit/?id=7d235c62f0d5bd0df1236cc52141c10c5d272a18
> 
> Does anyone know the rationale behind it?

Not really, but if you want me to guess: No protocol specified can be
interpreted as a wildcard, so why not try both?

> It seems strange to me to try to connect via tcp if opening the
> unix socket fails (because the X server crashed, for example).

How about "the X server only listens on TCP and that's why the unix socket
didn't work"?

> I'm asking because this piece of code does not interact very well
> with the way we're sandboxing some window managers (specifically
> i3) using pledge() on OpenBSD.
> 
> When pledged, i3 is not allowed to open AF_INET sockets, only AF_UNIX
> ones.

Ok, so what is the problem here?

Scenario 1: X server listens on the unix socket. XCB connects to the unix socket
and everything works.

Scenario 2: No X server running. The unix socket fails (because nothing listens
on it), the TCP socket fails (permission denied, I guess). An error is reported.

Also: When exactly does i3 pledge()? Does this break e.g. "DISPLAY=1.2.3.4:0
i3"? I thought people were "angry" about wayland because it isn't as (pseudo)
network transparent as X11.

Uli
-- 
Bitte nicht mit dem verbleibenden Auge in den Laser gucken.
 - Vincent Ebert


More information about the Xcb mailing list