Files
flatpak/common
Simon McVittie ca992c7862 run: Preserve X11 display number instead of redirecting it to :99
Suppose the user's "real" X11 display on the host is Xorg or Xwayland
listening on :42, but they also have an Xvfb server listening on :99.

If we change the X11 display number to the arbitrary value :99, and
the Flatpak sandbox shares its network namespace with the host, then
clients inside the Flatpak sandbox will prefer to connect to the
abstract socket @/tmp/.X11-unix/X99 (which is Xvfb), rather than the
filesystem-backed socket /tmp/.X11-unix/X99 in the sandbox (which is
really /tmp/.X11-unix/X42 on the host, i.e. Xorg or Xwayland).

If they're relying on Xauthority (MIT-MAGIC-COOKIE-1) for access
control (as many display managers do), then this will fail, because
we gave the sandboxed app access to the cookies for Xorg/Xwayland
(rewriting their display number from 42 to 99 as we did so), but
Xvfb does not accept those cookies.

If we're relying on `xhost +"si:localuser:$(id -nu)"` for access control
(as gdm does), then the Flatpak app will successfully (!) connect to
whatever is on :99, for example Xvfb or Xephyr, which is rarely what
anyone wants either.

Resolves: https://github.com/flatpak/flatpak/issues/3357
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 10:45:08 +02:00
..
2019-02-25 18:12:30 +00:00
2021-02-09 09:36:59 +01:00
2021-10-21 17:30:01 -07:00
2022-06-16 13:49:45 +02:00
2018-05-24 11:59:52 +00:00
2018-10-08 08:36:23 +00:00
2022-06-16 13:49:45 +02:00
2019-04-08 12:50:42 +00:00