Quellcode durchsuchen

[BUG] check_dhcp broken on BSD

Fix for issue https://github.com/nagios-plugins/nagios-plugins/issues/70
John C. Frickson vor 9 Jahren
Ursprung
Commit
848a90d5ce
4 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen
  1. 3 0
      NEWS
  2. 2 1
      plugins-root/check_dhcp.c
  3. 1 1
      plugins/check_nt.c
  4. 3 1
      plugins/sslutils.c

+ 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
 	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_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
 	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__)
 						/* King 2004	see ACKNOWLEDGEMENTS */
 
-        int                     mib[6], len;
+        int                     mib[6];
+        size_t                  len;
         char                    *buf;
         unsigned char           *ptr;
         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
 		 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
 		 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) {
 	const SSL_METHOD *method = NULL;
-	long options = 0;
+	long options = 0;	/*SSL_OP_ALL | SSL_OP_SINGLE_DH_USE;*/
 
 	switch (version) {
 	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;
 #else
 		method = TLSv1_client_method();
+/*		options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; */
 		break;
 #endif
 	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
 		SSL_set_fd(s, sd);
 		if (SSL_connect(s) == 1) {
+printf("SSL Version: %s\n", SSL_get_version(s));
 			return OK;
 		} else {
 			printf("%s\n", _("CRITICAL - Cannot make SSL connection."));