diff options
| author | root <root@alpha.trunkmasters.com> | 2026-07-22 03:04:36 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-07-22 03:04:36 -0500 |
| commit | 63ccd2e4ddd6295605ea83ff6f5e2337785496e5 (patch) | |
| tree | c2e8b95c36b14703e41de0de4fe7cb686ee24eea /sys-auth | |
| parent | 805088e14f2164ec415b97288657da8492869f97 (diff) | |
| download | baldeagleos-repo-63ccd2e4ddd6295605ea83ff6f5e2337785496e5.tar.gz baldeagleos-repo-63ccd2e4ddd6295605ea83ff6f5e2337785496e5.tar.xz baldeagleos-repo-63ccd2e4ddd6295605ea83ff6f5e2337785496e5.zip | |
Adding metadata
Diffstat (limited to 'sys-auth')
| -rw-r--r-- | sys-auth/seatd/files/seatd-0.9.3-PR5-sd_bus-int-vs-bool.patch | 80 | ||||
| -rw-r--r-- | sys-auth/seatd/seatd-0.9.3-r1.ebuild | 76 |
2 files changed, 156 insertions, 0 deletions
diff --git a/sys-auth/seatd/files/seatd-0.9.3-PR5-sd_bus-int-vs-bool.patch b/sys-auth/seatd/files/seatd-0.9.3-PR5-sd_bus-int-vs-bool.patch new file mode 100644 index 000000000000..e9bb1a068b8b --- /dev/null +++ b/sys-auth/seatd/files/seatd-0.9.3-PR5-sd_bus-int-vs-bool.patch @@ -0,0 +1,80 @@ +From bfa73ab87c881d32170e87a724c4ed835fa11260 Mon Sep 17 00:00:00 2001 +From: Pepper Gray <hello@peppergray.xyz> +Date: Mon, 20 Jul 2026 23:16:21 +0200 +Subject: [PATCH] fix sd_bus get/read: use int instead of bool +X-Archived-At: https://github.com/kennylevinsen/seatd/pull/5 + +seatd fails to read the correct active state on ppc32/musl/llvm: + +the functions `sd_bus_message_read_basic` and `sd_bus_get_property_trivial` +use `bool` to read values which fails on big endian. + +sd_bus_message_read / Examples / Read a boolean value: +```C +sd_bus_message *m; +int x; /* Do not use C99 "bool" type here, it is typically smaller + in memory and would cause memory corruption */ + +sd_bus_message_read(m, "b", &x); +``` + +bool is 1 byte while int is 4/8 byte, thus +`true = 01 00 00 00 (little endian)` +`true = 00 00 00 01 (big endian)` +hence this always reads 0 and reports as inactive on big endian + +Bugs: https://bugs.gentoo.org/979604 +Signed-off-by: Pepper Gray <hello@peppergray.xyz> +--- a/libseat/backend/logind.c ++++ b/libseat/backend/logind.c +@@ -287,12 +287,14 @@ static const char *seat_name(struct libseat *base) { + + static int session_get_active(struct backend_logind *session, bool *active) { + sd_bus_error error = SD_BUS_ERROR_NULL; ++ int value; + int ret = sd_bus_get_property_trivial(session->bus, "org.freedesktop.login1", session->path, + "org.freedesktop.login1.Session", "Active", &error, +- 'b', active); ++ 'b', &value); + if (ret < 0) { + log_errorf("Could not check if session is active: %s", error.message); + } ++ *active = (value != 0); + + sd_bus_error_free(&error); + return ret; +@@ -441,14 +443,14 @@ static int handle_properties_changed(sd_bus_message *msg, void *userdata, sd_bus + goto error; + } + +- bool value; ++ int value; + ret = sd_bus_message_read_basic(msg, 'b', &value); + if (ret < 0) { + goto error; + } + + log_debugf("%s state changed: %d", field, value); +- set_active(session, value); ++ set_active(session, value != 0); + ret = sd_bus_message_exit_container(msg); + if (ret < 0) { + goto error; +@@ -486,7 +488,7 @@ static int handle_properties_changed(sd_bus_message *msg, void *userdata, sd_bus + sd_bus_error error = SD_BUS_ERROR_NULL; + const char *obj = "org.freedesktop.login1.Session"; + const char *field = "Active"; +- bool value; ++ int value; + ret = sd_bus_get_property_trivial(session->bus, "org.freedesktop.login1", + session->path, obj, field, &error, 'b', + &value); +@@ -496,7 +498,7 @@ static int handle_properties_changed(sd_bus_message *msg, void *userdata, sd_bus + } + + log_debugf("%s state changed: %d", field, value); +- set_active(session, value); ++ set_active(session, value != 0); + } + } + if (ret < 0) { diff --git a/sys-auth/seatd/seatd-0.9.3-r1.ebuild b/sys-auth/seatd/seatd-0.9.3-r1.ebuild new file mode 100644 index 000000000000..3da20bfe49c3 --- /dev/null +++ b/sys-auth/seatd/seatd-0.9.3-r1.ebuild @@ -0,0 +1,76 @@ +# Copyright 2020-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson systemd + +DESCRIPTION="Minimal seat management daemon and universal library" +HOMEPAGE="https://sr.ht/~kennylevinsen/seatd" +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://git.sr.ht/~kennylevinsen/seatd" +else + KEYWORDS="~alpha amd64 arm arm64 ~loong ~ppc ppc64 ~riscv ~sparc x86" + SRC_URI="https://git.sr.ht/~kennylevinsen/seatd/archive/${PV}.tar.gz -> ${P}.tar.gz" +fi +LICENSE="MIT" +SLOT="0/1" +IUSE="builtin elogind selinux server systemd" +REQUIRED_USE="?? ( elogind systemd )" + +DEPEND=" + elogind? ( sys-auth/elogind ) + systemd? ( sys-apps/systemd:= ) +" +RDEPEND="${DEPEND} + server? ( acct-group/seat ) + selinux? ( sec-policy/selinux-seatd ) +" +BDEPEND=">=app-text/scdoc-1.9.7" + +PATCHES=( + "${FILESDIR}/seatd-0.9.3-PR5-sd_bus-int-vs-bool.patch" +) + +src_prepare() { + # -fhardened conflicts with user setting -mindirect-branch=thunk + # https://codeberg.org/gentoo/gentoo/pulls/208#issuecomment-11187149 + # Also means no longer redefining Gentoo's _FORTIFY_SOURCE + sed -i '/-fhardened/d' meson.build || die + + default +} + +src_configure() { + local emesonargs=( + -Dman-pages=enabled + $(meson_feature builtin libseat-builtin) + $(meson_feature server) + ) + + if use elogind ; then + emesonargs+=( -Dlibseat-logind=elogind ) + elif use systemd; then + emesonargs+=( -Dlibseat-logind=systemd ) + else + emesonargs+=( -Dlibseat-logind=disabled ) + fi + + meson_src_configure +} + +src_install() { + meson_src_install + + if use server; then + newinitd "${FILESDIR}/seatd.initd-r1" seatd + systemd_dounit contrib/systemd/seatd.service + + if has_version '<sys-auth/seatd-0.7.0-r2'; then + elog "For OpenRC users: seatd is now using the 'seat' group instead of the 'video' group" + elog "Make sure your user(s) are in the 'seat' group." + elog "Note: 'video' is still needed for GPU access like OpenGL" + fi + fi +} |
