summaryrefslogtreecommitdiffstats
path: root/web/attachments/399439-0001-Fix-bug-ID-2946553-Match-the-server-used-in-the-l.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/399439-0001-Fix-bug-ID-2946553-Match-the-server-used-in-the-l.patch')
-rw-r--r--web/attachments/399439-0001-Fix-bug-ID-2946553-Match-the-server-used-in-the-l.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/web/attachments/399439-0001-Fix-bug-ID-2946553-Match-the-server-used-in-the-l.patch b/web/attachments/399439-0001-Fix-bug-ID-2946553-Match-the-server-used-in-the-l.patch
new file mode 100644
index 0000000..cf33a5a
--- /dev/null
+++ b/web/attachments/399439-0001-Fix-bug-ID-2946553-Match-the-server-used-in-the-l.patch
@@ -0,0 +1,45 @@
1From ab90d186ad54de0fe73304bae5771f10a167fd3f Mon Sep 17 00:00:00 2001
2From: Matthew Kent <matt@bravenet.com>
3Date: Fri, 21 Jan 2011 11:54:30 -0800
4Subject: [PATCH] Fix bug ID: 2946553 - Match the server used in the lookup for older versions of bind.
5
6---
7 plugins/check_dns.c | 22 ++++++++++++++++++++++
8 1 files changed, 22 insertions(+), 0 deletions(-)
9
10diff --git a/plugins/check_dns.c b/plugins/check_dns.c
11index 73b560c..04b8baf 100644
12--- a/plugins/check_dns.c
13+++ b/plugins/check_dns.c
14@@ -136,6 +136,28 @@ main (int argc, char **argv)
15 }
16 }
17
18+ /* bug ID: 2946553 - Older versions of bind will use all available dns
19+ servers, we have to match the one specified */
20+ if (strstr (chld_out.line[i], "Server:") && strlen(dns_server) > 0) {
21+ temp_buffer = index (chld_out.line[i], ':');
22+ temp_buffer++;
23+
24+ /* Strip leading tabs */
25+ for (; *temp_buffer != '\0' && *temp_buffer == '\t'; temp_buffer++)
26+ /* NOOP */;
27+
28+ strip(temp_buffer);
29+ if (temp_buffer==NULL || strlen(temp_buffer)==0) {
30+ die (STATE_CRITICAL,
31+ _("DNS CRITICAL - '%s' returned empty server string\n"),
32+ NSLOOKUP_COMMAND);
33+ }
34+
35+ if (strcmp(temp_buffer, dns_server) != 0) {
36+ die (STATE_CRITICAL, _("No response from DNS %s\n"), dns_server);
37+ }
38+ }
39+
40 /* the server is responding, we just got the host name... */
41 if (strstr (chld_out.line[i], "Name:"))
42 parse_address = TRUE;
43--
441.5.5.6
45