Răsfoiți Sursa

check_dns.c - minor corrections and unneeded logic

Removal of the old ptr check as it was causing duplicates with the new one handled via the various record checks. Removed a duplicate txt record check, despite that it would not cause issues as they are within else ifs. Also cleared up some white space.
Spenser Reinhardt 12 ani în urmă
părinte
comite
6acfb24d4d
1 a modificat fișierele cu 1 adăugiri și 16 ștergeri
  1. 1 16
      plugins/check_dns.c

+ 1 - 16
plugins/check_dns.c

@@ -146,15 +146,6 @@ main (int argc, char **argv)
     if (verbose)
     if (verbose)
       puts(chld_out.line[i]);
       puts(chld_out.line[i]);
 
 
-    if (strstr (chld_out.line[i], ".in-addr.arpa")) {
-      if ((temp_buffer = strstr (chld_out.line[i], "name = ")))
-        addresses[n_addresses++] = strdup (temp_buffer + 7);
-      else {
-        msg = (char *)_("Warning plugin error");
-        result = STATE_WARNING;
-      }
-    }
-
     if (strstr (chld_out.line[i], "Authoritative answers can be found from:")) {
     if (strstr (chld_out.line[i], "Authoritative answers can be found from:")) {
       non_authoritative = FALSE;
       non_authoritative = FALSE;
       break;
       break;
@@ -169,12 +160,6 @@ main (int argc, char **argv)
       addresses[n_addresses++] = check_new_address(temp_buffer);
       addresses[n_addresses++] = check_new_address(temp_buffer);
       strncpy(query_found, "-querytype=AAAA", sizeof(query_found));
       strncpy(query_found, "-querytype=AAAA", sizeof(query_found));
     }
     }
-    else if (strstr (chld_out.line[i], "text =")) {
-      if (verbose) printf("Found TXT record\n");
-      temp_buffer = index (chld_out.line[i], '=');
-      addresses[n_addresses++] = check_new_address(temp_buffer);
-      strncpy(query_found, "-querytype=TXT", sizeof(query_found));
-    }
     else if (strstr (chld_out.line[i], "exchanger =")) {
     else if (strstr (chld_out.line[i], "exchanger =")) {
       if (verbose) printf("Found MX record\n");
       if (verbose) printf("Found MX record\n");
       temp_buffer = index (chld_out.line[i], '=');
       temp_buffer = index (chld_out.line[i], '=');
@@ -194,6 +179,7 @@ main (int argc, char **argv)
       strncpy(query_found, "-querytype=CNAME", sizeof(query_found));
       strncpy(query_found, "-querytype=CNAME", sizeof(query_found));
     }
     }
     else if (parse_address == TRUE && (strstr (chld_out.line[i], "Address:") || strstr (chld_out.line[i], "Addresses:"))) {
     else if (parse_address == TRUE && (strstr (chld_out.line[i], "Address:") || strstr (chld_out.line[i], "Addresses:"))) {
+      if (verbose) printf("Found A record\n");
       temp_buffer = index (chld_out.line[i], ':');
       temp_buffer = index (chld_out.line[i], ':');
       addresses[n_addresses++] = check_new_address(temp_buffer);
       addresses[n_addresses++] = check_new_address(temp_buffer);
       strncpy(query_found, "-querytype=A", sizeof(query_found));
       strncpy(query_found, "-querytype=A", sizeof(query_found));
@@ -242,7 +228,6 @@ main (int argc, char **argv)
       non_authoritative = TRUE;
       non_authoritative = TRUE;
     }
     }
 
 
-
     result = error_scan (chld_out.line[i]);
     result = error_scan (chld_out.line[i]);
     if (result != STATE_OK) {
     if (result != STATE_OK) {
       msg = strchr (chld_out.line[i], ':');
       msg = strchr (chld_out.line[i], ':');