Blame SOURCES/0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch

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