diff options
Diffstat (limited to 'web/attachments/109117-check_dns.c.patch')
-rw-r--r-- | web/attachments/109117-check_dns.c.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/web/attachments/109117-check_dns.c.patch b/web/attachments/109117-check_dns.c.patch new file mode 100644 index 0000000..9546cd6 --- /dev/null +++ b/web/attachments/109117-check_dns.c.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | --- check_dns.c.old 2004-11-17 13:18:35.000000000 -0700 | ||
2 | +++ check_dns.c 2004-11-17 12:53:21.000000000 -0700 | ||
3 | @@ -38,6 +38,7 @@ | ||
4 | #define ADDRESS_LENGTH 256 | ||
5 | char query_address[ADDRESS_LENGTH] = ""; | ||
6 | char dns_server[ADDRESS_LENGTH] = ""; | ||
7 | +int dns_server_port = 53; | ||
8 | char ptr_server[ADDRESS_LENGTH] = ""; | ||
9 | int verbose = FALSE; | ||
10 | char expected_address[ADDRESS_LENGTH] = ""; | ||
11 | @@ -76,7 +77,7 @@ | ||
12 | } | ||
13 | |||
14 | /* get the command to run */ | ||
15 | - asprintf (&command_line, "%s %s %s", NSLOOKUP_COMMAND, query_address, dns_server); | ||
16 | + asprintf (&command_line, "%s %s %s -port=%d", NSLOOKUP_COMMAND, query_address, dns_server, dns_server_port); | ||
17 | |||
18 | alarm (timeout_interval); | ||
19 | gettimeofday (&tv, NULL); | ||
20 | @@ -275,6 +276,7 @@ | ||
21 | {"timeout", required_argument, 0, 't'}, | ||
22 | {"hostname", required_argument, 0, 'H'}, | ||
23 | {"server", required_argument, 0, 's'}, | ||
24 | + {"port", required_argument, 0, 'p'}, | ||
25 | {"reverse-server", required_argument, 0, 'r'}, | ||
26 | {"expected-address", required_argument, 0, 'a'}, | ||
27 | {"expect-authority", no_argument, 0, 'A'}, | ||
28 | @@ -289,7 +291,7 @@ | ||
29 | strcpy (argv[c], "-t"); | ||
30 | |||
31 | while (1) { | ||
32 | - c = getopt_long (argc, argv, "hVvAt:H:s:r:a:", long_opts, &opt_index); | ||
33 | + c = getopt_long (argc, argv, "hVvAt:H:p:s:r:a:", long_opts, &opt_index); | ||
34 | |||
35 | if (c == -1 || c == EOF) | ||
36 | break; | ||
37 | @@ -316,6 +318,9 @@ | ||
38 | die (STATE_UNKNOWN, _("Input buffer overflow\n")); | ||
39 | strcpy (query_address, optarg); | ||
40 | break; | ||
41 | + case 'p': /* hostname */ | ||
42 | + dns_server_port = atoi(optarg); | ||
43 | + break; | ||
44 | case 's': /* server name */ | ||
45 | /* TODO: this is_host check is probably unnecessary. */ | ||
46 | /* Better to confirm nslookup response matches */ | ||
47 | @@ -403,6 +408,8 @@ | ||
48 | The name or address you want to query\n\ | ||
49 | -s, --server=HOST\n\ | ||
50 | Optional DNS server you want to use for the lookup\n\ | ||
51 | +-p, --port=HOST\n\ | ||
52 | + Optional DNS server port, defaults to 53\n\ | ||
53 | -a, --expected-address=IP-ADDRESS\n\ | ||
54 | Optional IP address you expect the DNS server to return\n\ | ||
55 | -A, --expect-authority\n\ | ||
56 | @@ -426,7 +433,7 @@ | ||
57 | print_usage (void) | ||
58 | { | ||
59 | printf (_("\ | ||
60 | -Usage: %s -H host [-s server] [-a expected-address] [-A] [-t timeout]\n\ | ||
61 | +Usage: %s -H host [-s server] [-p port] [-a expected-address] [-A] [-t timeout]\n\ | ||
62 | %s --help\n\ | ||
63 | %s --version\n"), progname, progname, progname); | ||
64 | } | ||