[Nagiosplug-checkins] SF.net SVN: nagiosplug: [1813] nagiosplug/trunk/plugins/check_ssh.c

dermoth at users.sourceforge.net dermoth at users.sourceforge.net
Fri Nov 9 14:08:43 CET 2007


Revision: 1813
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1813&view=rev
Author:   dermoth
Date:     2007-11-09 05:08:43 -0800 (Fri, 09 Nov 2007)

Log Message:
-----------
Close the socket on all exits (not just the OK one)

Modified Paths:
--------------
    nagiosplug/trunk/plugins/check_ssh.c

Modified: nagiosplug/trunk/plugins/check_ssh.c
===================================================================
--- nagiosplug/trunk/plugins/check_ssh.c	2007-11-09 13:06:32 UTC (rev 1812)
+++ nagiosplug/trunk/plugins/check_ssh.c	2007-11-09 13:08:43 UTC (rev 1813)
@@ -233,6 +233,7 @@
 	recv (sd, output, BUFF_SZ, 0);
 	if (strncmp (output, "SSH", 3)) {
 		printf (_("Server answer: %s"), output);
+		close(sd);
 		exit (STATE_CRITICAL);
 	}
 	else {
@@ -252,6 +253,7 @@
 			printf
 				(_("SSH WARNING - %s (protocol %s) version mismatch, expected '%s'\n"),
 				 ssh_server, ssh_proto, remote_version);
+			close(sd);
 			exit (STATE_WARNING);
 		}
 		


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list