[PATCH 1/2] compositor: drop privileges if not using the drm backend

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Mon Jan 30 05:02:05 PST 2012


Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
---
 src/compositor.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index ab184ac..0d63e2a 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2222,10 +2222,14 @@ int main(int argc, char *argv[])
 			backend = "x11-backend.so";
 		else if (getenv("OPENWFD"))
 			backend = "openwfd-backend.so";
-		else
-			backend = "drm-backend.so";
 	}
 
+	/* Only drm-backend needs root privileges. */
+	if (backend)
+		seteuid(getuid());
+	else
+		backend = "drm-backend.so";
+
 	if (!shell)
 		shell = "desktop-shell.so";
 
-- 
1.7.4.1



More information about the wayland-devel mailing list