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

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