7079f2c
From 38ae53c94a88c7bd5877c72a12582b60865e07ff Mon Sep 17 00:00:00 2001
9e2b258
From: Hans de Goede <hdegoede@redhat.com>
9e2b258
Date: Thu, 17 Apr 2014 15:50:44 +0200
7079f2c
Subject: [PATCH] Fedora hack: Make the suid-root wrapper start the server with
7079f2c
 root rights
9e2b258
9e2b258
Do NOT upstream.
9e2b258
9e2b258
Since most display managers are not ready yet to start Xorg in way which will
9e2b258
keep it working without root-rights, see:
9e2b258
https://fedoraproject.org/wiki/Changes/XorgWithoutRootRights
9e2b258
aaf1923
Just keep starting X as root for now, but do it through the wrapper, by
aaf1923
overriding the needs_root_rights = -1 (auto) default and setting it to 1.
9e2b258
aaf1923
We set a special environment variable when starting X in a way where root
aaf1923
rights are not needed (from gdm and startx) and keep the upstream
aaf1923
needs_root_rights = -1 (auto) default in that case.
9e2b258
9e2b258
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9e2b258
---
7079f2c
 hw/xfree86/xorg-wrapper.c | 3 +++
7079f2c
 1 file changed, 3 insertions(+)
9e2b258
9e2b258
diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
7079f2c
index 4c37cfc..ae5d27f 100644
9e2b258
--- a/hw/xfree86/xorg-wrapper.c
9e2b258
+++ b/hw/xfree86/xorg-wrapper.c
7079f2c
@@ -198,6 +198,9 @@ int main(int argc, char *argv[])
aaf1923
     int needs_root_rights = -1;
7079f2c
     char *const empty_envp[1] = { NULL, };
9e2b258
 
aaf1923
+    if (getenv("XORG_RUN_AS_USER_OK") == NULL)
aaf1923
+        needs_root_rights = 1;
aaf1923
+
cec8696
     progname = argv[0];
9e2b258
 
aaf1923
     parse_config(&allowed, &needs_root_rights);
9e2b258
-- 
7079f2c
2.4.3
9e2b258