diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-02-05 05:58:35 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-02-05 05:58:35 +0000 |
commit | e04ceb973cbe2ec5c4d862ddff90667dea725d6f (patch) | |
tree | b9f99220db07ccf2a0139f3f210c41cacc1f012a /plugins/check_dns.c | |
parent | 3c9fc747fc2a06c1fde21168cf08c01f68cd08e7 (diff) | |
download | monitoring-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.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 3462701a..c0ea2982 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c @@ -352,22 +352,22 @@ process_arguments (int argc, char **argv) } c = optind; - if (query_address[0] == 0) { - if (is_host (argv[c]) == FALSE) { + if (strlen(query_address)==0 && c<argc) { + if (is_host(argv[c])==FALSE) { printf ("Invalid name/address: %s\n\n", argv[c]); return ERROR; } - if (strlen (argv[c]) >= ADDRESS_LENGTH) + if (strlen(argv[c])>=ADDRESS_LENGTH) terminate (STATE_UNKNOWN, "Input buffer overflow\n"); strcpy (query_address, argv[c++]); } - if (dns_server[0] == 0) { - if (is_host (argv[c]) == FALSE) { + if (strlen(dns_server)==0 && c<argc) { + if (is_host(argv[c]) == FALSE) { printf ("Invalid name/address: %s\n\n", argv[c]); return ERROR; } - if (strlen (argv[c]) >= ADDRESS_LENGTH) + if (strlen(argv[c]) >= ADDRESS_LENGTH) terminate (STATE_UNKNOWN, "Input buffer overflow\n"); strcpy (dns_server, argv[c++]); } |