summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch
blob: 3a59ba0c87b5b02fdd5de7500afd3c38e2e56143 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 6c145cea35f0b77613d6e3f48679c976b9839d7c Mon Sep 17 00:00:00 2001
From: Ronan Le Martret <ronan.lemartret@iot.bzh>
Date: Wed, 31 May 2017 22:48:18 +0000
Subject: [PATCH] Allow regular users to launch Weston

Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>

diff --git a/configure.ac b/configure.ac
index 50f8e013..2043b9b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,12 @@ PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0],
                   [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1,
 	             [Define if xkbcommon is 0.5.0 or newer])],true)
 
+AC_ARG_ENABLE(sys-uid, [  --enable-sys-uid],,
+              enable_sys_uid=no)
+if test x$enable_sys_uid = xyes; then
+	AC_DEFINE(ENABLE_SYS_UID, [1], [Allow regular users to launch Weston])
+fi
+
 AC_ARG_ENABLE(setuid-install, [  --enable-setuid-install],,
 	      enable_setuid_install=yes)
 AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
index e0ce6d63..d0db9bb5 100644
--- a/libweston/launcher-direct.c
+++ b/libweston/launcher-direct.c
@@ -283,8 +283,10 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
 {
 	struct launcher_direct *launcher;
 
+#ifndef ENABLE_SYS_UID
 	if (geteuid() != 0)
 		return -EINVAL;
+#endif
 
 	launcher = zalloc(sizeof(*launcher));
 	if (launcher == NULL)