From fa8f9047f4678c2de57a5f3c371b1727b2d8b824 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Mon, 9 Jun 2008 21:14:30 +0000 Subject: [PATCH] fix check_dig --- debian/changelog | 2 + debian/patches/00list | 1 + debian/patches/39_check_dig_options.dpatch | 43 ++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100755 debian/patches/39_check_dig_options.dpatch diff --git a/debian/changelog b/debian/changelog index e41d943..9bb3986 100644 --- a/debian/changelog +++ b/debian/changelog @@ -49,6 +49,8 @@ nagios-plugins (1.4.12-1) UNRELEASED; urgency=low * add check_linux_raid into package (Closes: #461999) and add 38_fix_libexec.dpatch to fix libexec path * Updating standards version to 3.8.0, no changes needed + * add 39_check_dig_options.dpatch which provides fix for no check for + mandatory parameter -l (Closes: #479013) [ Alexander Wirt ] * Call smbclient with -N (supress password prompt) if no password is diff --git a/debian/patches/00list b/debian/patches/00list index 0654853..3d52254 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -13,4 +13,5 @@ 36_check_ldap_empty_base.dpatch 37_check_radius_nas-ip-address.dpatch 38_fix_libexec.dpatch +39_check_dig_options.dpatch 50_misc_typos.dpatch diff --git a/debian/patches/39_check_dig_options.dpatch b/debian/patches/39_check_dig_options.dpatch new file mode 100755 index 0000000..89c71c7 --- /dev/null +++ b/debian/patches/39_check_dig_options.dpatch @@ -0,0 +1,43 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 39_check_dig_options.dpatch by Jan Wagner +## patch provided by Matthias Eble +## +## DP: Add testcases for check_dig check_dig's -l option is mandatory + +@DPATCH@ +diff -urNad nagios-plugins-1.4.12~/plugins/check_dig.c nagios-plugins-1.4.12/plugins/check_dig.c +--- nagios-plugins-1.4.12~/plugins/check_dig.c 2008-05-07 12:02:42.000000000 +0200 ++++ nagios-plugins-1.4.12/plugins/check_dig.c 2008-06-09 22:31:59.000000000 +0200 +@@ -143,8 +143,10 @@ + } + } + +- if (result == STATE_UNKNOWN) ++ if (result == STATE_UNKNOWN) { + msg = (char *)_("No ANSWER SECTION found"); ++ result = STATE_CRITICAL; ++ } + + /* If we get anything on STDERR, at least set warning */ + if(chld_err.buflen > 0) { +@@ -295,7 +297,10 @@ + int + validate_arguments (void) + { +- return OK; ++ if (query_address != NULL) ++ return OK; ++ else ++ return ERROR; + } + + +@@ -357,7 +362,7 @@ + print_usage (void) + { + printf (_("Usage:")); +- printf ("%s -H -l [-p ]\n", progname); ++ printf ("%s -l [-H ] [-p ]\n", progname); + printf (" [-T ] [-w ] [-c ]\n"); + printf (" [-t ] [-a ] [-v]\n"); + }