Index: Makefile =================================================================== RCS file: /home/pcvs/ports/lang/php5/Makefile,v retrieving revision 1.86 diff -u -r1.86 Makefile --- Makefile 20 Sep 2005 19:46:15 -0000 1.86 +++ Makefile 5 Oct 2005 14:10:23 -0000 @@ -11,10 +11,12 @@ CATEGORIES?= lang devel www MASTER_SITES= ${MASTER_SITE_PHP:S,$,:release,} \ http://downloads.php.net/ilia/:rc \ - http://downloads.php.net/jani/:rc + http://downloads.php.net/jani/:rc \ + http://www.hardened-php.net/:hardening MASTER_SITE_SUBDIR= distributions/:release DISTNAME= php-${PORTVERSION:S/.r/RC/} DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:release +EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER?= ale@FreeBSD.org COMMENT?= PHP Scripting Language (Apache Module and CLI) @@ -78,7 +80,8 @@ .endif OPTIONS+= DEBUG "Enable debug" off \ MULTIBYTE "Enable zend multibyte support" off \ - IPV6 "Enable ipv6 support" on + IPV6 "Enable ipv6 support" on \ + HARDENED_PHP "Use security hardening feature patchset" on EXT_DIR= 20041030 @@ -144,6 +147,14 @@ EXT_DIR:= ${EXT_DIR}-debug .endif +.if defined(WITH_HARDENED_PHP) +HARDENING_PATCH=hardening-patch-5.0.5-0.4.3.patch.gz +DISTFILES+= ${HARDENING_PATCH}:hardening +PLIST_SUB+= HARDENING="" +.else +PLIST_SUB+= HARDENING="@comment " +.endif + .if defined(WITH_MULTIBYTE) CONFIGURE_ARGS+=--enable-zend-multibyte .endif @@ -172,6 +183,11 @@ _PORTSDIR!= ${REALPATH} ${PORTSDIR} PHP_PORT= ${.CURDIR:S|^${_PORTSDIR}||:S|^/||} +.if defined(WITH_HARDENED_PHP) +pre-patch: + @cd ${WRKSRC}; ${GZCAT} ${DISTDIR}/${HARDENING_PATCH} | ${PATCH} -p1 >/dev/null 2>&1 +.endif + post-patch: @${TOUCH} ${WRKSRC}/ext/php_config.h @${REINPLACE_CMD} "s|^\(extension_dir\)|; \1|" ${WRKSRC}/php.ini-* Index: distinfo =================================================================== RCS file: /home/pcvs/ports/lang/php5/distinfo,v retrieving revision 1.18 diff -u -r1.18 distinfo --- distinfo 8 Sep 2005 08:33:31 -0000 1.18 +++ distinfo 5 Oct 2005 14:10:23 -0000 @@ -1,2 +1,4 @@ MD5 (php-5.0.5.tar.bz2) = b5d4ca75bbb11ee5b830fa67213d9f7f SIZE (php-5.0.5.tar.bz2) = 4895556 +MD5 (hardening-patch-5.0.5-0.4.3.patch.gz) = 6af27b59251bb9ce4741b17e2e5358f7 +SIZE (hardening-patch-5.0.5-0.4.3.patch.gz) = 51173 Index: pkg-plist =================================================================== RCS file: /home/pcvs/ports/lang/php5/pkg-plist,v retrieving revision 1.18 diff -u -r1.18 pkg-plist --- pkg-plist 8 Sep 2005 08:33:31 -0000 1.18 +++ pkg-plist 5 Oct 2005 14:10:23 -0000 @@ -131,6 +131,7 @@ include/php/ext/standard/reg.h include/php/ext/standard/scanf.h include/php/ext/standard/sha1.h +%%HARDENING%%include/php/ext/standard/sha256.h include/php/ext/standard/streamsfuncs.h include/php/ext/standard/uniqid.h include/php/ext/standard/url.h @@ -142,6 +143,8 @@ include/php/main/build-defs.h include/php/main/config.w32.h include/php/main/fopen_wrappers.h +%%HARDENING%%include/php/main/hardened_globals.h +%%HARDENING%%include/php/main/hardening_patch.h include/php/main/internal_functions_registry.h include/php/main/logos.h include/php/main/php.h