xserver/hw/xfree86
Hans de Goede e7b84ca469 Xorg: Add a suid root wrapper
With the recent systemd-logind changes it is possible to install the Xorg
binary without suid root rights and still have everything working as it
should *if* the user only has cards which are supported by kms.

This commit adds a little suid root wrapper, which is a bit weird, first we
strip the suid-root bit of the Xorg binary, and then we add a wrapper ?

The function of this wrapper is to see if a system still needs root-rights,
if it does not (it supports kms and the kms drivers are properly loaded),
then it will immediately drop all elevated rights before executing the real
Xorg binary. If it finds (some) cards which don't support kms, or no cards
at all, then it will execute the Xorg server with elevated rights so that
ie the nvidia binary driver and the vesa driver can keep working normally.

To make it possible for security concious users who don't need the root
rights to completely remove the wrapper, Xorg is started in a 3 step process
when the wrapper is enabled during build time:

1) A simple shell script which checks if the wrapper is there, if it is
  it executes the wrapper, if not it directly executes the real Xorg binary

2) The wrapper gets executed, does its checks, normally drops all elevated
  rights and then executes the real Xorg binary

3) The real Xorg binary does its thing

This allows distributions to put the wrapper binary in a separate package, and
will allow users to remove this package. IE the plan with Fedora is to make
"legacy" drivers depend on the wrapper pkg, and since our default install
contains some legacy drivers it will be part of the default install, but
users can later yum remove it (which will also automatically remove the
legacy driver packages as those won't work without it anyways).

The wrapper is loosely modelled after the existing Debian Xwrapper, it
uses the same config-file + config-file format, and also allows restricting
Xserver execution (through the wrapper) to console users only.

There also is a new needs_root_rights config file directive, which can
be used to override the auto-detection the wrapper does.

Hopefully this will allow Debian to replace their own wrapper with this
upstream one.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-12 08:50:05 +01:00
..
common Merge remote-tracking branch 'whot/for-keith' 2014-03-11 22:04:36 -07:00
ddc Merge remote-tracking branch 'dlespiau/20131216-4k' 2014-01-22 11:32:35 -08:00
dixmods Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
doc dix: Remove refs to mi backing store from docs 2012-09-23 10:31:39 -07:00
dri xfree86: Fix -Wshadow warnings 2014-01-22 19:56:31 -08:00
dri2 Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
exa xfree86/exa: xf86GetOptValString returns const char * now 2014-01-12 10:14:50 -08:00
fbdevhw xfree86/fbdevhw: Fix warnings 2014-01-12 10:14:50 -08:00
glamor_egl glamor: Add support for DRI3. 2014-03-05 13:10:24 -08:00
i2c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
int10 Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
loader Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
man Xorg: Add a suid root wrapper 2014-03-12 08:50:05 +01:00
modes edid: Add quirk for Sony Vaio Pro 13 2014-01-30 16:27:59 -08:00
os-support systemd-logind: Fix vt-enter not working when using a legacy video driver 2014-03-10 09:07:39 +01:00
parser xfree86: unconstify driver in the XF86ConfInputClassRec 2014-02-05 14:32:23 +10:00
ramdac Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
shadowfb Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
utils Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
vbe Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
vgahw Link libvgahw with $(PCIACCESS_LIBS) as well 2014-01-29 15:21:55 -08:00
x86emu xfree86: Fix -Wshadow warnings 2014-01-22 19:56:31 -08:00
.gitignore xfree86: Move sdksyms generation to ddx toplevel 2011-06-23 05:28:31 -07:00
Makefile.am Xorg: Add a suid root wrapper 2014-03-12 08:50:05 +01:00
Xorg.sh.in Xorg: Add a suid root wrapper 2014-03-12 08:50:05 +01:00
sdksyms.sh xfree86 warning reduction 2014-01-12 10:14:49 -08:00
xorg-wrapper.c Xorg: Add a suid root wrapper 2014-03-12 08:50:05 +01:00
xorgconf.cpp xfree86: use sed rather than cpp to perform string substitutions 2011-01-18 15:11:14 -08:00