[PATCH] weston-launch: Only drop privileges if running as root

Tomeu Vizoso tomeu at tomeuvizoso.net
Tue Oct 1 03:20:29 PDT 2013


---
 src/weston-launch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/weston-launch.c b/src/weston-launch.c
index 525c61c..1b560af 100644
--- a/src/weston-launch.c
+++ b/src/weston-launch.c
@@ -577,7 +577,8 @@ launch_compositor(struct weston_launch *wl, int argc, char *argv[])
 	if (wl->new_user)
 		setup_session(wl);
 
-	drop_privileges(wl);
+	if (geteuid() == 0)
+		drop_privileges(wl);
 
 	setenv_fd("WESTON_TTY_FD", wl->tty);
 	setenv_fd("WESTON_LAUNCHER_SOCK", wl->sock[1]);
-- 
1.8.3.1



More information about the wayland-devel mailing list