xserver: Branch 'master' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 17 23:43:12 UTC 2024


 include/meson.build |    1 -
 meson_options.txt   |    3 ++-
 os/meson.build      |   34 +++++++++++++++++++++++++++++-----
 3 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit 620b678cfedd476e4b83f1acb453e079222ea182
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Mar 28 12:59:38 2024 +0100

    os: secure-rpc: make build option tristate
    
    Add support `auto` mode, which only enables secure-rpc when
    dependencies are met.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1441>

diff --git a/meson_options.txt b/meson_options.txt
index 49407198c..e831d1dc9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -33,7 +33,8 @@ option('serverconfigdir', type: 'string',
 option('glx', type: 'boolean', value: true)
 option('xdmcp', type: 'boolean', value: true)
 option('xdm-auth-1', type: 'boolean', value: true)
-option('secure-rpc', type: 'boolean', value: true)
+option('secure-rpc', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
+       description: 'Enable Secure-RPC (DES) authentication')
 option('ipv6', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto')
 option('input_thread', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto')
 
diff --git a/os/meson.build b/os/meson.build
index 047606a09..25a00af90 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -60,23 +60,38 @@ os_dep = []
 os_c_args = []
 
 rpc_dep = []
-if get_option('secure-rpc')
+opt_secure_rpc = get_option('secure-rpc')
+if opt_secure_rpc != 'false'
+    build_secure_rpc = true
+
     # prefer libtirpc (if available), otherwise ensure RPC functions are
     # provided by libc.
     rpc_dep = dependency('libtirpc', required: false, include_type: 'system')
     if not (rpc_dep.found() or cc.has_header('rpc/rpc.h'))
-        error('secure-rpc requested, but neither libtirpc or libc RPC support were found')
+        if opt_secure_rpc == 'true'
+            error('secure-rpc requested, but neither libtirpc or libc RPC support were found')
+        else
+            message('secure-rpc disabled since neither libtirpc or libc RPC support were found')
+            build_secure_rpc = false
+        endif
     endif
     # XXX: also check if RPC library provides xdr_opaque_auth, authdes_(sec)create ???
-    srcs_os += 'rpcauth.c'
 
     if not (cc.has_member('struct authdes_cred', 'adc_fullname',
                           prefix : '#include <rpc/rpc.h>',
                           dependencies: rpc_dep))
-        error('secure-rpc requested, but RPC implementation lacking struct authdes_cred')
+        if opt_secure_rpc == 'true'
+            error('secure-rpc requested, but RPC implementation lacking struct authdes_cred')
+        else
+            message('secure-rpc disable since RPC implementation lacking struct authdes_cred')
+            build_secure_rpc = false
+        endif
     endif
 
-    os_c_args += '-DSECURE_RPC'
+    if build_secure_rpc
+        os_c_args += '-DSECURE_RPC'
+        srcs_os += 'rpcauth.c'
+    endif
 endif
 
 if get_option('xres')
commit 339717bac6cbce7c20fd7ef217e7e17a96557970
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Mar 28 12:10:49 2024 +0100

    os: secure-rpc: check struct authdes_cred
    
    Some platforms (eg. NetBSD) don't have DES support in rpc anymore, so we
    should check, in order to prevent weird, hard to understand build breaks.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1441>

diff --git a/os/meson.build b/os/meson.build
index ee030a1d0..047606a09 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -70,6 +70,12 @@ if get_option('secure-rpc')
     # XXX: also check if RPC library provides xdr_opaque_auth, authdes_(sec)create ???
     srcs_os += 'rpcauth.c'
 
+    if not (cc.has_member('struct authdes_cred', 'adc_fullname',
+                          prefix : '#include <rpc/rpc.h>',
+                          dependencies: rpc_dep))
+        error('secure-rpc requested, but RPC implementation lacking struct authdes_cred')
+    endif
+
     os_c_args += '-DSECURE_RPC'
 endif
 
commit d2d3f4a7009ec08672f765a1f01c130fada081ef
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Wed Mar 27 11:13:53 2024 +0100

    os: define SECURE_RPC locally instead of global config header
    
    Since this define is only used inside os subdir, move the definition there
    and out of the global config header. This also makes some further steps,
    e.g. checking whether it's supported, a litle bit easier.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1441>

diff --git a/include/meson.build b/include/meson.build
index 30f44c7d7..025a5443e 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -131,7 +131,6 @@ conf_data.set_quoted('COMPILEDDEFAULTFONTPATH', default_font_path)
 conf_data.set('XORG_VERSION_CURRENT', release)
 
 conf_data.set('HASXDMAUTH', has_xdm_auth ? '1' : false)
-conf_data.set('SECURE_RPC', get_option('secure-rpc') ? '1' : false)
 
 conf_data.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h') ? '1' : false)
 conf_data.set('HAVE_EXECINFO_H', cc.has_header('execinfo.h') ? '1' : false)
diff --git a/os/meson.build b/os/meson.build
index 84acc0924..ee030a1d0 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -56,6 +56,9 @@ if get_option('xdmcp')
     srcs_os += 'xdmcp.c'
 endif
 
+os_dep = []
+os_c_args = []
+
 rpc_dep = []
 if get_option('secure-rpc')
     # prefer libtirpc (if available), otherwise ensure RPC functions are
@@ -66,10 +69,10 @@ if get_option('secure-rpc')
     endif
     # XXX: also check if RPC library provides xdr_opaque_auth, authdes_(sec)create ???
     srcs_os += 'rpcauth.c'
+
+    os_c_args += '-DSECURE_RPC'
 endif
 
-os_dep = []
-os_c_args = []
 if get_option('xres')
     # Only the XRes extension cares about the client ID.
     os_c_args += '-DCLIENTIDS'


More information about the xorg-commit mailing list