Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Feb 2021 11:24:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        x11@FreeBSD.org
Subject:   [Bug 253277] x11/xtrans: Don't unlink existing UNIX sockets => allows multiple X sessions from sddm
Message-ID:  <bug-253277-7141-TtXsFf2mYN@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-253277-7141@https.bugs.freebsd.org/bugzilla/>
References:  <bug-253277-7141@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253277

--- Comment #2 from Olivier Certner <olivier.freebsd@free.fr> ---
Hi,

As for the high-level problem I'm fixing, I wrote this description:

> Typically, sddm exactly triggers the problem. So when you try to open
> another session through it, the first session's sockets are crushed
> and it becomes stale.

What do you find unclear in it exactly?

As for the low-level description, let me recapitulate with more context. As=
 you
most probably know, there are two ways that Xorg selects its display at
startup:
- Either you supply an explicit display on the command-line (e.g., ":1").
- Or you do not, and either "-displayfd" has been specified, in which case =
Xorg
will try to assign some automatically, or it has not, in which case :0 is u=
sed
by default.
("-displayfd" has other effects, but this is a separate discussion, relevan=
t to
the other bug #253278.)

The problem is with the automatic assignment of display. It works by trying=
 to
grab the first display available (from :0 when using UNIX sockets), which it
does by simply unlinking an existing socket file and then binding a new soc=
ket
to the same file. When the server is run as root, this operation always
succeeds, and any existing socket for :0 ("/tmp/.X11-UNIX/X0") that would e=
xist
is removed. This leaves any preexisting X session on :0 stale (e.g., launch=
ing
new apps make them go to the new session).

And SDDM triggers that: It passes "-displayfd", and no display directive,
relying on the server to do display assignmnent, which it doesn't do correc=
tly.

Now, I agree that this problem is probably not FreeBSD specific (it affects
platforms/distributions running Xorg as root). If you prefer, I'll report it
upstream and we'll see how it goes.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-253277-7141-TtXsFf2mYN>