summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-02-22 21:00:11 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2019-02-22 21:00:25 +0000
commit66357ee093d02b0c26c12dcd37cf0a010ba92525 (patch)
tree288ad96bd2ce7ce85cba199b829a24889337f890 /net-ftp/proftpd/files
parentnet-misc/ncp: take maintainership (diff)
downloadgentoo-66357ee093d02b0c26c12dcd37cf0a010ba92525.tar.gz
gentoo-66357ee093d02b0c26c12dcd37cf0a010ba92525.tar.bz2
gentoo-66357ee093d02b0c26c12dcd37cf0a010ba92525.zip
net-ftp/proftpd: apply SIGHUP crash fix, bug #678490
It's a upstream fix picked as-is from 1.3.6 branch. Reported-by: Hanno Boeck Closes: https://bugs.gentoo.org/678490 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'net-ftp/proftpd/files')
-rw-r--r--net-ftp/proftpd/files/proftpd-1.3.6-sighup-crash.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/net-ftp/proftpd/files/proftpd-1.3.6-sighup-crash.patch b/net-ftp/proftpd/files/proftpd-1.3.6-sighup-crash.patch
new file mode 100644
index 000000000000..cca550405e11
--- /dev/null
+++ b/net-ftp/proftpd/files/proftpd-1.3.6-sighup-crash.patch
@@ -0,0 +1,81 @@
+https://bugs.gentoo.org/678490
+
+From 345aa19ee2a98a3612d9b64a49107461455031a0 Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj@castaglia.org>
+Date: Tue, 18 Jul 2017 23:00:22 -0700
+Subject: [PATCH] Bug#4310: Use of mod_facl as static module causes ProFTPD to
+ die on SIGHUP/restart.
+
+---
+ modules/mod_facl.c | 35 +++++++++++++++++++++++++++++++----
+ 1 file changed, 31 insertions(+), 4 deletions(-)
+
+diff --git a/modules/mod_facl.c b/modules/mod_facl.c
+index b3ac42b7b..258708cf5 100644
+--- a/modules/mod_facl.c
++++ b/modules/mod_facl.c
+@@ -1260,16 +1260,34 @@ MODRET set_faclengine(cmd_rec *cmd) {
+ return PR_HANDLED(cmd);
+ }
+
++/* Event listeners
++ */
++
++static void unmount_facl(void) {
++ pr_fs_t *fs;
++
++ fs = pr_unmount_fs("/", "facl");
++ if (fs != NULL) {
++ destroy_pool(fs->fs_pool);
++ fs->fs_pool = NULL;
++ return;
++ }
++
++ if (errno != ENOENT) {
++ pr_log_debug(DEBUG0, MOD_FACL_VERSION
++ ": error unmounting 'facl' FS: %s", strerror(errno));
++ }
++}
++
+ #if defined(PR_SHARED_MODULE) && \
+ defined(PR_USE_FACL) && \
+ defined(HAVE_POSIX_ACL)
+ static void facl_mod_unload_ev(const void *event_data, void *user_data) {
+ if (strcmp("mod_facl.c", (const char *) event_data) == 0) {
++ pr_fs_t *fs;
++
+ pr_event_unregister(&facl_module, NULL, NULL);
+- if (pr_unregister_fs("/") < 0) {
+- pr_log_debug(DEBUG0, MOD_FACL_VERSION
+- ": error unregistering 'facl' FS: %s", strerror(errno));
+- }
++ unmount_facl();
+ }
+ }
+ #endif /* !PR_SHARED_MODULE */
+@@ -1303,6 +1321,14 @@ static void facl_postparse_ev(const void *event_data, void *user_data) {
+ #endif /* PR_USE_FACL and HAVE_POSIX_ACL */
+ }
+
++static void facl_restart_ev(const void *event_data, void *user_data) {
++ if (facl_engine == FALSE) {
++ return;
++ }
++
++ unmount_facl();
++}
++
+ /* Initialization routines
+ */
+
+@@ -1315,6 +1341,7 @@ static int facl_init(void) {
+ # endif /* !PR_SHARED_MODULE */
+ #endif /* PR_USE_FACL and HAVE_POSIX_ACL */
+ pr_event_register(&facl_module, "core.postparse", facl_postparse_ev, NULL);
++ pr_event_register(&facl_module, "core.restart", facl_restart_ev, NULL);
+
+ return 0;
+ }
+--
+2.20.1
+