When weston-launch is used as root with the -u option to switch to a non-root user, the supplementary group list isn't set so this user is a member of root's group and the primary group of the user (in my situation, the group list is "root xuser"). This doesn't work too well when permissions on /dev/dri/card0 are root:video 660, because this user isn't currently a member of video (despite /etc/group saying otherwise). Permission denied, weston fails. It looks like the solution on Linux would be to use getgrouplist()/setgroups() before setgid()/setuid().
Created attachment 81073 [details] [review] Patch to set groups for users This patch calls initgroups() if available. Built but not tested.
Patch works a treat.
This patch looks good - could you mail it to the list please?
(In reply to comment #3) > This patch looks good - could you mail it to the list please? commit 735302ea2d6a281bb326e440c091e95c403f7b7f Author: Quentin Glidic <sardemff7+git@sardemff7.net> Date: Wed Jun 19 15:27:11 2013 +0200 weston-launch: Set all groups for user Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> https://bugs.freedesktop.org/show_bug.cgi?id=65933
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.