x11-base/xorg-server: elogind integration, -suid by default.
authorPiotr Karbowski <slashbeast@gentoo.org>
Thu, 21 Mar 2019 19:39:09 +0000 (20:39 +0100)
committerPiotr Karbowski <slashbeast@gentoo.org>
Thu, 21 Mar 2019 19:39:09 +0000 (20:39 +0100)
This enables users that does not run systemd to have suid-less Xorg. A
privileged entity is required for SETMASTER and DROPMASTER calls to get
control over framebuffer. Additionally elogind with udev grant user
access to input device nodes and elogind alone interfaces the
SETMASTER/DROPMASTER calls.

Xorg-server will do keeptty automatically, meaning one does not need to
pass any extra parameters to `startx` to get things working, It does
take adventage of $XDG_SEAT and $XDG_VTNR set by pam_elogind upon login.

Although it's possible to run rootless without udev (with any /dev
manager, like mdev of busybox), the configure flag that USE=elogind
enables (--enable-systemd-logind) checks if udev toggle is also enabled.
This leads to a situation where udev needs to be present on user system
while building, however, udev does not needs to be running, as long as
user is in video and input system groups, elogind is running and user
logged in when pam_elogind.so was enabled Xorg will start as regular
user.

Closes: https://bugs.gentoo.org/670930
Ack-by: Matt Turner <mattst88@gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Piotr Karbowski <slashbeast@gentoo.org>
x11-base/xorg-server/metadata.xml
x11-base/xorg-server/xorg-server-1.20.4.ebuild
x11-base/xorg-server/xorg-server-9999.ebuild

index 74e52195b253424376a1d03af6c3a2b3e73bf9e8..5c14eec54c868854406f05227cd4051d0195a9cd 100644 (file)
@@ -7,6 +7,7 @@
 </maintainer>
 <use>
        <flag name="dmx">Build the Distributed Multiheaded X server</flag>
+       <flag name="elogind">Use elogind to get control over framebuffer when running as regular user</flag>
        <flag name="glamor">Enable Glamor OpenGL 2D acceleration</flag>
        <flag name="kdrive">Build the kdrive X servers</flag>
        <flag name="unwind">Enable libunwind usage for backtraces</flag>
index 6a9a3eb1cea420cdb2e665a5940c9d21bd8224d1..e5f0a8e00eee9fc060ba72fce880e92ce40c0933 100644 (file)
@@ -15,7 +15,7 @@ if [[ ${PV} != 9999* ]]; then
 fi
 
 IUSE_SERVERS="dmx kdrive wayland xephyr xnest xorg xvfb"
-IUSE="${IUSE_SERVERS} debug +glamor ipv6 libressl minimal selinux +suid systemd +udev unwind xcsecurity"
+IUSE="${IUSE_SERVERS} debug elogind +glamor ipv6 libressl minimal selinux suid systemd +udev unwind xcsecurity"
 
 CDEPEND=">=app-eselect/eselect-opengl-1.3.0
        !libressl? ( dev-libs/openssl:0= )
@@ -81,7 +81,13 @@ CDEPEND=">=app-eselect/eselect-opengl-1.3.0
        systemd? (
                sys-apps/dbus
                sys-apps/systemd
-       )"
+       )
+       elogind? (
+               sys-apps/dbus
+               sys-auth/elogind
+               sys-auth/pambase[elogind]
+       )
+       "
 
 DEPEND="${CDEPEND}
        sys-devel/flex
@@ -107,6 +113,8 @@ PDEPEND="
 REQUIRED_USE="!minimal? (
                || ( ${IUSE_SERVERS} )
        )
+       elogind? ( udev )
+       !suid? ( ^^ ( elogind systemd ) )
        minimal? ( !glamor !wayland )
        xephyr? ( kdrive )"
 
@@ -156,8 +164,8 @@ pkg_setup() {
                $(use_enable udev config-udev)
                $(use_with doc doxygen)
                $(use_with doc xmlto)
+               $(usex !elogind $(use_enable systemd systemd-logind) '--enable-systemd-logind')
                $(use_with systemd systemd-daemon)
-               $(use_enable systemd systemd-logind)
                $(usex suid $(use_enable systemd suid-wrapper) '--disable-suid-wrapper')
                $(usex suid $(use_enable !systemd install-setuid) '--disable-install-setuid')
                --enable-libdrm
index 187e506211e4f3b123297bae259077eabd35dba8..37a691793700c1e4a2a26efa7340959e818280c9 100644 (file)
@@ -14,7 +14,7 @@ if [[ ${PV} != 9999* ]]; then
 fi
 
 IUSE_SERVERS="dmx kdrive wayland xephyr xnest xorg xvfb"
-IUSE="${IUSE_SERVERS} debug +glamor ipv6 libressl minimal selinux +suid systemd +udev unwind xcsecurity"
+IUSE="${IUSE_SERVERS} debug elogind +glamor ipv6 libressl minimal selinux suid systemd +udev unwind xcsecurity"
 
 CDEPEND=">=app-eselect/eselect-opengl-1.3.0
        !libressl? ( dev-libs/openssl:0= )
@@ -80,7 +80,13 @@ CDEPEND=">=app-eselect/eselect-opengl-1.3.0
        systemd? (
                sys-apps/dbus
                sys-apps/systemd
-       )"
+       )
+       elogind? (
+               sys-apps/dbus
+               sys-auth/elogind
+               sys-auth/pambase[elogind]
+       )
+       "
 
 DEPEND="${CDEPEND}
        sys-devel/flex
@@ -106,6 +112,8 @@ PDEPEND="
 REQUIRED_USE="!minimal? (
                || ( ${IUSE_SERVERS} )
        )
+       elogind? ( udev )
+       !suid? ( ^^ ( elogind systemd ) )
        minimal? ( !glamor !wayland )
        xephyr? ( kdrive )"
 
@@ -152,8 +160,8 @@ pkg_setup() {
                $(use_enable udev config-udev)
                $(use_with doc doxygen)
                $(use_with doc xmlto)
+               $(usex !elogind $(use_enable systemd systemd-logind) '--enable-systemd-logind')
                $(use_with systemd systemd-daemon)
-               $(use_enable systemd systemd-logind)
                $(usex suid $(use_enable systemd suid-wrapper) '--disable-suid-wrapper')
                $(usex suid $(use_enable !systemd install-setuid) '--disable-install-setuid')
                --enable-libdrm