From ffe2704d11a9691319fda11dc516733bb755f86c Mon Sep 17 00:00:00 2001 From: dataCobra Date: Tue, 12 Nov 2024 15:38:20 +0100 Subject: [PATCH] sudo: update to 1.9.16. --- srcpkgs/sudo/patches/fix-crosscompile.patch | 100 ++++++++++++++++++++ srcpkgs/sudo/template | 6 +- 2 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/sudo/patches/fix-crosscompile.patch diff --git a/srcpkgs/sudo/patches/fix-crosscompile.patch b/srcpkgs/sudo/patches/fix-crosscompile.patch new file mode 100644 index 00000000000000..74002e19e295a0 --- /dev/null +++ b/srcpkgs/sudo/patches/fix-crosscompile.patch @@ -0,0 +1,100 @@ +From 3e12cacc0f91bc27f0c8d627843bd22c8b5bb6fa Mon Sep 17 00:00:00 2001 +From: "Todd C. Miller" +Date: Mon, 2 Sep 2024 17:10:19 -0600 +Subject: [PATCH] Better test for cross-compiling when checking for C99 + snprintf + +We want to avoid calling AX_FUNC_SNPRINTF entirely if cross-compiling +since it is not possible to undo the setting of PREFER_PORTABLE_SNPRINTF. +The previous attempt to do this failed to take into account that +PREFER_PORTABLE_SNPRINTF would still be defined. GitHub issue #969 +--- + configure | 41 +++++++++++++++++++++++++++-------------- + configure.ac | 13 +++++++------ + 2 files changed, 34 insertions(+), 20 deletions(-) + +diff --git a/configure b/configure +index 18eb2bdf27..a80cad01db 100755 +--- a/configure ++++ b/configure +@@ -24790,7 +24790,31 @@ esac + COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }mktemp_test" + + fi +-ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" ++if test X"$ac_cv_build_prog_cc_c99" != X"no" -a X"$cross_compiling" = X"yes" ++then : ++ ++ # If we have a C99 compiler and are cross-compiling, assume ++ # C99-compliant v?snprintf(). ++ ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" ++if test "x$ac_cv_func_snprintf" = xyes ++then : ++ printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h ++ ++fi ++ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" ++if test "x$ac_cv_func_vsnprintf" = xyes ++then : ++ printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h ++ ++fi ++ ++ ac_cv_have_working_snprintf="$ac_cv_func_snprintf" ++ ac_cv_have_working_vsnprintf="$ac_cv_func_vsnprintf" ++ ++else case e in #( ++ e) ++ # Check for C99-compliant v?snprintf(). ++ ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" + if test "x$ac_cv_func_snprintf" = xyes + then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h +@@ -24919,19 +24943,8 @@ printf "%s\n" "$as_me: WARNING: Replacing missing/broken (v)snprintf() with sudo + printf "%s\n" "#define PREFER_PORTABLE_SNPRINTF 1" >>confdefs.h + + fi +-if test X"$ac_cv_build_prog_cc_c99" != X"no" +-then : +- +- # If we have a C99 compiler and are cross-compiling, assume +- # C99-compliant v?snprintf(). +- if test X"$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf" = X"crosscross" +-then : +- +- ac_cv_have_working_snprintf=yes +- ac_cv_have_working_vsnprintf=yes +- +-fi +- ++ ;; ++esac + fi + if test X"$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf" = X"yesyes" + then : +diff --git a/configure.ac b/configure.ac +index 28b63ef0d8..e547f79417 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3060,14 +3060,15 @@ AS_IF([test X"$sudo_mktemp" = X"yes"], [ + SUDO_APPEND_COMPAT_EXP(sudo_mkdtemp sudo_mkdtempat sudo_mkostempsat sudo_mkstemp sudo_mkstemps) + COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }mktemp_test" + ]) +-AX_FUNC_SNPRINTF +-AS_IF([test X"$ac_cv_prog_cc_c99" != X"no"], [ ++AS_IF([test X"$ac_cv_prog_cc_c99" != X"no" -a X"$cross_compiling" = X"yes"], [ + # If we have a C99 compiler and are cross-compiling, assume + # C99-compliant v?snprintf(). +- AS_IF([test X"$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf" = X"crosscross"], [ +- ac_cv_have_working_snprintf=yes +- ac_cv_have_working_vsnprintf=yes +- ]) ++ AC_CHECK_FUNCS(snprintf vsnprintf) ++ ac_cv_have_working_snprintf="$ac_cv_func_snprintf" ++ ac_cv_have_working_vsnprintf="$ac_cv_func_vsnprintf" ++], [ ++ # Check for C99-compliant v?snprintf(). ++ AX_FUNC_SNPRINTF + ]) + AS_IF([test X"$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf" = X"yesyes"], [ + # System has a C99-compliant v?snprintf(), check for v?asprintf() diff --git a/srcpkgs/sudo/template b/srcpkgs/sudo/template index 571fc60a83f044..758c8270238940 100644 --- a/srcpkgs/sudo/template +++ b/srcpkgs/sudo/template @@ -1,6 +1,6 @@ # Template file for 'sudo' pkgname=sudo -version=1.9.15p4 +version=1.9.16 revision=1 build_style=gnu-configure configure_args="--with-ignore-dot --with-insults=disabled --with-all-insults --with-env-editor @@ -8,14 +8,14 @@ configure_args="--with-ignore-dot --with-insults=disabled --with-all-insults --w --with-logfac=auth --disable-root-mailer --enable-pie --with-mdoc --sbindir=/usr/bin --disable-log-server" hostmakedepends="groff" -makedepends="zlib-devel pam-devel" +makedepends="zlib-devel pam-devel openssl-devel" short_desc="Allow others to run commands as root" maintainer="Enno Boland " license="ISC" homepage="https://www.sudo.ws/" changelog="https://www.sudo.ws/repos/sudo/raw-file/tip/NEWS" distfiles="https://www.sudo.ws/dist/sudo-${version}.tar.gz" -checksum=2e20ec9865eeeea1316c6f49ec6ac4678869b689d4d90b44243bf4887d6dd532 +checksum=c0d84d797f06b732fc573d0b798ae83128c2bc33052057f05b560ec6bcbfa03d conf_files="/etc/pam.d/sudo /etc/sudoers" lib32disabled=yes