summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/wayland/weston/groups.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/wayland/weston/groups.patch')
-rw-r--r--meta/recipes-graphics/wayland/weston/groups.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-graphics/wayland/weston/groups.patch b/meta/recipes-graphics/wayland/weston/groups.patch
new file mode 100644
index 0000000000..9dc043ac3b
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/groups.patch
@@ -0,0 +1,47 @@
1Upstream-Status: Submitted (https://bugs.freedesktop.org/show_bug.cgi?id=65933)
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From 42821739a228a85ce3432be1796858e5cc31688b Mon Sep 17 00:00:00 2001
5From: Quentin Glidic <sardemff7+git@sardemff7.net>
6Date: Wed, 19 Jun 2013 15:27:11 +0200
7Subject: [PATCH weston] weston-launch: Set all groups for user
8
9Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
10---
11 configure.ac | 2 +-
12 src/weston-launch.c | 4 ++++
13 2 files changed, 5 insertions(+), 1 deletion(-)
14
15diff --git a/configure.ac b/configure.ac
16index b625221..db3feb0 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -52,7 +52,7 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
20 [[#include <time.h>]])
21 AC_CHECK_HEADERS([execinfo.h])
22
23-AC_CHECK_FUNCS([mkostemp strchrnul])
24+AC_CHECK_FUNCS([mkostemp strchrnul initgroups])
25
26 COMPOSITOR_MODULES="wayland-server >= 1.1.90 xkbcommon pixman-1"
27
28diff --git a/src/weston-launch.c b/src/weston-launch.c
29index 76dcede..7d7b556 100644
30--- a/src/weston-launch.c
31+++ b/src/weston-launch.c
32@@ -631,9 +631,13 @@ main(int argc, char *argv[])
33 }
34
35 if (setgid(wl.pw->pw_gid) < 0 ||
36+#ifdef HAVE_INITGROUPS
37+ initgroups(wl.pw->pw_name, wl.pw->pw_gid) < 0 ||
38+#endif
39 setuid(wl.pw->pw_uid) < 0)
40 error(1, errno, "dropping privilidges failed");
41
42+
43 if (sleep_fork) {
44 if (wl.verbose)
45 printf("weston-launch: waiting %d seconds\n", sleep_fork);
46--
471.8.3