From fa35916c1a686f7e8ca6c80c56d1a76c3211d8af Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Fri, 6 Jun 2008 11:10:58 +0000 Subject: [PATCH] fix check_http --- debian/changelog | 2 ++ debian/patches/00list | 1 + debian/patches/35_check_http_date.dpatch | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100755 debian/patches/35_check_http_date.dpatch diff --git a/debian/changelog b/debian/changelog index 87869f5..a2239dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,8 @@ nagios-plugins (1.4.12-1) UNRELEASED; urgency=low perl of check_disk_smb (Closes: #478906) * add 34_fix_smbclient_check_disk_smb.dpatch which fixes usage of smbclient (Closes: #478942) + * add 35_check_http_date.dpatch which fixes date parsing of check_http, + thanks Hilko Bengen for providing it (Closes: #460097) [ Alexander Wirt ] * Call smbclient with -N (supress password prompt) if no password is diff --git a/debian/patches/00list b/debian/patches/00list index 49af3e1..fcaeb19 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -9,4 +9,5 @@ 32_check_ldap_pointer.dpatch 33_fix_emb_check_disk_smb.dpatch 34_fix_smbclient_check_disk_smb.dpatch +35_check_http_date.dpatch 50_misc_typos.dpatch diff --git a/debian/patches/35_check_http_date.dpatch b/debian/patches/35_check_http_date.dpatch new file mode 100755 index 0000000..7aacdf0 --- /dev/null +++ b/debian/patches/35_check_http_date.dpatch @@ -0,0 +1,23 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 35_check_http_date.dpatch by Jan Wagner +## patch provided by Hilko Bengen +## +## DP: Prevents check_http from trying to extract Date or +## DP: Last-Modified header from file content.N + +@DPATCH@ +diff -urNad nagios-plugins-1.4.12~/plugins/check_http.c nagios-plugins-1.4.12/plugins/check_http.c +--- nagios-plugins-1.4.12~/plugins/check_http.c 2008-05-07 12:02:42.000000000 +0200 ++++ nagios-plugins-1.4.12/plugins/check_http.c 2008-06-06 13:03:33.000000000 +0200 +@@ -598,7 +598,10 @@ + /* Skip to the end of the header, including continuation lines. */ + while (*s && !(*s == '\n' && (s[1] != ' ' && s[1] != '\t'))) + s++; +- s++; ++ ++ /* Avoid stepping over end-of-string marker */ ++ if (*s) ++ s++; + + /* Process this header. */ + if (value && value > field+2) {