diff --git a/sudo-configure-c99.patch b/sudo-configure-c99.patch new file mode 100644 index 0000000..69a0cd2 --- /dev/null +++ b/sudo-configure-c99.patch @@ -0,0 +1,65 @@ +Avoid implicit function declarations, so that the configure probe +results do not change with future compilers. + +Submitted upstream for discussion: + + + + +diff --git a/configure b/configure +index d406eb77a22d3c3c..29483788443d2b21 100755 +--- a/configure ++++ b/configure +@@ -31220,10 +31220,13 @@ else case e in #( + /* end confdefs.h. */ + #include + #include ++ ++void *volatile ptr; ++ + int + main (void) + { +-(void)ldap_init(0, 0) ++ptr = (void *) ldap_msgfree + ; + return 0; + } +@@ -33914,7 +33917,7 @@ then : + else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++#include + + int + main (void) +diff --git a/m4/hardening.m4 b/m4/hardening.m4 +index f7d2a8c2911ed9d6..1ebfd9fdaf461285 100644 +--- a/m4/hardening.m4 ++++ b/m4/hardening.m4 +@@ -10,7 +10,7 @@ AC_DEFUN([SUDO_CHECK_HARDENING], [ + [sudo_cv_use_fortify_source], + [AC_LINK_IFELSE([ + AC_LANG_PROGRAM( +- [[]], [[char buf[4]; (void)sprintf(buf, "%s", "foo");]] ++ [[#include ]], [[char buf[4]; (void)sprintf(buf, "%s", "foo");]] + )], + [sudo_cv_use_fortify_source=yes], + [sudo_cv_use_fortify_source=no] +diff --git a/m4/ldap.m4 b/m4/ldap.m4 +index 78c21e0bc0a1f65f..a6361df044d84f92 100644 +--- a/m4/ldap.m4 ++++ b/m4/ldap.m4 +@@ -52,7 +52,10 @@ AC_DEFUN([SUDO_CHECK_LDAP], [ + #include ]) + AC_CACHE_CHECK([whether lber.h is needed when including ldap.h], [sudo_cv_header_lber_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +-#include ]], [[(void)ldap_init(0, 0)]])], [ ++#include ++ ++void *volatile ptr; ++]], [[ptr = (void *) ldap_msgfree]])], [ + # No need to explicitly include lber.h when including ldap.h. + sudo_cv_header_lber_h=no + ], [ diff --git a/sudo.spec b/sudo.spec index 7a10271..315ea49 100644 --- a/sudo.spec +++ b/sudo.spec @@ -13,6 +13,7 @@ License: ISC URL: https://www.sudo.ws Source0: %{url}/dist/%{name}-%{version}%{?extraver}.tar.gz Source1: sudoers +Patch0: sudo-configure-c99.patch Requires: pam Recommends: system-default-editor Recommends: %{name}-python-plugin%{?_isa} = %{version}-%{release} @@ -70,7 +71,7 @@ BuildRequires: python3-devel %{name}-python-plugin allows using sudo plugins written in Python. %prep -%setup -q -n %{name}-%{version}%{?extraver} +%autosetup -p1 -n %{name}-%{version}%{?extraver} %build # Remove bundled copy of zlib