SHA256
1
0
forked from pool/kmod
kmod/configure-Check-that-provided-paths-are-absolute.patch
Jan Engelhardt 4970184c4d Accepting request 1131480 from home:michals
- Add upstream fixes since v31
  * tools-depmod-fix-Walloc-size.patch
  * libkmod-remove-pkcs7-obj_to_hash_algo.patch
  * configure-Check-that-provided-paths-are-absolute.patch
- Refresh usrmerge patches to upstream version (cosmetic change only)

OBS-URL: https://build.opensuse.org/request/show/1131480
OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=234
2023-12-07 07:44:14 +00:00

47 lines
1.5 KiB
Diff

From 48b0c75f79f86140314b9656d3d855a515e18a73 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Fri, 10 Nov 2023 13:13:55 +0100
Subject: [PATCH 8/9] configure: Check that provided paths are absolute
configure checks that its built-in directory options get an absolute
path. Copy the check for custom options.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Link: https://lore.kernel.org/r/8aff0c9c491d8afeec7f6b2cd96cbd0439e26fbb.1699618135.git.msuchanek@suse.de
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
---
configure.ac | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/configure.ac b/configure.ac
index d6da5ee9ae9a..de01e08cf2e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,6 +97,23 @@ AC_ARG_WITH([module_directory],
[], [with_module_directory=/lib/modules])
AC_SUBST([module_directory], [$with_module_directory])
+# Check all directory arguments for consistency.
+for ac_var in distconfdir rootlibdir module_directory
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*@<:@^/@:>@\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ @<:@\\/$@:>@* | ?:@<:@\\/@:>@* ) continue;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
AC_ARG_WITH([zstd],
AS_HELP_STRING([--with-zstd], [handle Zstandard-compressed modules @<:@default=disabled@:>@]),
[], [with_zstd=no])
--
2.42.0