For those who already asked whether we can integrate the Suhosin stuff
of the Hardened-PHP project into our OpenPKG PHP: I'm working on this
but the upstream vendor still has to remove a few remaining obstacles.
The integration is already nasty and complex enough (requires even GNU
autoconf under build-time, etc) and don't want to have another "patch of
a patch" in our "php" and "apache" packages...
----- Forwarded message from "Ralf S. Engelschall" <[EMAIL PROTECTED]> -----
Date: Mon, 13 Nov 2006 09:14:53 +0100
From: "Ralf S. Engelschall" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Suhosin 0.9.11 static building fails under PHP 5.2.0 because of
conflicting rfc1867.h content
Reply-To: [EMAIL PROTECTED]
Organization: Engelschall, Germany.
User-Agent: Mutt/1.5.13 OpenPKG/CURRENT (2006-08-11)
I've today tried to integrate your Suhosin extension into our PHP 5.2.0
based OpenPKG "php" package. Unfortunately the suhosin_rfc1867.h content
conflicts with the standard PHP 5.2.0 rfc1867.h header. There are two
problems:
1. The suhosin_rfc1867.h header uses the same "double-inclusion-prevention"
#define of "RFC1867_H" as rfc1867.h and this way its "#include" for
rfc1867.h is always a no-op. As a result the MULTIPART_EVENT_START is
never #defined and this means HAVE_RFC1867_CALLBACK is defined to 0
and this in turn means that the php_rfc1867_callback becomes defined
multiple times which in turn breaks at least the while building under
static linking.
2. Once the bug (1) is fixed, a new one occurs: not just the
MULTIPART_EVENT_XXXX, but also the various structure definitions
are in conflict with rfc1867.h, so they have to be included in the
#else/#endif clause, too.
With the following patch I was able to build a statically linked
PHP 5.2.0 with both the Suhosin 5.2.0-0.9.6.2 patch and the Suhosin
extension 0.9.11.
Ralf S. Engelschall
[EMAIL PROTECTED]
www.engelschall.com
Index: suhosin_rfc1867.h
--- suhosin_rfc1867.h.orig 2006-09-03 01:20:38 +0200
+++ suhosin_rfc1867.h 2006-11-13 09:08:18 +0100
@@ -18,8 +18,8 @@
/* $Id: suhosin_rfc1867.h,v 1.5 2006-09-02 23:20:38 sesser Exp $ */
-#ifndef RFC1867_H
-#define RFC1867_H
+#ifndef SUHOSIN_RFC1867_H
+#define SUHOSIN_RFC1867_H
#include "rfc1867.h"
#include "SAPI.h"
@@ -37,8 +37,6 @@
#define MULTIPART_EVENT_FILE_END 4
#define MULTIPART_EVENT_END 5
-#endif
-
typedef struct _multipart_event_start {
size_t content_length;
} multipart_event_start;
@@ -75,6 +73,8 @@
size_t post_bytes_processed;
} multipart_event_end;
+#endif
+
SAPI_POST_HANDLER_FUNC(suhosin_rfc1867_post_handler);
void destroy_uploaded_files_hash(TSRMLS_D);
@@ -84,4 +84,4 @@
extern PHPAPI int (*php_rfc1867_callback)(unsigned int event, void
*event_data, void **extra TSRMLS_DC);
#endif
-#endif /* RFC1867_H */
+#endif /* SUHOSIN_RFC1867_H */
----- End forwarded message -----
Ralf S. Engelschall
[EMAIL PROTECTED]
www.engelschall.com
______________________________________________________________________
The OpenPKG Project www.openpkg.org
Developer Communication List [email protected]