[PATCH xserver 05/12] meson: Build Xorg suid wrapper

Adam Jackson ajax at redhat.com
Mon Mar 26 22:42:55 UTC 2018


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/meson.build | 25 +++++++++++++++++++++++++
 include/meson.build    |  1 +
 meson_options.txt      |  3 ++-
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build
index 8fc53e4cfd..c2a26d6a78 100644
--- a/hw/xfree86/meson.build
+++ b/hw/xfree86/meson.build
@@ -92,6 +92,12 @@ xorg_deps = [
     libdrm_dep,
 ]
 
+if get_option('suid_wrapper')
+    xorg_install_dir = get_option('libexecdir')
+else
+    xorg_install_dir = get_option('bindir')
+endif
+
 e = executable(
     'Xorg',
     srcs_xorg,
@@ -101,6 +107,7 @@ e = executable(
     link_args: linker_export_flags,
     c_args: xorg_c_args,
     install: true,
+    install_dir: xorg_install_dir,
     implib: true,
 )
 
@@ -128,6 +135,24 @@ if build_modesetting
    subdir('drivers/modesetting')
 endif
 
+if get_option('suid_wrapper')
+    executable('Xorg.wrap',
+        'xorg-wrapper.c',
+        include_directories: [inc, xorg_inc],
+        dependencies: xorg_deps,
+        c_args: xorg_c_args,
+        install: true,
+        install_dir: get_option('libexecdir'),
+        # install_mode: ['r-sr-xr-x', 0, 0],
+    )
+    configure_file(
+        input: 'Xorg.sh.in',
+        output: 'Xorg',
+        configuration: conf_data,
+        install_dir: join_paths(get_option('prefix'), get_option('bindir')),
+    )
+endif
+
 # For symbol presence testing only
 xorgserver_lib = shared_library(
     'xorgserver',
diff --git a/include/meson.build b/include/meson.build
index 10c7d2556b..69aea80955 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -86,6 +86,7 @@ conf_data.set('GBM_BO_WITH_MODIFIERS',
 conf_data.set_quoted('SERVER_MISC_CONFIG_PATH', serverconfigdir)
 conf_data.set_quoted('PROJECTROOT', get_option('prefix'))
 conf_data.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir')))
+conf_data.set_quoted('SUID_WRAPPER_DIR', join_paths(get_option('prefix'), get_option('libexecdir')))
 
 # XXX: Stopped enumerating at COMPILEDEFAULTFONTPATH
 conf_data.set('XORG_VERSION_CURRENT', release)
diff --git a/meson_options.txt b/meson_options.txt
index d7af87d733..dede8562a3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -45,7 +45,8 @@ option('os_vendor', type: 'string', value: '')
 option('int10', type: 'combo', choices: ['stub', 'x86emu', 'vm86', 'auto', 'false'],
        value: 'auto',
        description: 'Xorg int10 backend (default: usually x86emu)')
-
+option('suid_wrapper', type: 'boolean', value: 'false',
+       description: 'SUID wrapper for legacy driver support')
 option('pciaccess', type: 'boolean', value: 'true',
        description: 'Xorg pciaccess support')
 option('udev', type: 'boolean', value: 'true')
-- 
2.16.2



More information about the xorg-devel mailing list