[monitoring-plugins] DNS is case insensitive!

Sven Geggus git at monitoring-plugins.org
Mon Feb 22 22:00:18 CET 2016


 Module: monitoring-plugins
 Branch: master
 Commit: d44b8d70a446e708cfd69a64f505fdf9193a412e
 Author: Sven Geggus <sven.geggus at iosb.fraunhofer.de>
   Date: Mon Feb 22 17:14:27 2016 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=d44b8d7

DNS is case insensitive!

Thus recent Versions of bind will no longer change .IN-ADDR.ARPA to lowercase
as the uppercase version is also valid.

To have check_dns.c consider this fact change strstr to strcasestr

---

 plugins/check_dns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index d6bd2c0..48601f0 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -127,7 +127,7 @@ main (int argc, char **argv)
     if (verbose)
       puts(chld_out.line[i]);
 
-    if (strstr (chld_out.line[i], ".in-addr.arpa")) {
+    if (strcasestr (chld_out.line[i], ".in-addr.arpa")) {
       if ((temp_buffer = strstr (chld_out.line[i], "name = ")))
         addresses[n_addresses++] = strdup (temp_buffer + 7);
       else {



More information about the Commits mailing list