Openembedded Core Discussions
 help / color / mirror / Atom feed
From: <rs@ti.com>
To: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>,
	<richard.purdie@linuxfoundation.org>, <ross.burton@arm.com>,
	<alex@linutronix.de>, <otavio@ossystems.com.br>,
	<kexin.hao@windriver.com>, <afd@ti.com>, <detheridge@ti.com>,
	<denis@denix.org>, <reatmon@ti.com>
Cc: <openembedded-core@lists.openembedded.org>, <vijayp@ti.com>
Subject: [oe-core][PATCHv7 1/6] libx11: create tmpfile dir for x11 domain socket
Date: Wed, 10 Sep 2025 16:28:42 -0500	[thread overview]
Message-ID: <20250910212855.2480561-2-rs@ti.com> (raw)
In-Reply-To: <20250910212855.2480561-1-rs@ti.com>

From: Randolph Sapp <rs@ti.com>

Register a volatile directory entry for the x11 domain socket when not
using systemd. This will make sure the directory is always created with
the correct permissions. Systemd already provides their own tmpfile.d
entry for the same behavior.

Currently some x11 related applications will create this directory if it
doesn't already exist, but this is not true for everything. In addition,
if the application in question isn't started as root, it's possible this
directory can be owned by a non-root user. This isn't an issue by
itself, but it can potentially lead to problems in a multi-user
environment.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 meta/recipes-graphics/xorg-lib/libx11/99_x11    |  1 +
 meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb | 15 +++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-graphics/xorg-lib/libx11/99_x11

diff --git a/meta/recipes-graphics/xorg-lib/libx11/99_x11 b/meta/recipes-graphics/xorg-lib/libx11/99_x11
new file mode 100644
index 0000000000..53c5b49d10
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11/99_x11
@@ -0,0 +1 @@
+d root root 1777 /tmp/.X11-unix none
diff --git a/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb b/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb
index 580e44889d..78713f4ac5 100644
--- a/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb
+++ b/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb
@@ -21,7 +21,8 @@ PE = "1"
 
 XORG_PN = "libX11"
 
-SRC_URI += "file://disable_tests.patch"
+SRC_URI += "file://disable_tests.patch \
+            file://99_x11"
 
 SRC_URI[sha256sum] = "fa026f9bb0124f4d6c808f9aef4057aad65e7b35d8ff43951cef0abe06bb9a9a"
 
@@ -35,7 +36,17 @@ PACKAGECONFIG[xcms] = "--enable-xcms,--disable-xcms"
 
 PACKAGES =+ "${PN}-xcb"
 
-FILES:${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${datadir}/X11/Xcms.txt"
+do_install:append() {
+	# temporary directory required for x11 domain sockets
+        # systemd provides their own definition using tmpfiles.d
+	if ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'false', 'true', d)}; then
+		install -d ${D}${sysconfdir}/default/volatiles
+		install -m 0644 ${UNPACKDIR}/99_x11 ${D}${sysconfdir}/default/volatiles/99_x11
+	fi
+}
+
+FILES:${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${datadir}/X11/Xcms.txt \
+                ${libdir}/tmpfiles.d/x11.conf ${sysconfdir}/default/volatiles/99_x11"
 FILES:${PN}-xcb += "${libdir}/libX11-xcb.so.*"
 FILES:${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale"
 
-- 
2.51.0



  reply	other threads:[~2025-09-10 21:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 21:28 [oe-core][PATCHv7 0/6] Display manager proposal for x11 and wayland rs
2025-09-10 21:28 ` rs [this message]
2025-09-10 21:28 ` [oe-core][PATCHv7 2/6] go: fix sigaction usage on i386 platforms rs
2025-09-10 21:48   ` Patchtest results for " patchtest
2025-09-12  6:10     ` Mathieu Dubois-Briand
2025-09-17 18:25       ` Randolph Sapp
2025-09-10 21:28 ` [oe-core][PATCHv7 3/6] emptty: add version 0.14.0 rs
2025-09-10 21:28 ` [oe-core][PATCHv7 4/6] weston-init: convert to virtual-emptty-conf rs
2025-09-10 21:48   ` Patchtest results for " patchtest
2025-09-10 21:28 ` [oe-core][PATCHv7 5/6] weston: remove deprecated weston-start scripts rs
2025-09-10 21:28 ` [oe-core][PATCHv7 6/6] xserver-nodm-init: convert to virtual-emptty-conf rs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250910212855.2480561-2-rs@ti.com \
    --to=rs@ti.com \
    --cc=afd@ti.com \
    --cc=alex@linutronix.de \
    --cc=denis@denix.org \
    --cc=detheridge@ti.com \
    --cc=kexin.hao@windriver.com \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=otavio@ossystems.com.br \
    --cc=reatmon@ti.com \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=ross.burton@arm.com \
    --cc=vijayp@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox