From owner-freebsd-x11@freebsd.org Mon Feb 8 11:24:30 2021 Return-Path: Delivered-To: freebsd-x11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C00252EB8A for ; Mon, 8 Feb 2021 11:24:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4DZ3Zk076wz3Kq3 for ; Mon, 8 Feb 2021 11:24:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 044A452E8DC; Mon, 8 Feb 2021 11:24:30 +0000 (UTC) Delivered-To: x11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0413152EB89 for ; Mon, 8 Feb 2021 11:24:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ3Zj6Xsxz3Kq2 for ; Mon, 8 Feb 2021 11:24:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFA2816CDB for ; Mon, 8 Feb 2021 11:24:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 118BOTJZ028740 for ; Mon, 8 Feb 2021 11:24:29 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 118BOTkM028739 for x11@FreeBSD.org; Mon, 8 Feb 2021 11:24:29 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f 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 Date: Mon, 08 Feb 2021 11:24:30 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: olivier.freebsd@free.fr X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: x11@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 11:24:30 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253277 --- Comment #2 from Olivier Certner --- 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.=