summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2020-02-08 20:36:42 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-07 10:56:45 +0000
commit0dffb9470991e497025a50347f1719461e6398f3 (patch)
tree10a8304ff71d85a9198c8531d27c93957f783ddb /meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
parentb61d8bc577cd76eb506d15a2c4c4e9016f0c20c5 (diff)
downloadpoky-0dffb9470991e497025a50347f1719461e6398f3.tar.gz
xserver-nodm-init: Fix the start failure for non-root user
In order to start the xserver, a non-root user should have the cap_sys_admin capability to set the drm master. We try to get the cap_sys_admin capability by setting it in both the thread and file inheritable set. The side effect of this is that we would have to add the "pam" to the distro features if we want use the xserver-nodm-init for a non-root user. [Yocto #11526] (From OE-Core rev: fec05cd1eaaad41fd72a29d7792f1c37d2a82f3e) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cfd71a68a4931c8bda15357ebb1e9ebcf0e302dc) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm')
-rwxr-xr-xmeta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
index 6c548551b8..116bb278bc 100755
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
@@ -38,6 +38,14 @@ case "$1" in
38 if [ -e /dev/hidraw0 ]; then 38 if [ -e /dev/hidraw0 ]; then
39 chmod o+rw /dev/hidraw* 39 chmod o+rw /dev/hidraw*
40 fi 40 fi
41 # Make sure that the Xorg has the cap_sys_admin capability which is
42 # needed for setting the drm master
43 if ! grep -q "^auth.*pam_cap\.so" /etc/pam.d/su; then
44 echo "auth optional pam_cap.so" >>/etc/pam.d/su
45 fi
46 if ! /usr/sbin/getcap $XSERVER | grep -q cap_sys_admin; then
47 /usr/sbin/setcap cap_sys_admin+eip $XSERVER
48 fi
41 fi 49 fi
42 50
43 # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211] 51 # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211]