Revision: 2242
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2242&view=rev
Author: dermoth
Date: 2009-09-19 06:10:00 +0000 (Sat, 19 Sep 2009)
Log Message:
-----------
Fix check_ircd binding to wrong interface (#668778)
From: Thomas Guyot-Sionnest <[email protected]>
Modified Paths:
--------------
nagiosplug/trunk/NEWS
nagiosplug/trunk/plugins-scripts/check_ircd.pl
Modified: nagiosplug/trunk/NEWS
===================================================================
--- nagiosplug/trunk/NEWS 2009-09-19 06:05:56 UTC (rev 2241)
+++ nagiosplug/trunk/NEWS 2009-09-19 06:10:00 UTC (rev 2242)
@@ -1,5 +1,8 @@
This file documents the major additions and syntax changes between releases.
+1.4.15 ...
+ Fix check_ircd binding to wrong interface (#668778)
+
1.4.14 16th September 2009
check_http has options to specify the HTTP method (#2155152)
check_users thresholds were not working exactly as documented (>= rather than >)
Modified: nagiosplug/trunk/plugins-scripts/check_ircd.pl
===================================================================
--- nagiosplug/trunk/plugins-scripts/check_ircd.pl 2009-09-19 06:05:56 UTC (rev 2241)
+++ nagiosplug/trunk/plugins-scripts/check_ircd.pl 2009-09-19 06:10:00 UTC (rev 2242)
@@ -59,7 +59,7 @@
sub print_help ();
sub print_usage ();
sub connection ($$$$);
-sub bindRemote ($$$);
+sub bindRemote ($$);
# -------------------------------------------------------------[ Enviroment ]--
@@ -141,28 +141,20 @@
# -------------------------------------------------------------[ 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 $thisaddr = gethostbyname($in_hostname);
my $that;
my ($name, $aliases,$type,$len,$thataddr) = gethostbyname($in_remotehost);
-# ($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);
$that = pack($sockaddr, AF_INET, $in_remoteport, $thataddr);
- 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 @@
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";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.