View | Details | Raw Unified | Return to bug 137651
Collapse All | Expand All

(-)apache22/Makefile (-2 / +1 lines)
Lines 8-15 Link Here
8
#
8
#
9
9
10
PORTNAME=	apache
10
PORTNAME=	apache
11
PORTVERSION=	2.2.11
11
PORTVERSION=	2.2.13
12
PORTREVISION?=	7
13
CATEGORIES=	www
12
CATEGORIES=	www
14
MASTER_SITES=	${MASTER_SITE_APACHE_HTTPD}
13
MASTER_SITES=	${MASTER_SITE_APACHE_HTTPD}
15
DISTNAME=	httpd-${PORTVERSION}
14
DISTNAME=	httpd-${PORTVERSION}
(-)apache22/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (apache22/httpd-2.2.11.tar.bz2) = 3e98bcb14a7122c274d62419566431bb
1
MD5 (apache22/httpd-2.2.13.tar.bz2) = 8d8d904e7342125825ec70f03c5745ef
2
SHA256 (apache22/httpd-2.2.11.tar.bz2) = 5ce34825c5b84d1808605a22f8d16d44c6f91882a538bb98a3affed8f5dff6fe
2
SHA256 (apache22/httpd-2.2.13.tar.bz2) = 24a812e010d936a3114141bad56461fcaa1089aa720bd16355feb3516ab8d6d6
3
SIZE (apache22/httpd-2.2.11.tar.bz2) = 5230130
3
SIZE (apache22/httpd-2.2.13.tar.bz2) = 5300199
(-)apache22/files/patch-apr-fix-apr_xml-expat-attack (-51 lines)
Lines 1-51 Link Here
1
Taken from
2
  http://svn.apache.org/viewvc/apr/apr/trunk/xml/apr_xml.c?r1=757729&r2=781403&view=patch
3
4
--- srclib/apr-util/xml/apr_xml.c	2009/03/24 11:12:27	757729
5
+++ srclib/apr-util/xml/apr_xml.c	2009/06/03 14:26:19	781403
6
@@ -347,6 +347,25 @@
7
     return APR_SUCCESS;
8
 }
9
 
10
+#if XML_MAJOR_VERSION > 1
11
+/* Stop the parser if an entity declaration is hit. */
12
+static void entity_declaration(void *userData, const XML_Char *entityName,
13
+                               int is_parameter_entity, const XML_Char *value,
14
+                               int value_length, const XML_Char *base,
15
+                               const XML_Char *systemId, const XML_Char *publicId,
16
+                               const XML_Char *notationName)
17
+{
18
+    apr_xml_parser *parser = userData;
19
+
20
+    XML_StopParser(parser->xp, XML_FALSE);
21
+}
22
+#else
23
+/* A noop default_handler. */
24
+static void default_handler(void *userData, const XML_Char *s, int len)
25
+{
26
+}
27
+#endif
28
+
29
 APU_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool)
30
 {
31
     apr_xml_parser *parser = apr_pcalloc(pool, sizeof(*parser));
32
@@ -372,6 +391,19 @@
33
     XML_SetElementHandler(parser->xp, start_handler, end_handler);
34
     XML_SetCharacterDataHandler(parser->xp, cdata_handler);
35
 
36
+    /* Prevent the "billion laughs" attack against expat by disabling
37
+     * internal entity expansion.  With 2.x, forcibly stop the parser
38
+     * if an entity is declared - this is safer and a more obvious
39
+     * failure mode.  With older versions, installing a noop
40
+     * DefaultHandler means that internal entities will be expanded as
41
+     * the empty string, which is also sufficient to prevent the
42
+     * attack. */
43
+#if XML_MAJOR_VERSION > 1
44
+    XML_SetEntityDeclHandler(parser->xp, entity_declaration);
45
+#else
46
+    XML_SetDefaultHandler(parser->xp, default_handler);
47
+#endif
48
+
49
     return parser;
50
 }
51
 
(-)apache22/files/patch-apr-fix-brigade_vprintf_overflow (-18 lines)
Lines 1-18 Link Here
1
Equal to the fix in the apr-util itself:
2
  http://svn.apache.org/viewvc/apr/apr/trunk/buckets/apr_brigade.c?r1=768417&r2=768416&pathrev=768417&view=patch
3
4
See discuission about original vulnerability at
5
  http://www.mail-archive.com/dev@apr.apache.org/msg21592.html
6
7
--- srclib/apr-util/buckets/apr_brigade.c.orig	2009-06-06 12:32:12.000000000 +0400
8
+++ srclib/apr-util/buckets/apr_brigade.c	2009-06-06 12:35:30.000000000 +0400
9
@@ -689,9 +689,6 @@
10
       return -1;
11
     }
12
 
13
-    /* tack on null terminator to remaining string */
14
-    *(vd.vbuff.curpos) = '\0';
15
-
16
     /* write out what remains in the buffer */
17
     return apr_brigade_write(b, flush, ctx, buf, vd.vbuff.curpos - buf);
18
 }
(-)apache22/files/patch-apr-fix-strmatch-underflow (-21 lines)
Lines 1-21 Link Here
1
Fix underflow in apr_strmatch_precompile,
2
  http://svn.apache.org/viewvc/apr/apr/trunk/strmatch/apr_strmatch.c?r1=757729&r2=779878&view=patch
3
4
--- srclib/apr-util/strmatch/apr_strmatch.c	2009/03/24 11:12:27	757729
5
+++ srclib/apr-util/strmatch/apr_strmatch.c	2009/05/29 07:47:52	779878
6
@@ -103,13 +103,13 @@
7
     if (case_sensitive) {
8
         pattern->compare = match_boyer_moore_horspool;
9
         for (i = 0; i < pattern->length - 1; i++) {
10
-            shift[(int)s[i]] = pattern->length - i - 1;
11
+            shift[(unsigned char)s[i]] = pattern->length - i - 1;
12
         }
13
     }
14
     else {
15
         pattern->compare = match_boyer_moore_horspool_nocase;
16
         for (i = 0; i < pattern->length - 1; i++) {
17
-            shift[apr_tolower(s[i])] = pattern->length - i - 1;
18
+            shift[(unsigned char)apr_tolower(s[i])] = pattern->length - i - 1;
19
         }
20
     }
21
     pattern->context = shift;
(-)apache22/files/patch-libtool22 (-122 lines)
Lines 1-122 Link Here
1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 025_libtool_2.x_fixes.dpatch by  <jsw@debian.org>
3
##
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Update build system to work with libtool 2.x
6
## DP:
7
## DP: This corresponds to upstream revisions:
8
## DP:   733052
9
## DP:   742752
10
## DP:   748902
11
## DP:   757363
12
diff --git a/buildconf b/buildconf
13
index bc0e9fd..11554ed 100755
14
--- srclib/apr/buildconf
15
+++ srclib/apr/buildconf
16
@@ -35,17 +35,20 @@ fi
17
 # Note: APR supplies its own config.guess and config.sub -- we do not
18
 #       rely on libtool's versions
19
 #
20
-echo "Copying libtool helper files ..."
21
+echo "buildconf: copying libtool helper files using $libtoolize"
22
 
23
 # Remove any libtool files so one can switch between libtool 1.3
24
 # and libtool 1.4 by simply rerunning the buildconf script.
25
-(cd build ; rm -f ltconfig ltmain.sh libtool.m4)
26
-
27
-$libtoolize --copy --automake
28
-
29
-if [ -f libtool.m4 ]; then 
30
-   ltfile=`pwd`/libtool.m4
31
-else
32
+(cd build ; rm -f ltconfig ltmain.sh libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4)
33
+
34
+lt_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
35
+lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
36
+IFS=.; set $lt_version; IFS=' '
37
+if test "$1" = "1"; then
38
+  $libtoolize --copy --automake
39
+  if [ -f libtool.m4 ]; then 
40
+    ltfile=`pwd`/libtool.m4
41
+  else
42
    ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \
43
                    < $libtoolize`"
44
    ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`}
45
@@ -54,21 +57,21 @@ else
46
      ltpath=`dirname $libtoolize`
47
      ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4
48
    fi
49
-fi
50
-  
51
-if [ ! -f $ltfile ]; then
52
+  fi
53
+  if [ ! -f $ltfile ]; then
54
     echo "$ltfile not found"
55
     exit 1
56
+  fi
57
+  # Do we need this anymore?
58
+  echo "buildconf: Using libtool.m4 at ${ltfile}."
59
+  cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
60
 fi
61
-
62
-echo "buildconf: Using libtool.m4 at ${ltfile}."
63
-
64
-cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
65
-
66
-# libtool.m4 from 1.6 requires ltsugar.m4
67
-if [ -f ltsugar.m4 ]; then
68
-   rm -f build/ltsugar.m4
69
-   mv ltsugar.m4 build/ltsugar.m4
70
+if test "$1" = "2"; then
71
+  $libtoolize --copy
72
+  # Wouldn't it just be better to define top_builddir??
73
+  mv build/libtool.m4 build/libtool.m4.$$
74
+  cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
75
+  rm build/libtool.m4.$$
76
 fi
77
 
78
 # Clean up any leftovers
79
diff --git a/configure.in b/configure.in
80
index 46b4b32..2ac1439 100644
81
--- srclib/apr/configure.in
82
+++ srclib/apr/configure.in
83
@@ -9,6 +9,7 @@ AC_PREREQ(2.50)
84
 AC_INIT(build/apr_common.m4)
85
 AC_CONFIG_HEADER(include/arch/unix/apr_private.h)
86
 AC_CONFIG_AUX_DIR(build)
87
+AC_CONFIG_MACRO_DIR(build)
88
 
89
 dnl 
90
 dnl Include our own M4 macros along with those for libtool
91
@@ -20,6 +21,10 @@ sinclude(build/apr_win32.m4)
92
 sinclude(build/apr_hints.m4)
93
 sinclude(build/libtool.m4)
94
 sinclude(build/ltsugar.m4)
95
+sinclude(build/argz.m4)
96
+sinclude(build/ltoptions.m4)
97
+sinclude(build/ltversion.m4)
98
+sinclude(build/lt~obsolete.m4)
99
 
100
 dnl Hard-coded inclusion at the tail end of apr_private.h:
101
 AH_BOTTOM([
102
@@ -117,6 +122,8 @@ dnl can only be used once within a configure script, so this prevents a
103
 dnl preload section from invoking the macro to get compiler info.
104
 AC_PROG_CC
105
 
106
+AC_PROG_SED
107
+
108
 dnl Preload
109
 APR_PRELOAD
110
 
111
@@ -160,6 +167,11 @@ echo "performing libtool configuration..."
112
 AC_ARG_ENABLE(experimental-libtool,[  --enable-experimental-libtool Use experimental custom libtool],
113
   [experimental_libtool=$enableval],[experimental_libtool=no])
114
 
115
+dnl Workarounds for busted Libtool 2.x when we don't call AC_PROG_LIBTOOL
116
+if test "x$Xsed" = "x"; then
117
+  Xsed="$SED -e 1s/^X//"
118
+fi
119
+
120
 case $host in
121
 *-os2*)
122
     # Use a custom-made libtool replacement
(-)apache22/files/patch-server__mpm__prefork__prefork.c (-42 lines)
Lines 1-42 Link Here
1
--- ./server/mpm/prefork/prefork.c.orig	2008-05-31 07:58:46.000000000 -0400
2
+++ ./server/mpm/prefork/prefork.c	2009-06-11 20:10:12.151389121 -0400
3
@@ -573,19 +573,27 @@
4
                 apr_int32_t numdesc;
5
                 const apr_pollfd_t *pdesc;
6
 
7
-                /* timeout == -1 == wait forever */
8
-                status = apr_pollset_poll(pollset, -1, &numdesc, &pdesc);
9
+                /* check for termination first so we don't sleep for a while in
10
+                 * poll if already signalled
11
+                 */
12
+                if (one_process && shutdown_pending) {
13
+                    SAFE_ACCEPT(accept_mutex_off());
14
+                    return;
15
+                }
16
+                else if (die_now) {
17
+                    /* In graceful stop/restart; drop the mutex
18
+                     * and terminate the child. */
19
+                    SAFE_ACCEPT(accept_mutex_off());
20
+                    clean_child_exit(0);
21
+                }
22
+                /* timeout == 10 seconds to avoid a hang at graceful restart/stop
23
+                 * caused by the closing of sockets by the signal handler
24
+                 */
25
+                status = apr_pollset_poll(pollset, apr_time_from_sec(10), 
26
+                                          &numdesc, &pdesc);
27
                 if (status != APR_SUCCESS) {
28
-                    if (APR_STATUS_IS_EINTR(status)) {
29
-                        if (one_process && shutdown_pending) {
30
-                            return;
31
-                        }
32
-                        else if (die_now) {
33
-                            /* In graceful stop/restart; drop the mutex
34
-                             * and terminate the child. */
35
-                            SAFE_ACCEPT(accept_mutex_off());
36
-                            clean_child_exit(0);
37
-                        }
38
+                    if (APR_STATUS_IS_TIMEUP(status) ||
39
+                        APR_STATUS_IS_EINTR(status)) {
40
                         continue;
41
                     }
42
                     /* Single Unix documents select as returning errnos
(-)apache22/files/patch-srclib-apr-buildconf (-3 / +3 lines)
Lines 4-15 Link Here
4
 #
4
 #
5
 build/buildcheck.sh || exit 1
5
 build/buildcheck.sh || exit 1
6
 
6
 
7
-libtoolize=`build/PrintPath glibtoolize libtoolize15 libtoolize14 libtoolize`
7
-libtoolize=`build/PrintPath glibtoolize1 glibtoolize libtoolize15 libtoolize14 libtoolize`
8
+libtoolize="${LIBTOOLIZE}"
8
+libtoolize="${LIBTOOLIZE}"
9
 if [ "x$libtoolize" = "x" ]; then
9
 if [ "x$libtoolize" = "x" ]; then
10
     echo "libtoolize not found in path"
10
     echo "libtoolize not found in path"
11
     exit 1
11
     exit 1
12
@@ -52,7 +52,7 @@
12
@@ -60,7 +60,7 @@
13
    # Expecting the code above to be very portable, but just in case...
13
    # Expecting the code above to be very portable, but just in case...
14
    if [ -z "$ltfile" -o ! -f "$ltfile" ]; then
14
    if [ -z "$ltfile" -o ! -f "$ltfile" ]; then
15
      ltpath=`dirname $libtoolize`
15
      ltpath=`dirname $libtoolize`
Lines 18-24 Link Here
18
    fi
18
    fi
19
 fi
19
 fi
20
   
20
   
21
@@ -87,8 +87,11 @@
21
@@ -95,8 +95,11 @@
22
 # Remove autoconf 2.5x's cache directory
22
 # Remove autoconf 2.5x's cache directory
23
 rm -rf autom4te*.cache
23
 rm -rf autom4te*.cache
24
 
24
 
(-)apache22/files/patch-srclib:apr:build:buildcheck.sh (-1 / +1 lines)
Lines 20-26 Link Here
20
 # output is multiline from 1.5 onwards
20
 # output is multiline from 1.5 onwards
21
 
21
 
22
 # Require libtool 1.4 or newer
22
 # Require libtool 1.4 or newer
23
-libtool=`build/PrintPath glibtool libtool libtool15 libtool14`
23
-libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14`
24
+libtool=${LIBTOOL}
24
+libtool=${LIBTOOL}
25
 lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
25
 lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
26
 if test -z "$lt_pversion"; then
26
 if test -z "$lt_pversion"; then

Return to bug 137651