[Pkg-nagios-changes] [pkg-nsca] 05/05: Add upstream patch to fix NSCA close/POLLNVAL/accept bug causing hang.

Bas Couwenberg sebastic at debian.org
Mon Dec 5 20:30:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository pkg-nsca.

commit b1f1ec4d2bc4088c8ef9f2ea2c9fd94624018e9d
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Mon Dec 5 21:19:34 2016 +0100

    Add upstream patch to fix NSCA close/POLLNVAL/accept bug causing hang.
---
 debian/changelog                                   |  1 +
 ...sca-close-POLLNVAL-accept-bug-causes-hang.patch | 37 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 39 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a4d2f9a..62d4f5f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,7 @@ nsca (2.9.1-4) UNRELEASED; urgency=medium
   * Add upstream patch to fix race condition when opening command file.
     (closes: #663047)
   * Add upstream patch to fix reserved identifier violation.
+  * Add upstream patch to fix NSCA close/POLLNVAL/accept bug causing hang.
 
  -- Bas Couwenberg <sebastic at debian.org>  Sun, 04 Dec 2016 00:04:22 +0100
 
diff --git a/debian/patches/10_nsca-close-POLLNVAL-accept-bug-causes-hang.patch b/debian/patches/10_nsca-close-POLLNVAL-accept-bug-causes-hang.patch
new file mode 100644
index 0000000..b1b1f90
--- /dev/null
+++ b/debian/patches/10_nsca-close-POLLNVAL-accept-bug-causes-hang.patch
@@ -0,0 +1,37 @@
+Description: NSCA close/POLLNVAL/accept bug causes hang
+ Fix for issue http://tracker.nagios.org/view.php?id=644
+ .
+ Incorporated patch sent by original reporter.
+Author: John C. Frickson <jfrickson at nagios.com>
+Origin: https://github.com/NagiosEnterprises/nsca/commit/98dc4795edaf2fd5c5fe123e53a8c9b3a2b0585c
+
+--- a/src/nsca.c
++++ b/src/nsca.c
+@@ -654,6 +654,7 @@ static void register_poll(short events,
+ 
+         pfds[npfds].fd=fd;
+         pfds[npfds].events=events;
++        pfds[npfds].revents=0;
+         npfds++;
+         }
+ 
+@@ -777,7 +778,8 @@ static void handle_events(void){
+                         data=rhand[hand].data;
+                         rhand[hand].handler=NULL;
+                         rhand[hand].data=NULL;
+-                        handler(pfds[i].fd,data);
++						if((pfds[i].revents&POLLNVAL)==0)
++	                        handler(pfds[i].fd,data);
+                         }
+                 if((pfds[i].events&POLLOUT) && (pfds[i].revents&(POLLOUT|POLLERR|POLLHUP|POLLNVAL))){
+                         pfds[i].events&=~POLLOUT;
+@@ -786,7 +788,8 @@ static void handle_events(void){
+                         data=whand[hand].data;
+                         whand[hand].handler=NULL;
+                         whand[hand].data=NULL;
+-                        handler(pfds[i].fd,data);
++						if((pfds[i].revents&POLLNVAL)==0)
++	                        handler(pfds[i].fd,data);
+                         }
+                 }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 0e571b0..1984b7b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
 07_signal-handler.patch
 08_race-condition-when-opening-command-file.patch
 09_reserved-identifier-violation.patch
+10_nsca-close-POLLNVAL-accept-bug-causes-hang.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nsca.git



More information about the Pkg-nagios-changes mailing list