diff --git a/526816eb.patch b/526816eb.patch new file mode 100644 index 0000000..47181bb --- /dev/null +++ b/526816eb.patch @@ -0,0 +1,28 @@ +From 526816eb2216159fccb245293d2cfb13ea97dfa9 Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Tue, 17 May 2016 12:30:59 -0700 +Subject: [PATCH] Defensively clear the response lists before each SFTP + request, having just tracked down a segfault caused by NOT doing this + properly in a previous version of ProFTPD. + +--- + contrib/mod_sftp/fxp.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/contrib/mod_sftp/fxp.c b/contrib/mod_sftp/fxp.c +index 15b7d00..fb4f106 100644 +--- a/contrib/mod_sftp/fxp.c ++++ b/contrib/mod_sftp/fxp.c +@@ -13561,6 +13561,12 @@ int sftp_fxp_handle_packet(pool *p, void *ssh2, uint32_t channel_id, + + pr_response_set_pool(fxp->pool); + ++ /* Make sure to clear the response lists of any cruft from previous ++ * requests. ++ */ ++ pr_response_clear(&resp_list); ++ pr_response_clear(&resp_err_list); ++ + switch (fxp->request_type) { + case SFTP_SSH2_FXP_INIT: + /* If we already know the version, then the client has sent diff --git a/d800ece1.patch b/d800ece1.patch new file mode 100644 index 0000000..8803e29 --- /dev/null +++ b/d800ece1.patch @@ -0,0 +1,35 @@ +From d800ece16bd2d1f8f5e2d1cb98b59877b3487b10 Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Wed, 28 Oct 2015 18:22:42 -0700 +Subject: [PATCH] Attempt to Bug#4206 by speculatively fixing possible causes. + First, reset a static string (allocated out of a pool which is cleared on + restart) to its default. Next, remove some (useless) #ifdefs which, if + mod_lang is built as a DSO/shared module, could cause problems on module + loading IFF the system does not have the expected header. + +--- + modules/mod_lang.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/modules/mod_lang.c b/modules/mod_lang.c +index 8e08f44..0170be7 100644 +--- a/modules/mod_lang.c ++++ b/modules/mod_lang.c +@@ -716,9 +716,7 @@ static void lang_postparse_ev(const void *event_data, void *user_data) { + config_rec *c; + DIR *dirh; + server_rec *s; +-#ifdef HAVE_LIBINTL_H + const char *locale_path = NULL; +-#endif + + c = find_config(main_server->conf, CONF_PARAM, "LangEngine", FALSE); + if (c) { +@@ -888,6 +886,7 @@ static void lang_postparse_ev(const void *event_data, void *user_data) { + + static void lang_restart_ev(const void *event_data, void *user_data) { + destroy_pool(lang_pool); ++ lang_curr = LANG_DEFAULT_LANG; + lang_list = NULL; + lang_aliases = NULL; + diff --git a/d800ece16bd2d1f8f5e2d1cb98b59877b3487b10.patch b/d800ece16bd2d1f8f5e2d1cb98b59877b3487b10.patch deleted file mode 100644 index 8803e29..0000000 --- a/d800ece16bd2d1f8f5e2d1cb98b59877b3487b10.patch +++ /dev/null @@ -1,35 +0,0 @@ -From d800ece16bd2d1f8f5e2d1cb98b59877b3487b10 Mon Sep 17 00:00:00 2001 -From: TJ Saunders -Date: Wed, 28 Oct 2015 18:22:42 -0700 -Subject: [PATCH] Attempt to Bug#4206 by speculatively fixing possible causes. - First, reset a static string (allocated out of a pool which is cleared on - restart) to its default. Next, remove some (useless) #ifdefs which, if - mod_lang is built as a DSO/shared module, could cause problems on module - loading IFF the system does not have the expected header. - ---- - modules/mod_lang.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/modules/mod_lang.c b/modules/mod_lang.c -index 8e08f44..0170be7 100644 ---- a/modules/mod_lang.c -+++ b/modules/mod_lang.c -@@ -716,9 +716,7 @@ static void lang_postparse_ev(const void *event_data, void *user_data) { - config_rec *c; - DIR *dirh; - server_rec *s; --#ifdef HAVE_LIBINTL_H - const char *locale_path = NULL; --#endif - - c = find_config(main_server->conf, CONF_PARAM, "LangEngine", FALSE); - if (c) { -@@ -888,6 +886,7 @@ static void lang_postparse_ev(const void *event_data, void *user_data) { - - static void lang_restart_ev(const void *event_data, void *user_data) { - destroy_pool(lang_pool); -+ lang_curr = LANG_DEFAULT_LANG; - lang_list = NULL; - lang_aliases = NULL; - diff --git a/proftpd-1.3.5b-mysql-version-skew.patch b/proftpd-1.3.5b-mysql-version-skew.patch new file mode 100644 index 0000000..c1ef583 --- /dev/null +++ b/proftpd-1.3.5b-mysql-version-skew.patch @@ -0,0 +1,44 @@ +From 13446d7c3fab4209376e8f4917338c0141cefcb0 Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Wed, 27 Jan 2016 09:14:16 -0800 +Subject: [PATCH] If mod_sql_mysql fails to configure the character set, just + log the failure and do not treat it as a fatal error, in order to better + handle situations of client/server version skew. + +--- + contrib/mod_sql_mysql.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/contrib/mod_sql_mysql.c b/contrib/mod_sql_mysql.c +index 959709d..f55c532 100644 +--- a/contrib/mod_sql_mysql.c ++++ b/contrib/mod_sql_mysql.c +@@ -1,7 +1,7 @@ + /* + * ProFTPD: mod_sql_mysql -- Support for connecting to MySQL databases. + * Copyright (c) 2001 Andrew Houghton +- * Copyright (c) 2004-2015 TJ Saunders ++ * Copyright (c) 2004-2016 TJ Saunders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -545,8 +545,17 @@ MODRET cmd_open(cmd_rec *cmd) { + } + + if (mysql_set_character_set(conn->mysql, encoding) != 0) { +- sql_log(DEBUG_FUNC, "%s", "exiting \tmysql cmd_open"); +- return _build_error(cmd, conn); ++ /* Failing to set the character set should NOT be a fatal error. ++ * There are situations where, due to client/server mismatch, the ++ * requested character set may not be available. Thus for now, ++ * we simply log the failure. ++ * ++ * A future improvement might be to implement fallback behavior, ++ * trying to set "older" character sets as needed. ++ */ ++ sql_log(DEBUG_FUNC, MOD_SQL_MYSQL_VERSION ++ ": failed to set character set '%s': %s (%u)", encoding, ++ mysql_error(conn->mysql), mysql_errno(conn->mysql)); + } + + sql_log(DEBUG_FUNC, "MySQL connection character set now '%s' (from '%s')", diff --git a/proftpd.spec b/proftpd.spec index f102787..606e3c6 100644 --- a/proftpd.spec +++ b/proftpd.spec @@ -46,7 +46,7 @@ %global _hardened_build 1 #global prever rc3 -%global rpmrel 1 +%global rpmrel 2 %global mod_vroot_version 0.9.4 Summary: Flexible, stable and highly-configurable FTP server @@ -69,8 +69,10 @@ Source10: http://github.com/Castaglia/proftpd-mod_vroot/archive/v%{mod_vroot_ve # (they are disabled by default); it is not included as part of the built package and should therefore # not fall foul of the rules against library bundling Source13: http://search.cpan.org/CPAN/authors/id/C/CL/CLEMBURG/Test-Unit-0.14.tar.gz -Patch0: https://github.com/proftpd/proftpd/commit/d800ece16bd2d1f8f5e2d1cb98b59877b3487b10.patch +Patch0: https://github.com/proftpd/proftpd/commit/d800ece1.patch +Patch1: proftpd-1.3.5b-mysql-version-skew.patch Patch2: proftpd.conf-no-memcached.patch +Patch3: https://github.com/proftpd/proftpd/commit/526816eb.patch Patch4: proftpd-1.3.4rc1-mod_vroot-test.patch Patch5: proftpd-1.3.4-utf8.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -98,10 +100,15 @@ BuildRequires: pcre-devel >= 7.0 %if 0%{?have_libmemcached:1} BuildRequires: libmemcached-devel >= 0.41 %endif +# perl-generators needed for correct dependencies in utils sub-package +%if 0%{?fedora} > 20 || 0%{?rhel} > 7 +BuildRequires: perl-generators +%endif # Test suite requirements BuildRequires: check-devel %if 0%{?_with_integrationtests:1} +BuildRequires: perl BuildRequires: perl(Compress::Zlib) BuildRequires: perl(IO::Socket::SSL) BuildRequires: perl(Net::FTPSSL) @@ -182,6 +189,7 @@ Module to add PostgreSQL support to the ProFTPD FTP server. Summary: ProFTPD - Additional utilities Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} +Requires: perl # ftpasswd --use-cracklib requires Crypt::Cracklib %if 0%{?have_crypt_cracklib:1} BuildRequires: perl(Crypt::Cracklib) @@ -219,6 +227,15 @@ cp -p %{SOURCE1} proftpd.conf # https://retrace.fedoraproject.org/faf/reports/10744/ %patch0 -p1 +# Handle client/server version skew in mod_sql_mysql +# (https://forums.proftpd.org/smf/index.php?topic=11887.0) +%patch1 -p1 -b .mysql-version-skew + +# Fix a possible cause of segfaults in mod_sftp +# http://bugs.proftpd.org/show_bug.cgi?id=4203 +# https://bugzilla.redhat.com/show_bug.cgi?id=1337880 +%patch3 -p1 -b .sftp_segfault + # If we're running the full test suite, include the mod_vroot test %patch4 -p1 -b .test_vroot @@ -507,6 +524,12 @@ fi %{_mandir}/man1/ftpwho.1* %changelog +* Sat May 21 2016 Paul Howarth - 1.3.5b-2 +- Handle client/server version skew in mod_sql_mysql + (https://forums.proftpd.org/smf/index.php?topic=11887.0) +- Fix a possible cause of segfaults in mod_sftp (#1337880, upstream bug 4203) +- BR: perl-generators for correct dependencies in utils sub-package + * Fri Mar 11 2016 Paul Howarth - 1.3.5b-1 - Update to 1.3.5b - mod_geoip did not load all of the GeoIPTables properly (upstream bug 4187)