[PATCH weston] weston-launch: Set all groups for user

Kristian Høgsberg hoegsberg at gmail.com
Mon Jul 8 10:01:02 PDT 2013


On Mon, Jul 08, 2013 at 03:32:58PM +0200, Quentin Glidic wrote:
> From: Quentin Glidic <sardemff7+git at sardemff7.net>
> 
> Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>

Thanks, nice work Quentin, committed.

Kristian

> ---
>  configure.ac        | 2 +-
>  src/weston-launch.c | 4 ++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 726eb4f..0864d10 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -52,7 +52,7 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
>  	      [[#include <time.h>]])
>  AC_CHECK_HEADERS([execinfo.h])
>  
> -AC_CHECK_FUNCS([mkostemp strchrnul])
> +AC_CHECK_FUNCS([mkostemp strchrnul initgroups])
>  
>  COMPOSITOR_MODULES="wayland-server >= 1.1.90 pixman-1"
>  
> diff --git a/src/weston-launch.c b/src/weston-launch.c
> index 76dcede..7d7b556 100644
> --- a/src/weston-launch.c
> +++ b/src/weston-launch.c
> @@ -631,9 +631,13 @@ main(int argc, char *argv[])
>  		}
>  
>  		if (setgid(wl.pw->pw_gid) < 0 ||
> +#ifdef HAVE_INITGROUPS
> +                    initgroups(wl.pw->pw_name, wl.pw->pw_gid) < 0 ||
> +#endif
>  		    setuid(wl.pw->pw_uid) < 0)
>  			error(1, errno, "dropping privilidges failed");
>  
> +
>  		if (sleep_fork) {
>  			if (wl.verbose)
>  				printf("weston-launch: waiting %d seconds\n", sleep_fork);
> -- 
> 1.8.3.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list