4
0
Эх сурвалжийг харах

[BUG] check_dhcp broken on BSD

Fix for issue https://github.com/nagios-plugins/nagios-plugins/issues/70
John C. Frickson 9 жил өмнө
parent
commit
848a90d5ce

+ 3 - 0
NEWS

@@ -70,6 +70,9 @@ This file documents the major additions and syntax changes between releases.
 	utils_cmd.c, utils_base.c: Multiple resource leaks
 	utils_cmd.c, utils_base.c: Multiple resource leaks
 	check_http.c: Increase MAX_RE_SIZE from 256 to 2048
 	check_http.c: Increase MAX_RE_SIZE from 256 to 2048
 	check_procs.c: Changed the ps command args from axwo to axwwo allowing for longer output
 	check_procs.c: Changed the ps command args from axwo to axwwo allowing for longer output
+	check_http.c: Allow a server to reply using only 'HTTP/1.x 200 OK' and a
+		body, with no headers
+	check_nt.c: check_nt does not correctly report a DNS entry it cannot resolve
 
 
 	TESTS
 	TESTS
 	check_procs.t: Add delay after forking in test to avoid race condition
 	check_procs.t: Add delay after forking in test to avoid race condition

+ 2 - 1
plugins-root/check_dhcp.c

@@ -326,7 +326,8 @@ int get_hardware_address(int sock,char *interface_name){
 #elif defined(__bsd__)
 #elif defined(__bsd__)
 						/* King 2004	see ACKNOWLEDGEMENTS */
 						/* King 2004	see ACKNOWLEDGEMENTS */
 
 
-        int                     mib[6], len;
+        int                     mib[6];
+        size_t                  len;
         char                    *buf;
         char                    *buf;
         unsigned char           *ptr;
         unsigned char           *ptr;
         struct if_msghdr        *ifm;
         struct if_msghdr        *ifm;

+ 1 - 1
plugins/check_nt.c

@@ -341,7 +341,7 @@ int main(int argc, char **argv){
 
 
 		2) If the counter you're going to measure is percent-based, the code will detect
 		2) If the counter you're going to measure is percent-based, the code will detect
 		 the percent sign in its name and will attribute minimum (0%) and maximum (100%)
 		 the percent sign in its name and will attribute minimum (0%) and maximum (100%)
-		 values automagically, as well the ¨%" sign to graph units.
+		 values automagically, as well the �%" sign to graph units.
 
 
 		3) OTOH, if the counter is "absolute", you'll have to provide the following
 		3) OTOH, if the counter is "absolute", you'll have to provide the following
 		 the counter unit - that is, the dimensions of the counter you're getting. Examples:
 		 the counter unit - that is, the dimensions of the counter you're getting. Examples:

+ 3 - 1
plugins/sslutils.c

@@ -49,7 +49,7 @@ int np_net_ssl_init_with_hostname_and_version(int sd, char *host_name, int versi
 
 
 int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int version, char *cert, char *privkey) {
 int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int version, char *cert, char *privkey) {
 	const SSL_METHOD *method = NULL;
 	const SSL_METHOD *method = NULL;
-	long options = 0;
+	long options = 0;	/*SSL_OP_ALL | SSL_OP_SINGLE_DH_USE;*/
 
 
 	switch (version) {
 	switch (version) {
 	case MP_SSLv2: /* SSLv2 protocol */
 	case MP_SSLv2: /* SSLv2 protocol */
@@ -75,6 +75,7 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
 		return STATE_UNKNOWN;
 		return STATE_UNKNOWN;
 #else
 #else
 		method = TLSv1_client_method();
 		method = TLSv1_client_method();
+/*		options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; */
 		break;
 		break;
 #endif
 #endif
 	case MP_TLSv1_1: /* TLSv1.1 protocol */
 	case MP_TLSv1_1: /* TLSv1.1 protocol */
@@ -156,6 +157,7 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
 #endif
 #endif
 		SSL_set_fd(s, sd);
 		SSL_set_fd(s, sd);
 		if (SSL_connect(s) == 1) {
 		if (SSL_connect(s) == 1) {
+printf("SSL Version: %s\n", SSL_get_version(s));
 			return OK;
 			return OK;
 		} else {
 		} else {
 			printf("%s\n", _("CRITICAL - Cannot make SSL connection."));
 			printf("%s\n", _("CRITICAL - Cannot make SSL connection."));