From owner-svn-ports-all@freebsd.org Thu Oct 8 12:16:07 2015 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D94D49D06E5; Thu, 8 Oct 2015 12:16:07 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B06412CF; Thu, 8 Oct 2015 12:16:07 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t98CG6KH038288; Thu, 8 Oct 2015 12:16:06 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t98CG6Mf038286; Thu, 8 Oct 2015 12:16:06 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201510081216.t98CG6Mf038286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Thu, 8 Oct 2015 12:16:06 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r398818 - in branches/2015Q4/net-mgmt/nagios-plugins: . files X-SVN-Group: ports-branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 12:16:08 -0000 Author: mat Date: Thu Oct 8 12:16:06 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 Added: branches/2015Q4/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c - copied unchanged from r398816, head/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c Modified: branches/2015Q4/net-mgmt/nagios-plugins/Makefile Directory Properties: branches/2015Q4/ (props changed) Modified: branches/2015Q4/net-mgmt/nagios-plugins/Makefile ============================================================================== --- branches/2015Q4/net-mgmt/nagios-plugins/Makefile Thu Oct 8 12:14:41 2015 (r398817) +++ branches/2015Q4/net-mgmt/nagios-plugins/Makefile Thu Oct 8 12:16:06 2015 (r398818) @@ -3,7 +3,7 @@ PORTNAME= nagios-plugins PORTVERSION= 2.1.1 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= net-mgmt MASTER_SITES= https://www.nagios-plugins.org/download/ \ Copied: branches/2015Q4/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c (from r398816, head/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2015Q4/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c Thu Oct 8 12:16:06 2015 (r398818, copy of r398816, head/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c) @@ -0,0 +1,44 @@ +--- plugins/netutils.c.orig 2015-07-30 21:40:06 UTC ++++ plugins/netutils.c +@@ -158,7 +158,7 @@ int + np_net_connect (const char *host_name, int port, int *sd, int proto) + { + struct addrinfo hints; +- struct addrinfo *res; ++ struct addrinfo *res, *res0; + struct sockaddr_un su; + char port_str[6], host[MAX_HOST_ADDRESS_LENGTH]; + size_t len; +@@ -185,12 +185,13 @@ np_net_connect (const char *host_name, i + memcpy (host, host_name, len); + host[len] = '\0'; + snprintf (port_str, sizeof (port_str), "%d", port); +- result = getaddrinfo (host, port_str, &hints, &res); ++ result = getaddrinfo (host, port_str, &hints, &res0); + + if (result != 0) { + printf ("%s\n", gai_strerror (result)); + return STATE_UNKNOWN; + } ++ res = res0; + + while (res) { + /* attempt to create a socket */ +@@ -198,7 +199,7 @@ np_net_connect (const char *host_name, i + + if (*sd < 0) { + printf ("%s\n", _("Socket creation failed")); +- freeaddrinfo (res); ++ freeaddrinfo (res0); + return STATE_UNKNOWN; + } + +@@ -221,7 +222,7 @@ np_net_connect (const char *host_name, i + close (*sd); + res = res->ai_next; + } +- freeaddrinfo (res); ++ freeaddrinfo (res0); + } + /* else the hostname is interpreted as a path to a unix socket */ + else {