commit:     fefef5fbb829b1b9c0713252713b7a8454766876
Author:     Alan Swanson <reiver <AT> improbability <DOT> net>
AuthorDate: Fri Dec  3 12:25:06 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Thu Dec 16 02:37:22 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fefef5fb

x11-base/xorg-server: Restore setuid for non-logind meson build

The meson build does not support the autotools build option
install-setuid and when not using systemd or logind the suid_wrapper is
not equivalent as it does not resolve tty or input device permissions
unless /etc/X11/Xwrapper.config is created with;

allowed_users = anybody
needs_root_rights = yes

In which case you can skip the wrapper as this would be the default
preference when using startx or xinit without systemd or logind from the
console or init scripts. So revert to previous autotools build
behaviour.

Closes: https://bugs.gentoo.org/828462
Closes: https://github.com/gentoo/gentoo/pull/23160
Signed-off-by: Alan Swanson <reiver <AT> improbability.net>
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 x11-base/xorg-server/xorg-server-9999.ebuild | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/x11-base/xorg-server/xorg-server-9999.ebuild 
b/x11-base/xorg-server/xorg-server-9999.ebuild
index f820f8cdff00..bb014071154e 100644
--- a/x11-base/xorg-server/xorg-server-9999.ebuild
+++ b/x11-base/xorg-server/xorg-server-9999.ebuild
@@ -149,7 +149,7 @@ src_configure() {
        else
                emesonargs+=(
                        -Dsystemd_logind=false
-                       $(meson_use suid suid_wrapper)
+                       -Dsuid_wrapper=false
                )
        fi
 
@@ -162,6 +162,13 @@ src_install() {
        #The new meson build system do not leave X symlink
        ln -s Xorg "${ED}"/usr/bin/X
 
+       # The meson build system does not support install-setuid
+       if ! use systemd || ! use elogind; then
+               if use suid; then
+                       chmod u+s "${ED}"/usr/bin/Xorg
+               fi
+       fi
+
        if ! use xorg; then
                rm -f "${ED}"/usr/share/man/man1/Xserver.1x \
                        "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \

Reply via email to