Upgrade to thud
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston / 0001-Allow-regular-users-to-launch-Weston_2.0.0.patch
1 From 6c145cea35f0b77613d6e3f48679c976b9839d7c Mon Sep 17 00:00:00 2001
2 From: Ronan Le Martret <ronan.lemartret@iot.bzh>
3 Date: Wed, 31 May 2017 22:48:18 +0000
4 Subject: [PATCH] Allow regular users to launch Weston
5
6 Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
7
8 diff --git a/configure.ac b/configure.ac
9 index 50f8e013..2043b9b0 100644
10 --- a/configure.ac
11 +++ b/configure.ac
12 @@ -156,6 +156,12 @@ PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0],
13                    [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1,
14                      [Define if xkbcommon is 0.5.0 or newer])],true)
15  
16 +AC_ARG_ENABLE(sys-uid, [  --enable-sys-uid],,
17 +              enable_sys_uid=no)
18 +if test x$enable_sys_uid = xyes; then
19 +       AC_DEFINE(ENABLE_SYS_UID, [1], [Allow regular users to launch Weston])
20 +fi
21 +
22  AC_ARG_ENABLE(setuid-install, [  --enable-setuid-install],,
23               enable_setuid_install=yes)
24  AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
25 diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
26 index e0ce6d63..d0db9bb5 100644
27 --- a/libweston/launcher-direct.c
28 +++ b/libweston/launcher-direct.c
29 @@ -283,8 +283,10 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
30  {
31         struct launcher_direct *launcher;
32  
33 +#ifndef ENABLE_SYS_UID
34         if (geteuid() != 0)
35                 return -EINVAL;
36 +#endif
37  
38         launcher = zalloc(sizeof(*launcher));
39         if (launcher == NULL)