[Pkg-php-commits] [php/debian-sid] Updated suhosin.patch to 0.9.8 version for php-5.3.1

Ondřej Surý ondrej at sury.org
Sun Feb 7 23:17:14 UTC 2010


---
 debian/patches/suhosin.patch |  555 ++++++++++++++++++++++++------------------
 1 files changed, 324 insertions(+), 231 deletions(-)

diff --git a/debian/patches/suhosin.patch b/debian/patches/suhosin.patch
index ef662ec..cf75986 100644
--- a/debian/patches/suhosin.patch
+++ b/debian/patches/suhosin.patch
@@ -1,16 +1,7 @@
-suhosin hardening patch
-
-this patch was downloaded from:
-
-  http://www.suspekt.org/downloads/suhosin-patch-5.3.0-0.9.8-BETA-1.patch
-
-the following modifications have been made:
-
- * removed changes to ./configure since this file is autogenerated
- * "quilt refresh" has been run to clean up the offsets, etc
---- pkg-php.orig/Zend/Makefile.am
-+++ pkg-php/Zend/Makefile.am
-@@ -17,7 +17,7 @@ libZend_la_SOURCES=\
+diff -Nura php-5.3.1/Zend/Makefile.am suhosin-patch-5.3.1-0.9.8/Zend/Makefile.am
+--- php-5.3.1/Zend/Makefile.am	2009-03-18 11:18:10.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/Makefile.am	2009-11-25 21:07:21.000000000 +0100
+@@ -17,7 +17,7 @@
  	zend_objects_API.c zend_ts_hash.c zend_stream.c \
  	zend_default_classes.c \
  	zend_iterators.c zend_interfaces.c zend_exceptions.c \
@@ -19,9 +10,10 @@ the following modifications have been made:
  
  libZend_la_LDFLAGS =
  libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
---- pkg-php.orig/Zend/Zend.dsp
-+++ pkg-php/Zend/Zend.dsp
-@@ -247,6 +247,14 @@ SOURCE=.\zend_strtod.c
+diff -Nura php-5.3.1/Zend/Zend.dsp suhosin-patch-5.3.1-0.9.8/Zend/Zend.dsp
+--- php-5.3.1/Zend/Zend.dsp	2009-03-18 11:18:10.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/Zend.dsp	2009-11-25 21:07:21.000000000 +0100
+@@ -247,6 +247,14 @@
  # End Source File
  # Begin Source File
  
@@ -36,9 +28,10 @@ the following modifications have been made:
  SOURCE=.\zend_ts_hash.c
  # End Source File
  # Begin Source File
---- pkg-php.orig/Zend/ZendTS.dsp
-+++ pkg-php/Zend/ZendTS.dsp
-@@ -277,6 +277,14 @@ SOURCE=.\zend_strtod.c
+diff -Nura php-5.3.1/Zend/ZendTS.dsp suhosin-patch-5.3.1-0.9.8/Zend/ZendTS.dsp
+--- php-5.3.1/Zend/ZendTS.dsp	2008-07-14 11:49:03.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/Zend/ZendTS.dsp	2009-11-25 21:07:21.000000000 +0100
+@@ -277,6 +277,14 @@
  # End Source File
  # Begin Source File
  
@@ -53,9 +46,10 @@ the following modifications have been made:
  SOURCE=.\zend_ts_hash.c
  # End Source File
  # Begin Source File
---- pkg-php.orig/Zend/zend.c
-+++ pkg-php/Zend/zend.c
-@@ -60,6 +60,10 @@ int (*zend_vspprintf)(char **pbuf, size_
+diff -Nura php-5.3.1/Zend/zend.c suhosin-patch-5.3.1-0.9.8/Zend/zend.c
+--- php-5.3.1/Zend/zend.c	2009-10-28 12:08:33.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend.c	2009-11-25 21:07:21.000000000 +0100
+@@ -60,6 +60,10 @@
  ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
  ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
  
@@ -66,7 +60,7 @@ the following modifications have been made:
  void (*zend_on_timeout)(int seconds TSRMLS_DC);
  
  static void (*zend_message_dispatcher_p)(long message, void *data TSRMLS_DC);
-@@ -88,6 +92,74 @@ static ZEND_INI_MH(OnUpdateGCEnabled) /*
+@@ -88,6 +92,74 @@
  }
  /* }}} */
  
@@ -141,9 +135,10 @@ the following modifications have been made:
  ZEND_INI_BEGIN()
  	ZEND_INI_ENTRY("error_reporting",				NULL,		ZEND_INI_ALL,		OnUpdateErrorReporting)
  	STD_ZEND_INI_BOOLEAN("zend.enable_gc",				"1",	ZEND_INI_ALL,		OnUpdateGCEnabled,      gc_enabled,     zend_gc_globals,        gc_globals)
---- pkg-php.orig/Zend/zend.h
-+++ pkg-php/Zend/zend.h
-@@ -645,6 +645,9 @@ extern ZEND_API int (*zend_stream_open_f
+diff -Nura php-5.3.1/Zend/zend.h suhosin-patch-5.3.1-0.9.8/Zend/zend.h
+--- php-5.3.1/Zend/zend.h	2009-08-06 03:33:54.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend.h	2009-11-25 21:07:21.000000000 +0100
+@@ -627,6 +627,9 @@
  extern int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
  extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
  extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
@@ -153,7 +148,7 @@ the following modifications have been made:
  
  ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
  
-@@ -784,6 +787,14 @@ ZEND_API void zend_save_error_handling(z
+@@ -766,6 +769,14 @@
  ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current TSRMLS_DC);
  ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC);
  
@@ -168,8 +163,18 @@ the following modifications have been made:
  #endif /* ZEND_H */
  
  /*
---- pkg-php.orig/Zend/zend_alloc.c
-+++ pkg-php/Zend/zend_alloc.c
+diff -Nura php-5.3.1/Zend/zend_alloc.c suhosin-patch-5.3.1-0.9.8/Zend/zend_alloc.c
+--- php-5.3.1/Zend/zend_alloc.c	2009-09-03 16:33:11.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_alloc.c	2009-11-25 21:07:21.000000000 +0100
+@@ -18,7 +18,7 @@
+    +----------------------------------------------------------------------+
+ */
+ 
+-/* $Id: zend_alloc.c 287992 2009-09-03 14:33:11Z dmitry $ */
++/* $Id: zend_alloc.c,v 1.144.2.3.2.43.2.24 2009/05/30 16:42:13 lbarnaud Exp $ */
+ 
+ #include "zend.h"
+ #include "zend_alloc.h"
 @@ -32,6 +32,10 @@
  # include <unistd.h>
  #endif
@@ -189,7 +194,7 @@ the following modifications have been made:
  #if ZEND_DEBUG
  void zend_debug_alloc_output(char *format, ...)
  {
-@@ -76,6 +81,7 @@ void zend_debug_alloc_output(char *forma
+@@ -76,6 +81,7 @@
  #endif
  }
  #endif
@@ -197,7 +202,7 @@ the following modifications have been made:
  
  #if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
  static void zend_mm_panic(const char *message) __attribute__ ((noreturn));
-@@ -324,13 +330,28 @@ static const zend_mm_mem_handlers mem_ha
+@@ -324,13 +330,28 @@
  #define	MEM_BLOCK_GUARD  0x2A8FCC84
  #define	MEM_BLOCK_LEAK   0x6C5E8F2D
  
@@ -228,7 +233,7 @@ the following modifications have been made:
  } zend_mm_block_info;
  
  #if ZEND_DEBUG
-@@ -404,7 +425,7 @@ typedef struct _zend_mm_free_block {
+@@ -404,7 +425,7 @@
  # define ZEND_MM_CACHE_STAT 0
  #endif
  
@@ -237,7 +242,7 @@ the following modifications have been made:
  	int                 use_zend_alloc;
  	void               *(*_malloc)(size_t);
  	void                (*_free)(void*);
-@@ -439,6 +460,9 @@ struct _zend_mm_heap {
+@@ -439,6 +460,9 @@
  		int miss;
  	} cache_stat[ZEND_MM_NUM_BUCKETS+1];
  #endif
@@ -247,8 +252,24 @@ the following modifications have been made:
  };
  
  #define ZEND_MM_SMALL_FREE_BUCKET(heap, index) \
-@@ -528,15 +552,15 @@ static unsigned int _zend_mm_cookie = 0;
- #define ZEND_MM_ALIGNED_SIZE(size)			((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
+@@ -512,18 +536,31 @@
+ /* optimized access */
+ #define ZEND_MM_FREE_BLOCK_SIZE(b)		(b)->info._size
+ 
++#ifndef ZEND_MM_ALIGNMENT
++# define ZEND_MM_ALIGNMENT 8
++# define ZEND_MM_ALIGNMENT_LOG2 3
++#elif ZEND_MM_ALIGNMENT < 4
++# undef ZEND_MM_ALIGNMENT
++# undef ZEND_MM_ALIGNMENT_LOG2
++# define ZEND_MM_ALIGNMENT 4
++# define ZEND_MM_ALIGNMENT_LOG2 2
++#endif
++
++#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
++
+ /* Aligned header size */
++#define ZEND_MM_ALIGNED_SIZE(size)			((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
  #define ZEND_MM_ALIGNED_HEADER_SIZE			ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block))
  #define ZEND_MM_ALIGNED_FREE_HEADER_SIZE	ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_small_free_block))
 -#define ZEND_MM_MIN_ALLOC_BLOCK_SIZE		ZEND_MM_ALIGNED_SIZE(ZEND_MM_ALIGNED_HEADER_SIZE + END_MAGIC_SIZE)
@@ -266,7 +287,7 @@ the following modifications have been made:
  
  #define ZEND_MM_BUCKET_INDEX(true_size)		((true_size>>ZEND_MM_ALIGNMENT_LOG2)-(ZEND_MM_ALIGNED_MIN_HEADER_SIZE>>ZEND_MM_ALIGNMENT_LOG2))
  
-@@ -598,6 +622,44 @@ static unsigned int _zend_mm_cookie = 0;
+@@ -585,6 +622,44 @@
  
  #endif
  
@@ -311,7 +332,7 @@ the following modifications have been made:
  
  #if ZEND_MM_HEAP_PROTECTION
  
-@@ -718,7 +780,7 @@ static inline unsigned int zend_mm_low_b
+@@ -707,7 +782,7 @@
  #endif
  }
  
@@ -320,7 +341,7 @@ the following modifications have been made:
  {
  	zend_mm_free_block *prev, *next;
  
-@@ -735,7 +797,7 @@ static inline void zend_mm_add_to_rest_l
+@@ -724,7 +799,7 @@
  	prev->next_free_block = next->prev_free_block = mm_block;
  }
  
@@ -329,7 +350,7 @@ the following modifications have been made:
  {
  	size_t size;
  	size_t index;
-@@ -796,7 +858,7 @@ static inline void zend_mm_add_to_free_l
+@@ -785,7 +860,7 @@
  	}
  }
  
@@ -338,7 +359,7 @@ the following modifications have been made:
  {
  	zend_mm_free_block *prev = mm_block->prev_free_block;
  	zend_mm_free_block *next = mm_block->next_free_block;
-@@ -806,6 +868,12 @@ static inline void zend_mm_remove_from_f
+@@ -795,6 +870,12 @@
  	if (EXPECTED(prev == mm_block)) {
  		zend_mm_free_block **rp, **cp;
  
@@ -351,7 +372,7 @@ the following modifications have been made:
  #if ZEND_MM_SAFE_UNLINKING
  		if (UNEXPECTED(next != mm_block)) {
  			zend_mm_panic("zend_mm_heap corrupted");
-@@ -844,6 +912,13 @@ subst_block:
+@@ -833,6 +914,13 @@
  		}
  	} else {
  
@@ -365,7 +386,7 @@ the following modifications have been made:
  #if ZEND_MM_SAFE_UNLINKING
  		if (UNEXPECTED(prev->next_free_block != mm_block) || UNEXPECTED(next->prev_free_block != mm_block)) {
  			zend_mm_panic("zend_mm_heap corrupted");
-@@ -867,7 +942,7 @@ subst_block:
+@@ -856,7 +944,7 @@
  	}
  }
  
@@ -374,7 +395,7 @@ the following modifications have been made:
  {
  	zend_mm_free_block* p;
  	int i;
-@@ -891,6 +966,13 @@ static inline void zend_mm_init(zend_mm_
+@@ -880,6 +968,13 @@
  		heap->large_free_buckets[i] = NULL;
  	}
  	heap->rest_buckets[0] = heap->rest_buckets[1] = ZEND_MM_REST_BUCKET(heap);
@@ -388,7 +409,7 @@ the following modifications have been made:
  }
  
  static void zend_mm_del_segment(zend_mm_heap *heap, zend_mm_segment *segment)
-@@ -999,11 +1081,16 @@ static void zend_mm_random(unsigned char
+@@ -988,11 +1083,16 @@
  }
  #endif
  
@@ -406,7 +427,7 @@ the following modifications have been made:
  {
  	zend_mm_storage *storage;
  	zend_mm_heap    *heap;
-@@ -1073,12 +1160,12 @@ ZEND_API zend_mm_heap *zend_mm_startup_e
+@@ -1062,12 +1162,12 @@
  	heap->reserve = NULL;
  	heap->reserve_size = reserve_size;
  	if (reserve_size > 0) {
@@ -421,7 +442,7 @@ the following modifications have been made:
  
  		*mm_heap = *heap;
  
-@@ -1109,7 +1196,11 @@ ZEND_API zend_mm_heap *zend_mm_startup_e
+@@ -1098,7 +1198,11 @@
  	return heap;
  }
  
@@ -434,7 +455,7 @@ the following modifications have been made:
  {
  	int i;
  	size_t seg_size;
-@@ -1163,6 +1254,27 @@ ZEND_API zend_mm_heap *zend_mm_startup(v
+@@ -1152,6 +1256,27 @@
  	return heap;
  }
  
@@ -462,7 +483,7 @@ the following modifications have been made:
  #if ZEND_DEBUG
  static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b)
  {
-@@ -1531,7 +1643,11 @@ static int zend_mm_check_heap(zend_mm_he
+@@ -1520,7 +1645,11 @@
  }
  #endif
  
@@ -475,7 +496,7 @@ the following modifications have been made:
  {
  	zend_mm_storage *storage;
  	zend_mm_segment *segment;
-@@ -1541,7 +1657,7 @@ ZEND_API void zend_mm_shutdown(zend_mm_h
+@@ -1530,7 +1659,7 @@
  	if (heap->reserve) {
  #if ZEND_DEBUG
  		if (!silent) {
@@ -484,7 +505,7 @@ the following modifications have been made:
  		}
  #endif
  		heap->reserve = NULL;
-@@ -1624,12 +1740,23 @@ ZEND_API void zend_mm_shutdown(zend_mm_h
+@@ -1613,12 +1742,23 @@
  		heap->size = 0;
  		heap->peak = 0;
  		if (heap->reserve_size) {
@@ -509,7 +530,7 @@ the following modifications have been made:
  static void zend_mm_safe_error(zend_mm_heap *heap,
  	const char *format,
  	size_t limit,
-@@ -1640,7 +1767,11 @@ static void zend_mm_safe_error(zend_mm_h
+@@ -1629,7 +1769,11 @@
  	size_t size)
  {
  	if (heap->reserve) {
@@ -521,7 +542,7 @@ the following modifications have been made:
  		heap->reserve = NULL;
  	}
  	if (heap->overflow == 0) {
-@@ -1763,6 +1894,9 @@ static zend_mm_free_block *zend_mm_searc
+@@ -1752,6 +1896,9 @@
  	return best_fit->next_free_block;
  }
  
@@ -531,7 +552,7 @@ the following modifications have been made:
  static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
  {
  	zend_mm_free_block *best_fit;
-@@ -1772,7 +1906,7 @@ static void *_zend_mm_alloc_int(zend_mm_
+@@ -1761,7 +1908,7 @@
  	size_t segment_size;
  	zend_mm_segment *segment;
  	int keep_rest = 0;
@@ -540,7 +561,7 @@ the following modifications have been made:
  	if (EXPECTED(ZEND_MM_SMALL_SIZE(true_size))) {
  		size_t index = ZEND_MM_BUCKET_INDEX(true_size);
  		size_t bitmap;
-@@ -1790,6 +1924,11 @@ static void *_zend_mm_alloc_int(zend_mm_
+@@ -1779,6 +1926,11 @@
  			best_fit = heap->cache[index];
  			heap->cache[index] = best_fit->prev_free_block;
  			heap->cached -= true_size;
@@ -552,7 +573,7 @@ the following modifications have been made:
  			ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_CACHED);
  			ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 0);
  			return ZEND_MM_DATA_OF(best_fit);
-@@ -1929,13 +2068,19 @@ zend_mm_finished_searching_for_block:
+@@ -1918,13 +2070,19 @@
  
  	ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 1);
  
@@ -573,7 +594,7 @@ the following modifications have been made:
  	return ZEND_MM_DATA_OF(best_fit);
  }
  
-@@ -1952,12 +2097,19 @@ static void _zend_mm_free_int(zend_mm_he
+@@ -1941,12 +2099,19 @@
  
  	mm_block = ZEND_MM_HEADER_OF(p);
  	size = ZEND_MM_BLOCK_SIZE(mm_block);
@@ -594,7 +615,7 @@ the following modifications have been made:
  #if ZEND_MM_CACHE
  	if (EXPECTED(ZEND_MM_SMALL_SIZE(size)) && EXPECTED(heap->cached < ZEND_MM_CACHE_SIZE)) {
  		size_t index = ZEND_MM_BUCKET_INDEX(size);
-@@ -2000,6 +2152,9 @@ static void _zend_mm_free_int(zend_mm_he
+@@ -1989,6 +2154,9 @@
  	HANDLE_UNBLOCK_INTERRUPTIONS();
  }
  
@@ -604,7 +625,7 @@ the following modifications have been made:
  static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
  {
  	zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p);
-@@ -2009,11 +2164,18 @@ static void *_zend_mm_realloc_int(zend_m
+@@ -1998,11 +2166,18 @@
  	void *ptr;
  
  	if (UNEXPECTED(!p) || !ZEND_MM_VALID_PTR(p)) {
@@ -623,7 +644,7 @@ the following modifications have been made:
  	ZEND_MM_CHECK_PROTECTION(mm_block);
  
  	if (UNEXPECTED(true_size < size)) {
-@@ -2045,6 +2207,11 @@ static void *_zend_mm_realloc_int(zend_m
+@@ -2034,6 +2209,11 @@
  			HANDLE_UNBLOCK_INTERRUPTIONS();
  		}
  		ZEND_MM_SET_DEBUG_INFO(mm_block, size, 0, 0);
@@ -635,7 +656,7 @@ the following modifications have been made:
  		return p;
  	}
  
-@@ -2063,14 +2230,19 @@ static void *_zend_mm_realloc_int(zend_m
+@@ -2052,14 +2232,19 @@
  			best_fit = heap->cache[index];
  			heap->cache[index] = best_fit->prev_free_block;
  			ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_CACHED);
@@ -658,7 +679,7 @@ the following modifications have been made:
  #endif
  
  			heap->cached -= true_size - orig_size;
-@@ -2086,7 +2258,6 @@ static void *_zend_mm_realloc_int(zend_m
+@@ -2075,7 +2260,6 @@
  				heap->cache_stat[index].max_count = heap->cache_stat[index].count;
  			}
  #endif
@@ -666,7 +687,7 @@ the following modifications have been made:
  			return ptr;
  		}
  	}
-@@ -2129,6 +2300,11 @@ static void *_zend_mm_realloc_int(zend_m
+@@ -2118,6 +2302,11 @@
  				heap->peak = heap->size;
  			}
  			HANDLE_UNBLOCK_INTERRUPTIONS();
@@ -678,7 +699,7 @@ the following modifications have been made:
  			return p;
  		} else if (ZEND_MM_IS_FIRST_BLOCK(mm_block) &&
  				   ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_BLOCK_AT(next_block, ZEND_MM_FREE_BLOCK_SIZE(next_block)))) {
-@@ -2231,38 +2407,90 @@ out_of_memory:
+@@ -2220,38 +2409,90 @@
  		}
  
  		HANDLE_UNBLOCK_INTERRUPTIONS();
@@ -773,7 +794,7 @@ the following modifications have been made:
  	if (!ZEND_MM_VALID_PTR(p)) {
  		return 0;
  	}
-@@ -2275,6 +2503,8 @@ ZEND_API size_t _zend_mm_block_size(zend
+@@ -2264,6 +2505,8 @@
  #endif
  }
  
@@ -782,7 +803,7 @@ the following modifications have been made:
  /**********************/
  /* Allocation Manager */
  /**********************/
-@@ -2291,6 +2521,7 @@ static int alloc_globals_id;
+@@ -2280,6 +2523,7 @@
  static zend_alloc_globals alloc_globals;
  #endif
  
@@ -790,7 +811,7 @@ the following modifications have been made:
  ZEND_API int is_zend_mm(TSRMLS_D)
  {
  	return AG(mm_heap)->use_zend_alloc;
-@@ -2303,7 +2534,13 @@ ZEND_API void *_emalloc(size_t size ZEND
+@@ -2292,7 +2536,13 @@
  	if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) {
  		return AG(mm_heap)->_malloc(size);
  	}
@@ -804,7 +825,7 @@ the following modifications have been made:
  }
  
  ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
-@@ -2314,7 +2551,13 @@ ZEND_API void _efree(void *ptr ZEND_FILE
+@@ -2303,7 +2553,13 @@
  		AG(mm_heap)->_free(ptr);
  		return;
  	}
@@ -819,7 +840,7 @@ the following modifications have been made:
  }
  
  ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
-@@ -2324,7 +2567,13 @@ ZEND_API void *_erealloc(void *ptr, size
+@@ -2313,7 +2569,13 @@
  	if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) {
  		return AG(mm_heap)->_realloc(ptr, size);
  	}
@@ -833,7 +854,7 @@ the following modifications have been made:
  }
  
  ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
-@@ -2332,8 +2581,15 @@ ZEND_API size_t _zend_mem_block_size(voi
+@@ -2321,8 +2583,15 @@
  	if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) {
  		return 0;
  	}
@@ -850,7 +871,7 @@ the following modifications have been made:
  
  #if defined(__GNUC__) && defined(i386)
  
-@@ -2404,7 +2660,7 @@ static inline size_t safe_address(size_t
+@@ -2393,7 +2662,7 @@
  }
  #endif
  
@@ -859,7 +880,7 @@ the following modifications have been made:
  ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
  {
  	return emalloc_rel(safe_address(nmemb, size, offset));
-@@ -2517,6 +2773,7 @@ ZEND_API void shutdown_memory_manager(in
+@@ -2506,6 +2775,7 @@
  {
  	zend_mm_shutdown(AG(mm_heap), full_shutdown, silent TSRMLS_CC);
  }
@@ -867,7 +888,7 @@ the following modifications have been made:
  
  static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC)
  {
-@@ -2541,6 +2798,7 @@ static void alloc_globals_dtor(zend_allo
+@@ -2530,6 +2800,7 @@
  }
  #endif
  
@@ -875,7 +896,7 @@ the following modifications have been made:
  ZEND_API void start_memory_manager(TSRMLS_D)
  {
  #ifdef ZTS
-@@ -2605,6 +2863,7 @@ ZEND_API void _full_mem_check(int silent
+@@ -2594,6 +2865,7 @@
  	zend_debug_alloc_output("------------------------------------------------\n");
  }
  #endif
@@ -883,9 +904,10 @@ the following modifications have been made:
  
  /*
   * Local variables:
---- pkg-php.orig/Zend/zend_alloc.h
-+++ pkg-php/Zend/zend_alloc.h
-@@ -189,6 +189,8 @@ END_EXTERN_C()
+diff -Nura php-5.3.1/Zend/zend_alloc.h suhosin-patch-5.3.1-0.9.8/Zend/zend_alloc.h
+--- php-5.3.1/Zend/zend_alloc.h	2009-09-03 16:33:11.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_alloc.h	2009-11-25 21:07:21.000000000 +0100
+@@ -203,6 +203,8 @@
  
  /* Heap functions */
  typedef struct _zend_mm_heap zend_mm_heap;
@@ -894,9 +916,10 @@ the following modifications have been made:
  
  ZEND_API zend_mm_heap *zend_mm_startup(void);
  ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC);
---- /dev/null
-+++ pkg-php/Zend/zend_alloc_canary.c
-@@ -0,0 +1,2441 @@
+diff -Nura php-5.3.1/Zend/zend_alloc_canary.c suhosin-patch-5.3.1-0.9.8/Zend/zend_alloc_canary.c
+--- php-5.3.1/Zend/zend_alloc_canary.c	1970-01-01 01:00:00.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_alloc_canary.c	2009-11-25 21:07:21.000000000 +0100
+@@ -0,0 +1,2443 @@
 +/*
 +   +----------------------------------------------------------------------+
 +   | Suhosin-Patch for PHP                                                |
@@ -1650,12 +1673,14 @@ the following modifications have been made:
 +	unsigned int n;
 +	unsigned int index = 0;
 +
-+	do {
-+		n = offset[_size & 15];
++	n = offset[_size & 15];
++	while (n == 4) {
 +		_size >>= 4;
 +		index += n;
-+	} while (n == 4);
-+	return index;
++		n = offset[_size & 15];
++	}
++
++	return index + n;
 +#endif
 +}
 +
@@ -3338,8 +3363,9 @@ the following modifications have been made:
 + * End:
 + */
 +
---- /dev/null
-+++ pkg-php/Zend/zend_canary.c
+diff -Nura php-5.3.1/Zend/zend_canary.c suhosin-patch-5.3.1-0.9.8/Zend/zend_canary.c
+--- php-5.3.1/Zend/zend_canary.c	1970-01-01 01:00:00.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_canary.c	2009-11-25 21:07:21.000000000 +0100
 @@ -0,0 +1,64 @@
 +/*
 +   +----------------------------------------------------------------------+
@@ -3405,23 +3431,25 @@ the following modifications have been made:
 + * vim600: sw=4 ts=4 fdm=marker
 + * vim<600: sw=4 ts=4
 + */
---- pkg-php.orig/Zend/zend_compile.c
-+++ pkg-php/Zend/zend_compile.c
-@@ -69,6 +69,11 @@ static void zend_destroy_property_info_i
- 	free(property_info->name);
+diff -Nura php-5.3.1/Zend/zend_compile.c suhosin-patch-5.3.1-0.9.8/Zend/zend_compile.c
+--- php-5.3.1/Zend/zend_compile.c	2009-10-09 19:23:01.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_compile.c	2009-11-25 21:07:21.000000000 +0100
+@@ -73,6 +73,11 @@
  }
+ /* }}} */
  
 +#if SUHOSIN_PATCH
 +void *suhosin_zend_destroy_property_info_internal = zend_destroy_property_info_internal;
 +void *suhosin_zend_destroy_property_info = zend_destroy_property_info;
 +#endif
 +
- static void build_runtime_defined_function_key(zval *result, const char *name, int name_length TSRMLS_DC)
+ static void build_runtime_defined_function_key(zval *result, const char *name, int name_length TSRMLS_DC) /* {{{ */
  {
  	char char_pos_buf[32];
---- pkg-php.orig/Zend/zend_compile.h
-+++ pkg-php/Zend/zend_compile.h
-@@ -606,6 +606,11 @@ ZEND_API zend_bool zend_is_auto_global(c
+diff -Nura php-5.3.1/Zend/zend_compile.h suhosin-patch-5.3.1-0.9.8/Zend/zend_compile.h
+--- php-5.3.1/Zend/zend_compile.h	2009-06-06 01:20:59.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_compile.h	2009-11-25 21:07:21.000000000 +0100
+@@ -606,6 +606,11 @@
  ZEND_API int zend_auto_global_disable_jit(const char *varname, zend_uint varname_length TSRMLS_DC);
  ZEND_API size_t zend_dirname(char *path, size_t len);
  
@@ -3433,9 +3461,10 @@ the following modifications have been made:
  int zendlex(znode *zendlval TSRMLS_DC);
  
  /* BEGIN: OPCODES */
---- pkg-php.orig/Zend/zend_constants.c
-+++ pkg-php/Zend/zend_constants.c
-@@ -113,6 +113,76 @@ void zend_register_standard_constants(TS
+diff -Nura php-5.3.1/Zend/zend_constants.c suhosin-patch-5.3.1-0.9.8/Zend/zend_constants.c
+--- php-5.3.1/Zend/zend_constants.c	2009-01-12 22:54:37.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_constants.c	2009-11-25 21:07:21.000000000 +0100
+@@ -113,6 +113,76 @@
  
  	REGISTER_MAIN_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS);
  
@@ -3512,8 +3541,9 @@ the following modifications have been made:
  	/* true/false constants */
  	{
  		zend_constant c;
---- pkg-php.orig/Zend/zend_errors.h
-+++ pkg-php/Zend/zend_errors.h
+diff -Nura php-5.3.1/Zend/zend_errors.h suhosin-patch-5.3.1-0.9.8/Zend/zend_errors.h
+--- php-5.3.1/Zend/zend_errors.h	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_errors.h	2009-11-25 21:07:21.000000000 +0100
 @@ -41,6 +41,20 @@
  #define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED)
  #define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
@@ -3535,29 +3565,30 @@ the following modifications have been made:
  #endif /* ZEND_ERRORS_H */
  
  /*
---- pkg-php.orig/Zend/zend_hash.c
-+++ pkg-php/Zend/zend_hash.c
+diff -Nura php-5.3.1/Zend/zend_hash.c suhosin-patch-5.3.1-0.9.8/Zend/zend_hash.c
+--- php-5.3.1/Zend/zend_hash.c	2009-06-07 21:28:15.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_hash.c	2009-11-25 21:07:21.000000000 +0100
 @@ -20,6 +20,7 @@
- /* $Id: zend_hash.c,v 1.121.2.4.2.8.2.9 2009/06/07 19:28:15 mattwil Exp $ */
+ /* $Id: zend_hash.c 281778 2009-06-07 19:28:15Z mattwil $ */
  
  #include "zend.h"
 +#include "zend_compile.h"
  
  #define CONNECT_TO_BUCKET_DLLIST(element, list_head)		\
  	(element)->pNext = (list_head);							\
-@@ -133,6 +134,191 @@ ZEND_API ulong zend_hash_func(const char
+@@ -133,6 +134,191 @@
  	}
  
  
 +#if SUHOSIN_PATCH
 +#ifdef ZTS
-+MUTEX_T zend_hash_dprot_mx_reader;
-+MUTEX_T zend_hash_dprot_mx_writer;
-+unsigned int zend_hash_dprot_reader;
++static MUTEX_T zend_hash_dprot_mx_reader;
++static MUTEX_T zend_hash_dprot_mx_writer;
++static unsigned int zend_hash_dprot_reader;
 +#endif
-+unsigned int zend_hash_dprot_counter;
-+unsigned int zend_hash_dprot_curmax;
-+dtor_func_t *zend_hash_dprot_table = NULL;
++static unsigned int zend_hash_dprot_counter;
++static unsigned int zend_hash_dprot_curmax;
++static dtor_func_t *zend_hash_dprot_table = NULL;
 +
 +static void zend_hash_dprot_begin_read()
 +{
@@ -3737,7 +3768,7 @@ the following modifications have been made:
  
  ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
  {
-@@ -153,6 +339,7 @@ ZEND_API int _zend_hash_init(HashTable *
+@@ -153,6 +339,7 @@
  
  	ht->nTableMask = ht->nTableSize - 1;
  	ht->pDestructor = pDestructor;
@@ -3745,7 +3776,7 @@ the following modifications have been made:
  	ht->arBuckets = NULL;
  	ht->pListHead = NULL;
  	ht->pListTail = NULL;
-@@ -230,6 +417,7 @@ ZEND_API int _zend_hash_add_or_update(Ha
+@@ -230,6 +417,7 @@
  					return FAILURE;
  				}
  #endif
@@ -3753,7 +3784,7 @@ the following modifications have been made:
  				if (ht->pDestructor) {
  					ht->pDestructor(p->pData);
  				}
-@@ -295,6 +483,7 @@ ZEND_API int _zend_hash_quick_add_or_upd
+@@ -295,6 +483,7 @@
  					return FAILURE;
  				}
  #endif
@@ -3761,7 +3792,7 @@ the following modifications have been made:
  				if (ht->pDestructor) {
  					ht->pDestructor(p->pData);
  				}
-@@ -370,6 +559,7 @@ ZEND_API int _zend_hash_index_update_or_
+@@ -370,6 +559,7 @@
  				return FAILURE;
  			}
  #endif
@@ -3769,7 +3800,7 @@ the following modifications have been made:
  			if (ht->pDestructor) {
  				ht->pDestructor(p->pData);
  			}
-@@ -493,6 +683,7 @@ ZEND_API int zend_hash_del_key_or_index(
+@@ -493,6 +683,7 @@
  			if (ht->pInternalPointer == p) {
  				ht->pInternalPointer = p->pListNext;
  			}
@@ -3777,7 +3808,7 @@ the following modifications have been made:
  			if (ht->pDestructor) {
  				ht->pDestructor(p->pData);
  			}
-@@ -519,6 +710,7 @@ ZEND_API void zend_hash_destroy(HashTabl
+@@ -519,6 +710,7 @@
  	SET_INCONSISTENT(HT_IS_DESTROYING);
  
  	p = ht->pListHead;
@@ -3785,7 +3816,7 @@ the following modifications have been made:
  	while (p != NULL) {
  		q = p;
  		p = p->pListNext;
-@@ -545,6 +737,7 @@ ZEND_API void zend_hash_clean(HashTable 
+@@ -545,6 +737,7 @@
  	SET_INCONSISTENT(HT_CLEANING);
  
  	p = ht->pListHead;
@@ -3793,7 +3824,7 @@ the following modifications have been made:
  	while (p != NULL) {
  		q = p;
  		p = p->pListNext;
-@@ -607,6 +800,7 @@ static Bucket *zend_hash_apply_deleter(H
+@@ -607,6 +800,7 @@
  	ht->nNumOfElements--;
  	HANDLE_UNBLOCK_INTERRUPTIONS();
  
@@ -3801,21 +3832,22 @@ the following modifications have been made:
  	if (ht->pDestructor) {
  		ht->pDestructor(p->pData);
  	}
---- pkg-php.orig/Zend/zend_llist.c
-+++ pkg-php/Zend/zend_llist.c
+diff -Nura php-5.3.1/Zend/zend_llist.c suhosin-patch-5.3.1-0.9.8/Zend/zend_llist.c
+--- php-5.3.1/Zend/zend_llist.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_llist.c	2009-11-25 21:07:21.000000000 +0100
 @@ -23,6 +23,186 @@
  #include "zend_llist.h"
  #include "zend_qsort.h"
  
 +#if SUHOSIN_PATCH
 +#ifdef ZTS
-+MUTEX_T zend_llist_dprot_mx_reader;
-+MUTEX_T zend_llist_dprot_mx_writer;
-+unsigned int zend_llist_dprot_reader;
++static MUTEX_T zend_llist_dprot_mx_reader;
++static MUTEX_T zend_llist_dprot_mx_writer;
++static unsigned int zend_llist_dprot_reader;
 +#endif
-+unsigned int zend_llist_dprot_counter;
-+unsigned int zend_llist_dprot_curmax;
-+llist_dtor_func_t *zend_llist_dprot_table = NULL;
++static unsigned int zend_llist_dprot_counter;
++static unsigned int zend_llist_dprot_curmax;
++static llist_dtor_func_t *zend_llist_dprot_table = NULL;
 +
 +static void zend_llist_dprot_begin_read()
 +{
@@ -3990,7 +4022,7 @@ the following modifications have been made:
  ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent)
  {
  	l->head  = NULL;
-@@ -30,6 +210,7 @@ ZEND_API void zend_llist_init(zend_llist
+@@ -30,6 +210,7 @@
  	l->count = 0;
  	l->size  = size;
  	l->dtor  = dtor;
@@ -3998,7 +4030,7 @@ the following modifications have been made:
  	l->persistent = persistent;
  }
  
-@@ -81,6 +262,7 @@ ZEND_API void zend_llist_prepend_element
+@@ -81,6 +262,7 @@
  			} else {\
  				(l)->tail = (current)->prev;\
  			}\
@@ -4006,7 +4038,7 @@ the following modifications have been made:
  			if ((l)->dtor) {\
  				(l)->dtor((current)->data);\
  			}\
-@@ -108,6 +290,7 @@ ZEND_API void zend_llist_destroy(zend_ll
+@@ -108,6 +290,7 @@
  {
  	zend_llist_element *current=l->head, *next;
  	
@@ -4014,7 +4046,7 @@ the following modifications have been made:
  	while (current) {
  		next = current->next;
  		if (l->dtor) {
-@@ -133,6 +316,7 @@ ZEND_API void *zend_llist_remove_tail(ze
+@@ -133,6 +316,7 @@
  	zend_llist_element *old_tail;
  	void *data;
  
@@ -4022,9 +4054,10 @@ the following modifications have been made:
  	if ((old_tail = l->tail)) {
  		if (old_tail->prev) {
  			old_tail->prev->next = NULL;
---- pkg-php.orig/Zend/zend_operators.c
-+++ pkg-php/Zend/zend_operators.c
-@@ -152,9 +152,14 @@ ZEND_API void convert_scalar_to_number(z
+diff -Nura php-5.3.1/Zend/zend_operators.c suhosin-patch-5.3.1-0.9.8/Zend/zend_operators.c
+--- php-5.3.1/Zend/zend_operators.c	2009-06-04 20:20:45.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_operators.c	2009-11-25 21:07:21.000000000 +0100
+@@ -152,9 +152,14 @@
  		case IS_STRING:
  			{
  				char *strval;
@@ -4040,7 +4073,7 @@ the following modifications have been made:
  					ZVAL_LONG(op, 0);
  				}
  				STR_FREE(strval);
-@@ -186,7 +191,8 @@ ZEND_API void convert_scalar_to_number(z
+@@ -186,7 +191,8 @@
  	} else {														\
  		switch (Z_TYPE_P(op)) {										\
  			case IS_STRING:											\
@@ -4050,7 +4083,7 @@ the following modifications have been made:
  					if ((Z_TYPE(holder)=is_numeric_string(Z_STRVAL_P(op), Z_STRLEN_P(op), &Z_LVAL(holder), &Z_DVAL(holder), 1)) == 0) {	\
  						ZVAL_LONG(&(holder), 0);							\
  					}														\
-@@ -228,6 +234,7 @@ ZEND_API void convert_scalar_to_number(z
+@@ -228,6 +234,7 @@
  				Z_LVAL(holder) = zend_dval_to_lval(Z_DVAL_P(op));	\
  				break;												\
  			case IS_STRING:											\
@@ -4058,7 +4091,7 @@ the following modifications have been made:
  				Z_LVAL(holder) = strtol(Z_STRVAL_P(op), NULL, 10);	\
  				break;												\
  			case IS_ARRAY:											\
-@@ -270,6 +277,7 @@ ZEND_API void convert_scalar_to_number(z
+@@ -270,6 +277,7 @@
  				Z_LVAL(holder) = (Z_DVAL_P(op) ? 1 : 0);			\
  				break;												\
  			case IS_STRING:											\
@@ -4066,7 +4099,7 @@ the following modifications have been made:
  				if (Z_STRLEN_P(op) == 0								\
  					|| (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) {	\
  					Z_LVAL(holder) = 0;								\
-@@ -355,6 +363,9 @@ ZEND_API void convert_to_long_base(zval 
+@@ -355,6 +363,9 @@
  			{
  				char *strval = Z_STRVAL_P(op);
  
@@ -4076,7 +4109,7 @@ the following modifications have been made:
  				Z_LVAL_P(op) = strtol(strval, NULL, base);
  				STR_FREE(strval);
  			}
-@@ -415,6 +426,9 @@ ZEND_API void convert_to_double(zval *op
+@@ -415,6 +426,9 @@
  			{
  				char *strval = Z_STRVAL_P(op);
  
@@ -4086,7 +4119,7 @@ the following modifications have been made:
  				Z_DVAL_P(op) = zend_strtod(strval, NULL);
  				STR_FREE(strval);
  			}
-@@ -501,8 +515,14 @@ ZEND_API void convert_to_boolean(zval *o
+@@ -501,8 +515,14 @@
  
  				if (Z_STRLEN_P(op) == 0
  					|| (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) {
@@ -4101,7 +4134,7 @@ the following modifications have been made:
  					Z_LVAL_P(op) = 1;
  				}
  				STR_FREE(strval);
-@@ -616,6 +636,9 @@ static void convert_scalar_to_array(zval
+@@ -616,6 +636,9 @@
  	*entry = *op;
  	INIT_PZVAL(entry);
  
@@ -4111,9 +4144,10 @@ the following modifications have been made:
  	switch (type) {
  		case IS_ARRAY:
  			ALLOC_HASHTABLE(Z_ARRVAL_P(op));
---- pkg-php.orig/Zend/zend_variables.c
-+++ pkg-php/Zend/zend_variables.c
-@@ -34,6 +34,9 @@ ZEND_API void _zval_dtor_func(zval *zval
+diff -Nura php-5.3.1/Zend/zend_variables.c suhosin-patch-5.3.1-0.9.8/Zend/zend_variables.c
+--- php-5.3.1/Zend/zend_variables.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/Zend/zend_variables.c	2009-11-25 21:07:21.000000000 +0100
+@@ -34,6 +34,9 @@
  		case IS_CONSTANT:
  			CHECK_ZVAL_STRING_REL(zvalue);
  			STR_FREE_REL(zvalue->value.str.val);
@@ -4123,7 +4157,7 @@ the following modifications have been made:
  			break;
  		case IS_ARRAY:
  		case IS_CONSTANT_ARRAY: {
-@@ -78,6 +81,9 @@ ZEND_API void _zval_internal_dtor(zval *
+@@ -78,6 +81,9 @@
  		case IS_CONSTANT:
  			CHECK_ZVAL_STRING_REL(zvalue);
  			free(zvalue->value.str.val);
@@ -4133,17 +4167,49 @@ the following modifications have been made:
  			break;
  		case IS_ARRAY:
  		case IS_CONSTANT_ARRAY:
---- pkg-php.orig/configure.in
-+++ pkg-php/configure.in
-@@ -307,6 +307,7 @@ sinclude(Zend/Zend.m4)
+diff -Nura php-5.3.1/configure suhosin-patch-5.3.1-0.9.8/configure
+--- php-5.3.1/configure	2009-11-18 21:11:57.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/configure	2009-11-25 21:07:21.000000000 +0100
+@@ -17856,6 +17856,9 @@
+ 
+ fi
+ 
++cat >> confdefs.h <<\EOF
++#define SUHOSIN_PATCH 1
++EOF
+ 
+   echo $ac_n "checking for declared timezone""... $ac_c" 1>&6
+ echo "configure:17862: checking for declared timezone" >&5
+@@ -112825,7 +112828,7 @@
+        php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
+        strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
+        network.c php_open_temporary_file.c php_logos.c \
+-       output.c getopt.c; do
++       output.c getopt.c suhosin_patch.c ; do
+   
+       IFS=.
+       set $ac_src
+@@ -113029,7 +113032,7 @@
+     zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
+     zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \
+     zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \
+-    zend_closures.c zend_float.c; do
++    zend_closures.c zend_float.c zend_canary.c zend_alloc_canary.c ; do
+   
+       IFS=.
+       set $ac_src
+diff -Nura php-5.3.1/configure.in suhosin-patch-5.3.1-0.9.8/configure.in
+--- php-5.3.1/configure.in	2009-11-18 20:43:33.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/configure.in	2009-11-25 21:07:21.000000000 +0100
+@@ -304,6 +304,7 @@
  sinclude(TSRM/threads.m4)
  sinclude(TSRM/tsrm.m4)
  
 +sinclude(main/suhosin_patch.m4)
  
- dnl divert(2)
+ divert(2)
  
-@@ -1422,7 +1423,7 @@ PHP_ADD_SOURCES(main, main.c snprintf.c 
+@@ -1408,7 +1409,7 @@
         php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
         strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
         network.c php_open_temporary_file.c php_logos.c \
@@ -4152,7 +4218,7 @@ the following modifications have been made:
  
  PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \
         plain_wrapper.c userspace.c transports.c xp_socket.c mmap.c \
-@@ -1450,7 +1451,7 @@ PHP_ADD_SOURCES(Zend, \
+@@ -1436,7 +1437,7 @@
      zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
      zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \
      zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \
@@ -4161,9 +4227,10 @@ the following modifications have been made:
  
  if test -r "$abs_srcdir/Zend/zend_objects.c"; then
    PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_default_classes.c)
---- pkg-php.orig/ext/standard/dl.c
-+++ pkg-php/ext/standard/dl.c
-@@ -239,6 +239,23 @@ PHPAPI int php_load_extension(char *file
+diff -Nura php-5.3.1/ext/standard/dl.c suhosin-patch-5.3.1-0.9.8/ext/standard/dl.c
+--- php-5.3.1/ext/standard/dl.c	2009-08-06 03:33:54.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/ext/standard/dl.c	2009-11-25 21:07:21.000000000 +0100
+@@ -244,6 +244,23 @@
  			return FAILURE;
  		}
  	}
@@ -4187,9 +4254,10 @@ the following modifications have been made:
  	return SUCCESS;
  }
  /* }}} */
---- pkg-php.orig/ext/standard/info.c
-+++ pkg-php/ext/standard/info.c
-@@ -842,6 +842,33 @@ PHPAPI void php_print_info(int flag TSRM
+diff -Nura php-5.3.1/ext/standard/info.c suhosin-patch-5.3.1-0.9.8/ext/standard/info.c
+--- php-5.3.1/ext/standard/info.c	2009-10-09 19:15:46.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/ext/standard/info.c	2009-11-25 21:07:21.000000000 +0100
+@@ -867,6 +867,33 @@
  		
  		php_info_print_table_end();
  
@@ -4223,9 +4291,10 @@ the following modifications have been made:
  		/* Zend Engine */
  		php_info_print_box_start(0);
  		if (expose_php && !sapi_module.phpinfo_as_text) {
---- pkg-php.orig/ext/standard/syslog.c
-+++ pkg-php/ext/standard/syslog.c
-@@ -42,6 +42,7 @@ static void start_syslog(TSRMLS_D);
+diff -Nura php-5.3.1/ext/standard/syslog.c suhosin-patch-5.3.1-0.9.8/ext/standard/syslog.c
+--- php-5.3.1/ext/standard/syslog.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/ext/standard/syslog.c	2009-11-25 21:07:21.000000000 +0100
+@@ -42,6 +42,7 @@
   */
  PHP_MINIT_FUNCTION(syslog)
  {
@@ -4233,7 +4302,7 @@ the following modifications have been made:
  	/* error levels */
  	REGISTER_LONG_CONSTANT("LOG_EMERG", LOG_EMERG, CONST_CS | CONST_PERSISTENT); /* system unusable */
  	REGISTER_LONG_CONSTANT("LOG_ALERT", LOG_ALERT, CONST_CS | CONST_PERSISTENT); /* immediate action required */
-@@ -97,6 +98,7 @@ PHP_MINIT_FUNCTION(syslog)
+@@ -97,6 +98,7 @@
  	/* AIX doesn't have LOG_PERROR */
  	REGISTER_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_CS | CONST_PERSISTENT); /*log to stderr*/
  #endif
@@ -4241,9 +4310,10 @@ the following modifications have been made:
  	BG(syslog_device)=NULL;
  
  	return SUCCESS;
---- pkg-php.orig/main/fopen_wrappers.c
-+++ pkg-php/main/fopen_wrappers.c
-@@ -85,15 +85,10 @@ or a tightening during activation/runtim
+diff -Nura php-5.3.1/main/fopen_wrappers.c suhosin-patch-5.3.1-0.9.8/main/fopen_wrappers.c
+--- php-5.3.1/main/fopen_wrappers.c	2009-10-09 19:03:56.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/main/fopen_wrappers.c	2009-11-25 21:07:21.000000000 +0100
+@@ -85,13 +85,8 @@
  PHPAPI ZEND_INI_MH(OnUpdateBaseDir)
  {
  	char **p, *pathbuf, *ptr, *end;
@@ -4254,15 +4324,13 @@ the following modifications have been made:
 -#endif
  
 -	p = (char **) (base + (size_t) mh_arg1);
-+        p = &PG(open_basedir);
++	p = &PG(open_basedir);
  
--	if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN) {
-+	if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) {
+ 	if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) {
  		/* We're in a PHP_INI_SYSTEM context, no restrictions */
- 		*p = new_value;
- 		return SUCCESS;
---- pkg-php.orig/main/main.c
-+++ pkg-php/main/main.c
+diff -Nura php-5.3.1/main/main.c suhosin-patch-5.3.1-0.9.8/main/main.c
+--- php-5.3.1/main/main.c	2009-10-28 16:19:32.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/main.c	2009-11-25 21:07:21.000000000 +0100
 @@ -90,6 +90,9 @@
  
  #include "SAPI.h"
@@ -4273,7 +4341,7 @@ the following modifications have been made:
  
  #if HAVE_SYS_MMAN_H
  # include <sys/mman.h>
-@@ -468,7 +471,7 @@ PHP_INI_BEGIN()
+@@ -487,7 +490,7 @@
  	STD_PHP_INI_ENTRY("extension_dir",			PHP_EXTENSION_DIR,		PHP_INI_SYSTEM,		OnUpdateStringUnempty,	extension_dir,			php_core_globals,	core_globals)
  	STD_PHP_INI_ENTRY("include_path",			PHP_INCLUDE_PATH,		PHP_INI_ALL,		OnUpdateStringUnempty,	include_path,			php_core_globals,	core_globals)
  	PHP_INI_ENTRY("max_execution_time",			"30",		PHP_INI_ALL,			OnUpdateTimeout)
@@ -4282,7 +4350,7 @@ the following modifications have been made:
  	STD_PHP_INI_ENTRY("safe_mode_exec_dir",		PHP_SAFE_MODE_EXEC_DIR,	PHP_INI_SYSTEM,		OnUpdateString,			safe_mode_exec_dir,		php_core_globals,	core_globals)
  
  	STD_PHP_INI_BOOLEAN("file_uploads",			"1",		PHP_INI_SYSTEM,		OnUpdateBool,			file_uploads,			php_core_globals,	core_globals)
-@@ -1721,6 +1724,10 @@ void dummy_invalid_parameter_handler(
+@@ -1747,6 +1750,10 @@
  }
  #endif
  
@@ -4293,7 +4361,7 @@ the following modifications have been made:
  /* {{{ php_module_startup
   */
  int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules)
-@@ -1765,6 +1772,10 @@ int php_module_startup(sapi_module_struc
+@@ -1791,6 +1798,10 @@
  	tsrm_ls = ts_resource(0);
  #endif
  
@@ -4304,7 +4372,7 @@ the following modifications have been made:
  	module_shutdown = 0;
  	module_startup = 1;
  	sapi_initialize_empty_request(TSRMLS_C);
-@@ -1884,7 +1895,11 @@ int php_module_startup(sapi_module_struc
+@@ -1910,7 +1921,11 @@
  	REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS);
  	REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS);
  	REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS);
@@ -4317,9 +4385,10 @@ the following modifications have been made:
  	REGISTER_MAIN_LONG_CONSTANT("PHP_INT_MAX", LONG_MAX, CONST_PERSISTENT | CONST_CS);
  	REGISTER_MAIN_LONG_CONSTANT("PHP_INT_SIZE", sizeof(long), CONST_PERSISTENT | CONST_CS);
  
---- pkg-php.orig/main/php.h
-+++ pkg-php/main/php.h
-@@ -454,6 +454,10 @@ END_EXTERN_C()
+diff -Nura php-5.3.1/main/php.h suhosin-patch-5.3.1-0.9.8/main/php.h
+--- php-5.3.1/main/php.h	2009-06-26 17:44:19.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/main/php.h	2009-11-25 21:07:21.000000000 +0100
+@@ -450,6 +450,10 @@
  #endif
  #endif /* !XtOffsetOf */
  
@@ -4330,9 +4399,10 @@ the following modifications have been made:
  #endif
  
  /*
---- pkg-php.orig/main/php_config.h.in
-+++ pkg-php/main/php_config.h.in
-@@ -836,6 +836,9 @@
+diff -Nura php-5.3.1/main/php_config.h.in suhosin-patch-5.3.1-0.9.8/main/php_config.h.in
+--- php-5.3.1/main/php_config.h.in	2009-11-18 21:12:01.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/php_config.h.in	2009-11-25 21:07:21.000000000 +0100
+@@ -833,6 +833,9 @@
  /* Define if the target system has /dev/urandom device */
  #undef HAVE_DEV_URANDOM
  
@@ -4342,9 +4412,10 @@ the following modifications have been made:
  /* Whether you have AOLserver */
  #undef HAVE_AOLSERVER
  
---- pkg-php.orig/main/php_logos.c
-+++ pkg-php/main/php_logos.c
-@@ -50,6 +50,10 @@ PHPAPI int php_unregister_info_logo(char
+diff -Nura php-5.3.1/main/php_logos.c suhosin-patch-5.3.1-0.9.8/main/php_logos.c
+--- php-5.3.1/main/php_logos.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/php_logos.c	2009-11-25 21:07:21.000000000 +0100
+@@ -50,6 +50,10 @@
  	return zend_hash_del(&phpinfo_logo_hash, logo_string, strlen(logo_string));
  }
  
@@ -4355,7 +4426,7 @@ the following modifications have been made:
  int php_init_info_logos(void)
  {
  	if(zend_hash_init(&phpinfo_logo_hash, 0, NULL, NULL, 1)==FAILURE) 
-@@ -58,7 +62,9 @@ int php_init_info_logos(void)
+@@ -58,7 +62,9 @@
  	php_register_info_logo(PHP_LOGO_GUID    , "image/gif", php_logo    , sizeof(php_logo));
  	php_register_info_logo(PHP_EGG_LOGO_GUID, "image/gif", php_egg_logo, sizeof(php_egg_logo));
  	php_register_info_logo(ZEND_LOGO_GUID   , "image/gif", zend_logo   , sizeof(zend_logo));
@@ -4366,9 +4437,10 @@ the following modifications have been made:
  	return SUCCESS;
  }
  
---- pkg-php.orig/main/snprintf.c
-+++ pkg-php/main/snprintf.c
-@@ -1091,7 +1091,11 @@ static int format_converter(register buf
+diff -Nura php-5.3.1/main/snprintf.c suhosin-patch-5.3.1-0.9.8/main/snprintf.c
+--- php-5.3.1/main/snprintf.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/snprintf.c	2009-11-25 21:07:21.000000000 +0100
+@@ -1091,7 +1091,11 @@
  
  
  				case 'n':
@@ -4380,9 +4452,10 @@ the following modifications have been made:
  					goto skip_output;
  
  					/*
---- pkg-php.orig/main/spprintf.c
-+++ pkg-php/main/spprintf.c
-@@ -698,7 +698,11 @@ static void xbuf_format_converter(smart_
+diff -Nura php-5.3.1/main/spprintf.c suhosin-patch-5.3.1-0.9.8/main/spprintf.c
+--- php-5.3.1/main/spprintf.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/spprintf.c	2009-11-25 21:07:21.000000000 +0100
+@@ -698,7 +698,11 @@
  
  
  				case 'n':
@@ -4394,8 +4467,9 @@ the following modifications have been made:
  					goto skip_output;
  
  					/*
---- /dev/null
-+++ pkg-php/main/suhosin_globals.h
+diff -Nura php-5.3.1/main/suhosin_globals.h suhosin-patch-5.3.1-0.9.8/main/suhosin_globals.h
+--- php-5.3.1/main/suhosin_globals.h	1970-01-01 01:00:00.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/suhosin_globals.h	2009-11-25 21:07:21.000000000 +0100
 @@ -0,0 +1,61 @@
 +/*
 +   +----------------------------------------------------------------------+
@@ -4458,8 +4532,9 @@ the following modifications have been made:
 + * c-basic-offset: 4
 + * End:
 + */
---- /dev/null
-+++ pkg-php/main/suhosin_logo.h
+diff -Nura php-5.3.1/main/suhosin_logo.h suhosin-patch-5.3.1-0.9.8/main/suhosin_logo.h
+--- php-5.3.1/main/suhosin_logo.h	1970-01-01 01:00:00.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/suhosin_logo.h	2009-11-25 21:07:21.000000000 +0100
 @@ -0,0 +1,178 @@
 +static unsigned char suhosin_logo[] =
 +	"\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x01\x00\x48"
@@ -4639,9 +4714,10 @@ the following modifications have been made:
 +	"\x21\xb6\x99\x69\xbc\x25\xb6\xdb\x6d\x18\xc2\x10\xda\x12\x94\xa1"
 +	"\x38\xc2\x53\x8c\x63\x18\xc7\x9d\xbe\x7f\xff\xd9"
 +	;
---- /dev/null
-+++ pkg-php/main/suhosin_patch.c
-@@ -0,0 +1,455 @@
+diff -Nura php-5.3.1/main/suhosin_patch.c suhosin-patch-5.3.1-0.9.8/main/suhosin_patch.c
+--- php-5.3.1/main/suhosin_patch.c	1970-01-01 01:00:00.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/suhosin_patch.c	2009-11-25 21:07:21.000000000 +0100
+@@ -0,0 +1,458 @@
 +/*
 +   +----------------------------------------------------------------------+
 +   | Suhosin Patch for PHP                                                |
@@ -4772,7 +4848,8 @@ the following modifications have been made:
 +                int flag = zend_atoi(tmp, 0);
 +                SUHOSIN_CONFIG(SUHOSIN_LL_IGNORE_INVALID_DESTRUCTOR) = flag;
 +        }
-+
++        
++        SUHOSIN_CONFIG(SUHOSIN_CONFIG_SET) = 1;
 +}
 +
 +static void suhosin_write_protect_configuration()
@@ -4791,8 +4868,10 @@ the following modifications have been made:
 +#endif
 +	zend_suhosin_log = php_security_log;
 +	
++	if (!SUHOSIN_CONFIG(SUHOSIN_CONFIG_SET)) {
 +        suhosin_read_configuration_from_environment();
 +        suhosin_write_protect_configuration();
++    }
 +}
 +
 +/*PHPAPI void suhosin_clear_mm_canaries(TSRMLS_D)
@@ -5097,9 +5176,10 @@ the following modifications have been made:
 + * vim600: sw=4 ts=4 fdm=marker
 + * vim<600: sw=4 ts=4
 + */
---- /dev/null
-+++ pkg-php/main/suhosin_patch.h
-@@ -0,0 +1,61 @@
+diff -Nura php-5.3.1/main/suhosin_patch.h suhosin-patch-5.3.1-0.9.8/main/suhosin_patch.h
+--- php-5.3.1/main/suhosin_patch.h	1970-01-01 01:00:00.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/suhosin_patch.h	2009-11-25 21:07:21.000000000 +0100
+@@ -0,0 +1,63 @@
 +/*
 +   +----------------------------------------------------------------------+
 +   | Suhosin Patch for PHP                                                |
@@ -5136,6 +5216,8 @@ the following modifications have been made:
 +#define SUHOSIN_HT_IGNORE_INVALID_DESTRUCTOR    3
 +#define SUHOSIN_LL_IGNORE_INVALID_DESTRUCTOR    4
 +
++#define SUHOSIN_CONFIG_SET                      100
++
 +#include <sys/types.h>
 +#include <sys/stat.h>
 +#include <sys/mman.h>
@@ -5161,8 +5243,9 @@ the following modifications have been made:
 + * c-basic-offset: 4
 + * End:
 + */
---- /dev/null
-+++ pkg-php/main/suhosin_patch.m4
+diff -Nura php-5.3.1/main/suhosin_patch.m4 suhosin-patch-5.3.1-0.9.8/main/suhosin_patch.m4
+--- php-5.3.1/main/suhosin_patch.m4	1970-01-01 01:00:00.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/main/suhosin_patch.m4	2009-11-25 21:07:21.000000000 +0100
 @@ -0,0 +1,8 @@
 +dnl
 +dnl $Id: suhosin_patch.m4,v 1.1 2004/11/14 13:24:24 ionic Exp $
@@ -5172,9 +5255,10 @@ the following modifications have been made:
 +
 +AC_DEFINE(SUHOSIN_PATCH, 1, [Suhosin Patch])
 +
---- pkg-php.orig/sapi/apache/mod_php5.c
-+++ pkg-php/sapi/apache/mod_php5.c
-@@ -967,7 +967,11 @@ static void php_init_handler(server_rec 
+diff -Nura php-5.3.1/sapi/apache/mod_php5.c suhosin-patch-5.3.1-0.9.8/sapi/apache/mod_php5.c
+--- php-5.3.1/sapi/apache/mod_php5.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/sapi/apache/mod_php5.c	2009-11-25 21:07:21.000000000 +0100
+@@ -967,7 +967,11 @@
  	{
  		TSRMLS_FETCH();
  		if (PG(expose_php)) {
@@ -5186,9 +5270,10 @@ the following modifications have been made:
  		}
  	}
  #endif
---- pkg-php.orig/sapi/apache2filter/sapi_apache2.c
-+++ pkg-php/sapi/apache2filter/sapi_apache2.c
-@@ -581,7 +581,11 @@ static void php_apache_add_version(apr_p
+diff -Nura php-5.3.1/sapi/apache2filter/sapi_apache2.c suhosin-patch-5.3.1-0.9.8/sapi/apache2filter/sapi_apache2.c
+--- php-5.3.1/sapi/apache2filter/sapi_apache2.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/sapi/apache2filter/sapi_apache2.c	2009-11-25 21:07:21.000000000 +0100
+@@ -581,7 +581,11 @@
  {
  	TSRMLS_FETCH();
  	if (PG(expose_php)) {
@@ -5200,9 +5285,10 @@ the following modifications have been made:
  	}
  }
  
---- pkg-php.orig/sapi/apache2handler/sapi_apache2.c
-+++ pkg-php/sapi/apache2handler/sapi_apache2.c
-@@ -386,7 +386,11 @@ static void php_apache_add_version(apr_p
+diff -Nura php-5.3.1/sapi/apache2handler/sapi_apache2.c suhosin-patch-5.3.1-0.9.8/sapi/apache2handler/sapi_apache2.c
+--- php-5.3.1/sapi/apache2handler/sapi_apache2.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/sapi/apache2handler/sapi_apache2.c	2009-11-25 21:07:21.000000000 +0100
+@@ -386,7 +386,11 @@
  {
  	TSRMLS_FETCH();
  	if (PG(expose_php)) {
@@ -5214,9 +5300,10 @@ the following modifications have been made:
  	}
  }
  
---- pkg-php.orig/sapi/apache_hooks/mod_php5.c
-+++ pkg-php/sapi/apache_hooks/mod_php5.c
-@@ -1256,7 +1256,11 @@ static void php_init_handler(server_rec 
+diff -Nura php-5.3.1/sapi/apache_hooks/mod_php5.c suhosin-patch-5.3.1-0.9.8/sapi/apache_hooks/mod_php5.c
+--- php-5.3.1/sapi/apache_hooks/mod_php5.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/sapi/apache_hooks/mod_php5.c	2009-11-25 21:07:21.000000000 +0100
+@@ -1256,7 +1256,11 @@
  	{
  		TSRMLS_FETCH();
  		if (PG(expose_php)) {
@@ -5228,9 +5315,10 @@ the following modifications have been made:
  		}
  	}
  #endif
---- pkg-php.orig/sapi/cgi/cgi_main.c
-+++ pkg-php/sapi/cgi/cgi_main.c
-@@ -1907,11 +1907,19 @@ consult the installation file that came 
+diff -Nura php-5.3.1/sapi/cgi/cgi_main.c suhosin-patch-5.3.1-0.9.8/sapi/cgi/cgi_main.c
+--- php-5.3.1/sapi/cgi/cgi_main.c	2009-10-20 14:57:44.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/sapi/cgi/cgi_main.c	2009-11-25 21:07:21.000000000 +0100
+@@ -1921,11 +1921,19 @@
  								SG(headers_sent) = 1;
  								SG(request_info).no_headers = 1;
  							}
@@ -5250,9 +5338,10 @@ the following modifications have been made:
  							php_request_shutdown((void *) 0);
  							exit_status = 0;
  							goto out;
---- pkg-php.orig/sapi/cli/php_cli.c
-+++ pkg-php/sapi/cli/php_cli.c
-@@ -827,7 +827,11 @@ int main(int argc, char *argv[])
+diff -Nura php-5.3.1/sapi/cli/php_cli.c suhosin-patch-5.3.1-0.9.8/sapi/cli/php_cli.c
+--- php-5.3.1/sapi/cli/php_cli.c	2009-09-02 22:02:17.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/sapi/cli/php_cli.c	2009-11-25 21:07:21.000000000 +0100
+@@ -829,7 +829,11 @@
  				}
  
  				request_started = 1;
@@ -5265,9 +5354,10 @@ the following modifications have been made:
  					PHP_VERSION, sapi_module.name, __DATE__, __TIME__,
  #if ZEND_DEBUG && defined(HAVE_GCOV)
  					"(DEBUG GCOV)",
---- pkg-php.orig/sapi/litespeed/lsapi_main.c
-+++ pkg-php/sapi/litespeed/lsapi_main.c
-@@ -545,11 +545,19 @@ static int cli_main( int argc, char * ar
+diff -Nura php-5.3.1/sapi/litespeed/lsapi_main.c suhosin-patch-5.3.1-0.9.8/sapi/litespeed/lsapi_main.c
+--- php-5.3.1/sapi/litespeed/lsapi_main.c	2008-08-27 00:05:17.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/sapi/litespeed/lsapi_main.c	2009-11-25 21:07:21.000000000 +0100
+@@ -545,11 +545,19 @@
  				break;
  			case 'v':
  				if (php_request_startup(TSRMLS_C) != FAILURE) {
@@ -5287,9 +5377,10 @@ the following modifications have been made:
  #ifdef PHP_OUTPUT_NEWAPI
                      php_output_end_all(TSRMLS_C);
  #else
---- pkg-php.orig/sapi/milter/php_milter.c
-+++ pkg-php/sapi/milter/php_milter.c
-@@ -1102,7 +1102,11 @@ int main(int argc, char *argv[])
+diff -Nura php-5.3.1/sapi/milter/php_milter.c suhosin-patch-5.3.1-0.9.8/sapi/milter/php_milter.c
+--- php-5.3.1/sapi/milter/php_milter.c	2008-12-31 12:15:49.000000000 +0100
++++ suhosin-patch-5.3.1-0.9.8/sapi/milter/php_milter.c	2009-11-25 21:07:21.000000000 +0100
+@@ -1102,7 +1102,11 @@
  				}
  				SG(headers_sent) = 1;
  				SG(request_info).no_headers = 1;
@@ -5301,9 +5392,10 @@ the following modifications have been made:
  				php_end_ob_buffers(1 TSRMLS_CC);
  				exit(1);
  				break;
---- pkg-php.orig/win32/build/config.w32
-+++ pkg-php/win32/build/config.w32
-@@ -322,7 +322,7 @@ ADD_SOURCES("Zend", "zend_language_parse
+diff -Nura php-5.3.1/win32/build/config.w32 suhosin-patch-5.3.1-0.9.8/win32/build/config.w32
+--- php-5.3.1/win32/build/config.w32	2009-10-19 21:05:58.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/win32/build/config.w32	2009-11-25 21:07:21.000000000 +0100
+@@ -324,7 +324,7 @@
  	zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \
  	zend_object_handlers.c zend_objects_API.c \
  	zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \
@@ -5312,7 +5404,7 @@ the following modifications have been made:
  
  if (VCVERS == 1200) {
  	AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);
-@@ -377,6 +377,7 @@ if (PHP_ZEND_MULTIBYTE == "yes") {
+@@ -379,6 +379,7 @@
   
  AC_DEFINE('HAVE_USLEEP', 1);
  AC_DEFINE('HAVE_STRCOLL', 1);
@@ -5320,8 +5412,9 @@ the following modifications have been made:
  
  /* For snapshot builders, where can we find the additional
   * files that make up the snapshot template? */
---- pkg-php.orig/win32/build/config.w32.h.in
-+++ pkg-php/win32/build/config.w32.h.in
+diff -Nura php-5.3.1/win32/build/config.w32.h.in suhosin-patch-5.3.1-0.9.8/win32/build/config.w32.h.in
+--- php-5.3.1/win32/build/config.w32.h.in	2009-06-23 08:56:45.000000000 +0200
++++ suhosin-patch-5.3.1-0.9.8/win32/build/config.w32.h.in	2009-11-25 21:07:21.000000000 +0100
 @@ -149,6 +149,9 @@
  /* Win32 supports strcoll */
  #define HAVE_STRCOLL 1
-- 
1.6.3.3





More information about the Pkg-php-commits mailing list