xserver-multidpi/include
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
..
.gitignore .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
busfault.h Trap SIGBUS to handle truncated shared memory segments 2013-11-11 15:16:07 -08:00
callback.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
client.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
closestr.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
closure.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
colormap.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
colormapst.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
cursor.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
cursorstr.h dix: FIXES is not optional 2013-09-10 13:28:24 -04:00
dbus-core.h dbus-core: Make dbus-core no longer mutually exclusive with udev 2014-01-29 15:28:58 -08:00
dix-config-apple-verbatim.h Move the apple fat binary hacks back to a header file, and make it apple-only. 2009-01-30 16:36:45 -08:00
dix-config.h.in Xorg: Add a suid root wrapper 2014-03-12 08:50:05 +01:00
dix.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
dixaccess.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dixevents.h dix: Remove redundant declarations. 2012-05-14 13:31:00 +01:00
dixfont.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
dixfontstr.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dixfontstubs.h include: GetClientResolutions is declared in font.h 2014-01-22 19:56:31 -08:00
dixgrabs.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
dixstruct.h dix: Praise clients which haven't run for a while, rather than idle clients 2014-01-23 10:10:28 -08:00
eventconvert.h input: drop FP1616 macro 2012-11-19 12:12:23 +10:00
events.h Add support for XI2.3: Pointer barrier events and releases. 2012-12-17 15:01:45 +10:00
eventstr.h Delete stray ; in struct _DeviceChangedEvent 2014-02-09 17:21:20 -08:00
exevents.h dix: Move DeviceFocusEvent from Xi into enterleave.c 2012-05-17 08:50:44 +10:00
extension.h Constify argument to LoadExtension 2012-11-21 11:13:55 +11:00
extinit.h present: Add Present extension 2013-10-31 16:59:18 -07:00
extnsionst.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
gc.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
gcstruct.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
globals.h Clean up warnings in DIX 2014-01-12 10:14:49 -08:00
glx_extinit.h glx: drop GLX_LIBS from X server and workaround sdksyms. 2012-07-25 23:30:53 -07:00
hotplug.h hotplug: Extend OdevAttributes for server-managed fd support 2014-03-03 08:13:55 +01:00
input.h include: make the various button array lengths more obvious 2014-02-05 07:50:10 +10:00
inputstr.h input: un-constify dev->name 2014-02-04 11:27:48 +10:00
inpututils.h dix: split xi2_mask_isset into a per-device function 2012-12-12 17:25:16 +10:00
kdrive-config.h.in kdrive: Add option to compile out input drivers 2010-01-06 19:47:53 +06:00
list.h list: Avoid using X types 2013-09-10 13:28:24 -04:00
Makefile.am systemd-logind: Add systemd-logind "core" 2014-03-03 08:13:55 +01:00
misc.h Revert "os: xstrtokenize takes and returns const char * now" 2014-02-04 11:27:48 +10:00
miscstruct.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
opaque.h Clean up warnings in DIX 2014-01-12 10:14:49 -08:00
optionstr.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
os.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
pixmap.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
pixmapstr.h dix/pixmap: track dirty pixmaps in server. (v4) 2012-07-07 10:37:11 +01:00
privates.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
property.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
propertyst.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
protocol-versions.h present: Don't use the major/minor version from the protocol headers 2013-12-13 14:59:04 -05:00
ptrveloc.h dix: indentation fixes for pointer acceleration 2012-05-16 10:59:35 +10:00
region.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
regionstr.h Add a RegionDuplicate function 2013-10-31 16:58:16 -07:00
registry.h dix: add missing dixFreeRegistry define 2013-06-06 08:12:38 +10:00
resource.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
rgb.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
screenint.h dix: don't use "new" as a parameter name 2012-07-25 09:27:11 -07:00
scrnintstr.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
selection.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
servermd.h ARM64: Add support for aarch64 2013-11-06 16:41:49 -08:00
site.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
swaprep.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
swapreq.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
systemd-logind.h xserver: fix build since system-logind.h 2014-03-09 18:44:59 -07:00
validate.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
version-config.h.in Move VENDOR_* defines from AC_SUBST to a header to avoid angering shave. 2009-04-14 10:35:44 -04:00
window.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
windowstr.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
XIstubs.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xkb-config.h.in Move to autoconf standard function name checks & defines 2011-12-05 14:32:45 -08:00
xkbfile.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xkbrules.h xkb: add a call to init an XkbRMLVOSet from const chars 2014-02-04 10:53:59 +10:00
xkbsrv.h xkb: push locked modifier state down to attached slave devices 2014-03-11 17:43:34 +10:00
xkbstr.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xorg-config.h.in Remove dix-config.h config variables from xorg-config.h 2013-11-11 15:11:52 -08:00
xorg-server.h.in Add 'FONT_PATH_NAME_ELEMENT_CONST' to dix-config.h and xorg-server.h 2014-01-22 19:56:31 -08:00
Xprintf.h os/xprintf: add Xvscnprintf and Xscnprintf 2012-05-03 14:59:23 +10:00
xserver-properties.h Add missing labels for multitouch valuators 2012-10-30 15:11:10 +10:00
xsha1.h Move SHA1 computation from render/glyph.c to os/ 2009-10-15 01:17:44 +02:00
xwin-config.h.in Xorg: Add a suid root wrapper 2014-03-12 08:50:05 +01:00