362f6b064a134675d97f25a99db030972c2fe251
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston / 0001-Allow-regular-users-to-launch-Weston_7.0.0.patch
1 Allow regular users to launch Weston
2
3 Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
4 [Reworked for Weston 7.0.0 switch to meson]
5 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
6
7 diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
8 index 9fa329b6..8e218804 100644
9 --- a/libweston/launcher-direct.c
10 +++ b/libweston/launcher-direct.c
11 @@ -291,8 +291,10 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
12  {
13         struct launcher_direct *launcher;
14  
15 +#ifndef ENABLE_USER_START
16         if (geteuid() != 0)
17                 return -EINVAL;
18 +#endif
19  
20         launcher = zalloc(sizeof(*launcher));
21         if (launcher == NULL)
22 diff --git a/libweston/meson.build b/libweston/meson.build
23 index d8d3fc07..0d39ebf1 100644
24 --- a/libweston/meson.build
25 +++ b/libweston/meson.build
26 @@ -216,6 +216,10 @@ if get_option('weston-launch')
27         meson.add_install_script('echo', 'REMINDER: You are installing weston-launch, please make it setuid-root.')
28  endif
29  
30 +if get_option('enable-user-start')
31 +       config_h.set('ENABLE_USER_START', '1')
32 +endif
33 +
34  subdir('renderer-gl')
35  subdir('backend-drm')
36  subdir('backend-fbdev')
37 diff --git a/meson_options.txt b/meson_options.txt
38 index d5bf1d54..c93f31d1 100644
39 --- a/meson_options.txt
40 +++ b/meson_options.txt
41 @@ -217,3 +217,10 @@ option(
42         value: false,
43         description: 'Generate documentation'
44  )
45 +
46 +option(
47 +       'enable-user-start',
48 +       type: 'boolean',
49 +       value: true,
50 +       description: 'Tests: enable start as non-root user'
51 +)