diff --git a/proftpd-1.3.4a-bug3751.patch b/proftpd-1.3.4a-bug3751.patch index 68350ec..cb5eee7 100644 --- a/proftpd-1.3.4a-bug3751.patch +++ b/proftpd-1.3.4a-bug3751.patch @@ -91,3 +91,22 @@ diff -u -r1.55 mod_ban.c /* Get the shm for storing all of our ban info. */ lists = ban_get_shm(ban_tabfh); if (lists == NULL && +--- src/log.c ++++ src/log.c +@@ -363,6 +363,16 @@ int log_opensyslog(const char *fn) { + if (syslog_sockfd < 0) + return -1; + ++ /* Find a usable fd for the just-opened socket fd. */ ++ if (syslog_sockfd <= STDERR_FILENO) { ++ res = pr_fs_get_usable_fd(syslog_sockfd); ++ if (res > 0) { ++ (void) close(syslog_sockfd); ++ syslog_sockfd = res; ++ } ++ } ++ ++ fcntl(syslog_sockfd, F_SETFD, FD_CLOEXEC); + systemlog_fd = -1; + + } else if ((res = pr_log_openfile(systemlog_fn, &systemlog_fd, diff --git a/proftpd.spec b/proftpd.spec index 87feb71..52493b1 100644 --- a/proftpd.spec +++ b/proftpd.spec @@ -41,7 +41,7 @@ %endif #global prever rc3 -%global rpmrel 6 +%global rpmrel 7 Summary: Flexible, stable and highly-configurable FTP server Name: proftpd @@ -260,7 +260,7 @@ cp -p mod_geoip/mod_geoip.html doc/contrib/ # http://bugs.proftpd.org/show_bug.cgi?id=3726 %patch17 -p0 -# mod_wrap2 causes unexpected LogFormat %u expansion for SFTP connections +# mod_wrap2 causes unexpected LogFormat %%u expansion for SFTP connections # http://bugs.proftpd.org/show_bug.cgi?id=3727 %patch18 -p0 @@ -317,6 +317,12 @@ sed -e 's#@PKIDIR@#%{pkidir}#g' \ %patch2 -p0 %endif +# Tweak logrotate script for systemd compatibility (#802178) +%if %{use_systemd} +sed -i -e '/killall/s/test.*/systemctl reload proftpd.service/' \ + contrib/dist/rpm/proftpd.logrotate +%endif + # Avoid docfile dependencies chmod -x contrib/xferstats.holger-preiss @@ -601,6 +607,10 @@ fi %{_mandir}/man1/ftpwho.1* %changelog +* Mon Mar 12 2012 Paul Howarth 1.3.4a-7 +- Tweak logrotate script for systemd compatibility (#802178) +- Fix leaked file descriptors for log files (as per bug 3751) + * Sat Mar 3 2012 Paul Howarth 1.3.4a-6 - Rebuild for new libmemcached in Rawhide @@ -619,7 +629,7 @@ fi - Fix unloading mod_quotatab causes segfault (#757311, bug 3724) - Fix mod_exec does not always capture stdout/stderr output from executed command (bug 3726) -- Fix mod_wrap2 causes unexpected LogFormat %u expansion for SFTP connections +- Fix mod_wrap2 causes unexpected LogFormat %%u expansion for SFTP connections (bug 3727) - Fix mod_ldap segfault when LDAPUsers is used with no optional filters (bug 3729)