From f54e1b11589f4178007e16d6e8fdd35682ad2892 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Feb 04 2023 07:21:56 +0000 Subject: Fix loading of mod_rewrite (rhbz#2166454) - Ensure mod_rewrite is linked against libidn2 so that it loads properly (rhbz#2166454, https://github.com/proftpd/proftpd/issues/1590) - No longer need to explicitly remove libtool archives from Fedora 36 onwards --- diff --git a/1592.patch b/1592.patch new file mode 100644 index 0000000..b50ff59 --- /dev/null +++ b/1592.patch @@ -0,0 +1,139 @@ +From c2c1232255d35ca641709a7dfbd3b70a6cb155bf Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Fri, 3 Feb 2023 11:04:24 -0800 +Subject: [PATCH] Issue #1590: When we properly detect (via linking) the + `libidn2` library, make sure that the proper linker flags are set, especially + for linking dynamic modules. + +--- + configure | 20 ++++++++++++++++---- + configure.in | 14 ++++++++++++-- + 2 files changed, 28 insertions(+), 6 deletions(-) + +diff --git a/configure b/configure +index 8db039b50..03d973203 100755 +--- a/configure ++++ b/configure +@@ -21447,6 +21447,8 @@ rm -f core conftest.err conftest.$ac_objext \ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for idn2_to_ascii_8z" >&5 + $as_echo_n "checking for idn2_to_ascii_8z... " >&6; } ++old_libs=$LIBS ++LIBS="-lidn2 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -21468,7 +21470,7 @@ main () + return 0; + } + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } +@@ -21476,18 +21478,24 @@ $as_echo "yes" >&6; } + $as_echo "#define HAVE_IDN2_TO_ASCII_8Z 1" >>confdefs.h + + MAIN_LIBS="$MAIN_LIBS -lidn2" ++ ac_orig_libs="$ac_orig_libs -lidn2" ++ SHARED_MODULE_LIBS="$SHARED_MODULE_LIBS -lidn2" + + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } ++ LIBS=$old_libs + + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for idna_to_ascii_8z" >&5 + $as_echo_n "checking for idna_to_ascii_8z... " >&6; } ++old_libs=$LIBS ++LIBS="-lidn $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -21509,7 +21517,7 @@ main () + return 0; + } + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } +@@ -21517,15 +21525,19 @@ $as_echo "yes" >&6; } + $as_echo "#define HAVE_IDNA_TO_ASCII_8Z 1" >>confdefs.h + + MAIN_LIBS="$MAIN_LIBS -lidn" ++ ac_orig_libs="$ac_orig_libs -lidn" ++ SHARED_MODULE_LIBS="$SHARED_MODULE_LIBS -lidn" + + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } ++ LIBS=$old_libs + + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dirfd" >&5 + $as_echo_n "checking for dirfd... " >&6; } +diff --git a/configure.in b/configure.in +index cd753c1f2..12a534451 100644 +--- a/configure.in ++++ b/configure.in +@@ -2058,7 +2058,9 @@ AC_TRY_LINK( + ) + + AC_MSG_CHECKING([for idn2_to_ascii_8z]) +-AC_TRY_COMPILE( ++old_libs=$LIBS ++LIBS="-lidn2 $LIBS" ++AC_TRY_LINK( + [ + #include + #ifdef HAVE_IDN2_H +@@ -2075,14 +2077,19 @@ AC_TRY_COMPILE( + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IDN2_TO_ASCII_8Z, 1, [Define if you have idn2_to_ascii_8z]) + MAIN_LIBS="$MAIN_LIBS -lidn2" ++ ac_orig_libs="$ac_orig_libs -lidn2" ++ SHARED_MODULE_LIBS="$SHARED_MODULE_LIBS -lidn2" + ], + [ + AC_MSG_RESULT(no) ++ LIBS=$old_libs + ] + ) + + AC_MSG_CHECKING([for idna_to_ascii_8z]) +-AC_TRY_COMPILE( ++old_libs=$LIBS ++LIBS="-lidn $LIBS" ++AC_TRY_LINK( + [ + #include + #ifdef HAVE_IDNA_H +@@ -2099,9 +2106,12 @@ AC_TRY_COMPILE( + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IDNA_TO_ASCII_8Z, 1, [Define if you have idna_to_ascii_8z]) + MAIN_LIBS="$MAIN_LIBS -lidn" ++ ac_orig_libs="$ac_orig_libs -lidn" ++ SHARED_MODULE_LIBS="$SHARED_MODULE_LIBS -lidn" + ], + [ + AC_MSG_RESULT(no) ++ LIBS=$old_libs + ] + ) + diff --git a/proftpd.spec b/proftpd.spec index 35a46e8..b049639 100644 --- a/proftpd.spec +++ b/proftpd.spec @@ -40,7 +40,7 @@ %undefine _strict_symbol_defs_build #global prever rc4 -%global baserelease 3 +%global baserelease 4 %global mod_vroot_version 0.9.11 Summary: Flexible, stable and highly-configurable FTP server @@ -65,6 +65,7 @@ Patch1: proftpd-1.3.8-shellbang.patch Patch3: proftpd-1.3.4rc1-mod_vroot-test.patch Patch4: proftpd-1.3.6-no-mod-wrap.patch Patch5: proftpd-1.3.6-no-mod-geoip.patch +Patch6: https://patch-diff.githubusercontent.com/raw/proftpd/proftpd/pull/1592.patch BuildRequires: coreutils BuildRequires: gcc @@ -261,6 +262,11 @@ mv contrib/README contrib/README.contrib %patch5 -b .nogeoip %endif +# Hack to ensure that dynamic modules are linked against libidn2 +# https://bugzilla.redhat.com/show_bug.cgi?id=2166454 +# https://github.com/proftpd/proftpd/issues/1590 +%patch6 -p1 -b .libidn2 + # OpenSSL Cipher Profiles introduced in Fedora 21 # Elsewhere, we use the default of DEFAULT:!ADH:!EXPORT:!DES %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 20) @@ -457,7 +463,9 @@ fi %{_libexecdir}/proftpd/mod_wrap2_file.so %{_libexecdir}/proftpd/mod_wrap2_sql.so %exclude %{_libexecdir}/proftpd/*.a +%if 0%{?fedora} < 36 && 0%{?rhel} < 10 %exclude %{_libexecdir}/proftpd/*.la +%endif %attr(331, ftp, ftp) %dir %{_localstatedir}/ftp/uploads/ %attr(750, root, root) %dir %{_localstatedir}/log/proftpd/ @@ -496,8 +504,13 @@ fi %{_mandir}/man1/ftpwho.1* %changelog +* Fri Feb 3 2023 Paul Howarth - 1.3.8-4 +- Ensure mod_rewrite is linked against libidn2 so that it loads properly + (rhbz#2166454, https://github.com/proftpd/proftpd/issues/1590) +- No longer need to explicitly remove libtool archives from Fedora 36 onwards + * Sat Jan 21 2023 Paul Howarth - 1.3.8-3 -- Add PCRE2 support +- Add PCRE2 support (rhbz#2158885) * Fri Jan 20 2023 Fedora Release Engineering - 1.3.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild