summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Fritsch <sf@debian.org>2007-09-27 18:19:48 +0000
committerStefan Fritsch <sf@sfritsch.de>2012-01-02 10:36:47 +0100
commit26cc8c6d0cf2a0c26405578d9f543b460ba47d9f (patch)
treebf7409f640da9386f3ad724d5c30e2bc276720ed
parent008e99cc3748a01e68938f589cd4980a1cec8c46 (diff)
downloadapache2-26cc8c6d0cf2a0c26405578d9f543b460ba47d9f.tar.gz
Allow logresolve to process long lines
git-svn-id: svn+ssh://svn.debian.org/svn/pkg-apache/trunk/apache2@481 01b336ce-410b-0410-9a02-a0e7f243c266
-rw-r--r--debian/changelog3
-rw-r--r--debian/patches/00list1
-rwxr-xr-xdebian/patches/052_logresolve_linelength.dpatch78
3 files changed, 81 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 76924f3e..345f625f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,11 @@
apache2 (2.2.6-2) UNRELEASED; urgency=low
* Fix "Bad file descriptor" error on reload (Closes: #443310)
+ * Allow logresolve to process long lines (Closes: #331631)
* Remove duplicate config examples (Closes: #294662)
* Add CVE reference to 2.2.6-1 changelog entry
- -- Stefan Fritsch <sf@debian.org> Wed, 26 Sep 2007 23:35:16 +0200
+ -- Stefan Fritsch <sf@debian.org> Thu, 27 Sep 2007 20:16:18 +0200
apache2 (2.2.6-1) unstable; urgency=low
diff --git a/debian/patches/00list b/debian/patches/00list
index 99ecead7..cc79fc44 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -17,3 +17,4 @@
050_enhance_apache2ctl.dpatch
051Bad_file_descriptor_PR42829.dpatch
099_config_guess_sub_update
+052_logresolve_linelength.dpatch
diff --git a/debian/patches/052_logresolve_linelength.dpatch b/debian/patches/052_logresolve_linelength.dpatch
new file mode 100755
index 00000000..557d4009
--- /dev/null
+++ b/debian/patches/052_logresolve_linelength.dpatch
@@ -0,0 +1,78 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 052_logresolve_linelength.dpatch by Stefan Fritsch <sf@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: remove limit of 1024 bytes per line #331631
+
+@DPATCH@
+diff -urNad trunk~/support/logresolve.c trunk/support/logresolve.c
+--- trunk~/support/logresolve.c 2006-07-12 05:38:44.000000000 +0200
++++ trunk/support/logresolve.c 2007-09-27 20:12:47.093217594 +0200
+@@ -82,7 +82,7 @@
+ #endif
+
+ static void cgethost(struct in_addr ipnum, char *string, int check);
+-static int get_line(char *s, int n);
++static int get_line();
+ static void stats(FILE *output);
+
+ #ifdef BEOS
+@@ -90,11 +90,6 @@
+ #endif
+
+
+-/* maximum line length */
+-#ifndef MAXLINE
+-#define MAXLINE 1024
+-#endif
+-
+ /* maximum length of a domain name */
+ #ifndef MAXDNAME
+ #define MAXDNAME 256
+@@ -141,6 +136,8 @@
+ static int resolves = 0;
+ static int withname = 0;
+ static int errors[MAX_ERR + 3];
++static size_t maxline=0;
++static char *line = NULL;
+
+ /*
+ * cgethost - gets hostname by IP address, caching, and adding unresolvable
+@@ -287,14 +284,15 @@
+ * gets a line from stdin
+ */
+
+-static int get_line (char *s, int n)
++static int get_line ()
+ {
++ ssize_t len;
+ char *cp;
+
+- if (!fgets(s, n, stdin))
++ if ( (len = getline(&line, &maxline, stdin)) == -1 )
+ return (0);
+- cp = strchr(s, '\n');
+- if (cp)
++ cp = line + len -1;
++ if (*cp == '\n')
+ *cp = '\0';
+ return (1);
+ }
+@@ -302,7 +300,7 @@
+ int main (int argc, char *argv[])
+ {
+ struct in_addr ipnum;
+- char *bar, hoststring[MAXDNAME + 1], line[MAXLINE], *statfile;
++ char *bar, hoststring[MAXDNAME + 1], *statfile;
+ int i, check;
+
+ #if defined(WIN32) || (defined(NETWARE) && defined(USE_WINSOCK))
+@@ -337,7 +335,7 @@
+ for (i = 0; i < MAX_ERR + 2; i++)
+ errors[i] = 0;
+
+- while (get_line(line, MAXLINE)) {
++ while (get_line()) {
+ if (line[0] == '\0')
+ continue;
+ entries++;