summaryrefslogtreecommitdiffstats
path: root/plugins/check_dns.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-02-05 05:58:35 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-02-05 05:58:35 (GMT)
commite04ceb973cbe2ec5c4d862ddff90667dea725d6f (patch)
treeb9f99220db07ccf2a0139f3f210c41cacc1f012a /plugins/check_dns.c
parent3c9fc747fc2a06c1fde21168cf08c01f68cd08e7 (diff)
downloadmonitoring-plugins-e04ceb973cbe2ec5c4d862ddff90667dea725d6f.tar.gz
allow check to proceed using servers from resolv.conf
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@290 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r--plugins/check_dns.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 3462701..c0ea298 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -352,22 +352,22 @@ process_arguments (int argc, char **argv)
352 } 352 }
353 353
354 c = optind; 354 c = optind;
355 if (query_address[0] == 0) { 355 if (strlen(query_address)==0 && c<argc) {
356 if (is_host (argv[c]) == FALSE) { 356 if (is_host(argv[c])==FALSE) {
357 printf ("Invalid name/address: %s\n\n", argv[c]); 357 printf ("Invalid name/address: %s\n\n", argv[c]);
358 return ERROR; 358 return ERROR;
359 } 359 }
360 if (strlen (argv[c]) >= ADDRESS_LENGTH) 360 if (strlen(argv[c])>=ADDRESS_LENGTH)
361 terminate (STATE_UNKNOWN, "Input buffer overflow\n"); 361 terminate (STATE_UNKNOWN, "Input buffer overflow\n");
362 strcpy (query_address, argv[c++]); 362 strcpy (query_address, argv[c++]);
363 } 363 }
364 364
365 if (dns_server[0] == 0) { 365 if (strlen(dns_server)==0 && c<argc) {
366 if (is_host (argv[c]) == FALSE) { 366 if (is_host(argv[c]) == FALSE) {
367 printf ("Invalid name/address: %s\n\n", argv[c]); 367 printf ("Invalid name/address: %s\n\n", argv[c]);
368 return ERROR; 368 return ERROR;
369 } 369 }
370 if (strlen (argv[c]) >= ADDRESS_LENGTH) 370 if (strlen(argv[c]) >= ADDRESS_LENGTH)
371 terminate (STATE_UNKNOWN, "Input buffer overflow\n"); 371 terminate (STATE_UNKNOWN, "Input buffer overflow\n");
372 strcpy (dns_server, argv[c++]); 372 strcpy (dns_server, argv[c++]);
373 } 373 }