Bug 203572

Summary: net-mgmt/nagios-plugins: check_ssh segfaults on dead host [patch]
Product: Ports & Packages Reporter: Johan Ström <johan>
Component: Individual Port(s)Assignee: Mathieu Arnold <mat>
Status: Closed FIXED    
Severity: Affects Some People Keywords: patch
Priority: --- Flags: bugzilla: maintainer-feedback? (mat)
Version: Latest   
Hardware: Any   
OS: Any   

Description Johan Ström 2015-10-06 06:32:00 UTC
A regression in 2.1.x causes check_ssh (and probably others) to segfault if the remote host does not reply to a connect().

For every checked service which is down, this results in segfaulting processes every 5 minutes (and spamming of logs with 'pid 67060 (check_ssh), uid 181: exited on signal 11').

Patch has been submitted upstream, but no attention has been given to it for a month.
https://github.com/nagios-plugins/nagios-plugins/pull/99

Patch: https://github.com/stromnet/nagios-plugins/commit/a18f60cc610c690cc0756bc258b8202a1541a067

This seems trigger segfaults on FreeBSD only, could it be locally patched until upstream reacts?

Thanks!
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2015-10-08 11:30:24 UTC
Mmmm, I thought I fixed this a while back.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-10-08 12:15:29 UTC
A commit references this bug:

Author: mat
Date: Thu Oct  8 12:14:37 UTC 2015
New revision: 398816
URL: https://svnweb.freebsd.org/changeset/ports/398816

Log:
  Fix a regression where plugins would segfault if the monitored tcp port
  is closed.

  PR:		203572
  Submitted by:	johan stromnet se
  Obtained from:	https://github.com/stromnet/nagios-plugins/commit/a18f60cc610c690cc0756bc258b8202a1541a067
  MFH:		2015Q4
  Sponsored by:	Absolight

Changes:
  head/net-mgmt/nagios-plugins/Makefile
  head/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-10-08 12:16:33 UTC
A commit references this bug:

Author: mat
Date: Thu Oct  8 12:16:06 UTC 2015
New revision: 398818
URL: https://svnweb.freebsd.org/changeset/ports/398818

Log:
  MFH: r398816

  Fix a regression where plugins would segfault if the monitored tcp port
  is closed.

  PR:		203572
  Submitted by:	johan stromnet se
  Obtained from:	https://github.com/stromnet/nagios-plugins/commit/a18f60cc610c690cc0756bc258b8202a1541a067
  Sponsored by:	Absolight

Changes:
_U  branches/2015Q4/
  branches/2015Q4/net-mgmt/nagios-plugins/Makefile
  branches/2015Q4/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c