[Pkg-nagios-changes] [pkg-nagios] r1775 - in nagios-plugins/trunk/debian: . patches

Jan Wagner waja at alioth.debian.org
Wed Oct 14 21:13:11 UTC 2009


Author: waja
Date: 2009-10-14 21:13:11 +0000 (Wed, 14 Oct 2009)
New Revision: 1775

Modified:
   nagios-plugins/trunk/debian/changelog
   nagios-plugins/trunk/debian/patches/06_checkircd.dpatch
Log:
update 06_checkircd.dpatch

Modified: nagios-plugins/trunk/debian/changelog
===================================================================
--- nagios-plugins/trunk/debian/changelog	2009-10-14 20:54:59 UTC (rev 1774)
+++ nagios-plugins/trunk/debian/changelog	2009-10-14 21:13:11 UTC (rev 1775)
@@ -14,6 +14,7 @@
     Alexander Wirt (Closes: #545940)
   * Remove coreutils from build-depends, it's essential
   * Raise compat level to 5
+  * Update 06_checkircd.dpatch, which got fixed upstream
 
  -- Jan Wagner <waja at cyconet.org>  Thu, 06 Aug 2009 00:11:51 +0200
 

Modified: nagios-plugins/trunk/debian/patches/06_checkircd.dpatch
===================================================================
--- nagios-plugins/trunk/debian/patches/06_checkircd.dpatch	2009-10-14 20:54:59 UTC (rev 1774)
+++ nagios-plugins/trunk/debian/patches/06_checkircd.dpatch	2009-10-14 21:13:11 UTC (rev 1775)
@@ -1,5 +1,9 @@
 #! /bin/sh -e
-## 06_checkircd.dpatch by  <ultrotter at debian.org>
+## 06_checkircd.dpatch 
+## From: Thomas Guyot-Sionnest <dermoth at aei.ca>
+## Date: Sat, 19 Sep 2009 05:44:10 +0000 (-0400)
+## Subject: Fix check_ircd binding to wrong interface (#668778)
+## X-Git-Url: http://repo.or.cz/w/nagiosplugins.git?a=commitdiff_plain;h=bc3c8c7cfbdbce716e8987bee211f69911ea8db2
 ##
 ## DP: Make it working on multihomed host, by choosing the kernel the correct interface
 
@@ -22,23 +26,63 @@
 exit 0
 
 @DPATCH@
-diff -urNad /home/ultrotter/docs/projects/deb/nagios/new/nagios-plugins-1.3.1.0/plugins-scripts/check_ircd.pl nagios-plugins-1.3.1.0/plugins-scripts/check_ircd.pl
---- /home/ultrotter/docs/projects/deb/nagios/new/nagios-plugins-1.3.1.0/plugins-scripts/check_ircd.pl	2002-05-07 07:35:49.000000000 +0200
-+++ nagios-plugins-1.3.1.0/plugins-scripts/check_ircd.pl	2004-08-12 15:54:50.000000000 +0200
-@@ -148,7 +148,6 @@
+diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
+index cc730cf..3fbce2e 100755
+--- a/plugins-scripts/check_ircd.pl
++++ b/plugins-scripts/check_ircd.pl
+@@ -59,7 +59,7 @@ use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
+ sub print_help ();
+ sub print_usage ();
+ sub connection ($$$$);
+-sub bindRemote ($$$);
++sub bindRemote ($$);
+ 
+ # -------------------------------------------------------------[ Enviroment ]--
+ 
+@@ -141,28 +141,20 @@ Perl Check IRCD plugin for Nagios
+ 
+ # -------------------------------------------------------------[ bindRemote ]--
+ 
+-sub bindRemote ($$$)
++sub bindRemote ($$)
+ {
+-	my ($in_remotehost, $in_remoteport, $in_hostname) = @_;
++	my ($in_remotehost, $in_remoteport) = @_;
  	my $proto = getprotobyname('tcp');
  	my $sockaddr;
- 	my $this;
+-	my $this;
 -	my $thisaddr = gethostbyname($in_hostname);
  	my $that;
  	my ($name, $aliases,$type,$len,$thataddr) = gethostbyname($in_remotehost);
- #	($name,$aliases,$type,$len,$thisaddr) = gethostbyname($in_hostname);
-@@ -158,7 +157,7 @@
+-#	($name,$aliases,$type,$len,$thisaddr) = gethostbyname($in_hostname);
+ 
+ 	if (!socket(ClientSocket,AF_INET, SOCK_STREAM, $proto)) {
+ 	    print "IRCD UNKNOWN: Could not start socket ($!)\n";
  	    exit $ERRORS{"UNKNOWN"};
  	}
  	$sockaddr = 'S n a4 x8';
 -	$this = pack($sockaddr, AF_INET, 0, $thisaddr);
-+	$this = pack($sockaddr, AF_INET, 0, INADDR_ANY);
  	$that = pack($sockaddr, AF_INET, $in_remoteport, $thataddr);
- 	if (!bind(ClientSocket, $this)) {
- 	    print "IRCD UNKNOWN: Could not bind socket ($!)\n";
+-	if (!bind(ClientSocket, $this)) {
+-	    print "IRCD UNKNOWN: Could not bind socket ($!)\n";
+-	    exit $ERRORS{"UNKNOWN"};
+-	}
+ 	if (!connect(ClientSocket, $that)) { 
+ 	    print "IRCD UNKNOWN: Could not connect socket ($!)\n";
+ 	    exit $ERRORS{"UNKNOWN"};
+@@ -221,13 +213,10 @@ MAIN:
+ 	
+ 	alarm($TIMEOUT);
+ 
+-	chomp($hostname = `/bin/hostname`);
+-	$hostname = $1 if ($hostname =~ /([-.a-zA-Z0-9]+)/);
+ 	my ($name, $alias, $proto) = getprotobyname('tcp');
+-	print "MAIN(debug): hostname = $hostname\n" if $verbose;
+ 
+-	print "MAIN(debug): binding to remote host: $remotehost -> $remoteport -> $hostname\n" if $verbose;
+-	my $ClientSocket = &bindRemote($remotehost,$remoteport,$hostname);
++	print "MAIN(debug): binding to remote host: $remotehost -> $remoteport\n" if $verbose;
++	my $ClientSocket = &bindRemote($remotehost,$remoteport);
+ 	
+ 	print ClientSocket "NICK $NICK\nUSER $USER_INFO\n";
+ 	




More information about the Pkg-nagios-changes mailing list