From 308cdee07aa5efbe6c839e0a7cdc7015fee3078d Mon Sep 17 00:00:00 2001 From: avsm Date: Thu, 10 May 2001 22:58:06 +0000 Subject: [PATCH] Upgrade to PHP-4.0.5 - update MASTER_SITES to account for some wierdness on php.net - all the old patches have been merged into the source tree now - add a minor patch to improve the randomness of php temporary files Upgrade is recommended. Contains a vast array of bugfixes over previous PHP4 releases (read the NEWS file) --- www/php4/Makefile | 11 +- www/php4/files/md5 | 6 +- www/php4/patches/patch-configure | 86 --------------- www/php4/patches/patch-configure_in | 20 ---- www/php4/patches/patch-crypt.c | 16 --- www/php4/patches/patch-ext_imap_php_imap_c | 103 ------------------ www/php4/patches/patch-ext_mcrypt_config_m4 | 25 ----- www/php4/patches/patch-ext_openssl_openssl_c | 77 ------------- www/php4/patches/patch-ext_pgsql_php_pgsql_h | 12 -- .../patch-main_php_open_temporary_file_c | 12 ++ 10 files changed, 20 insertions(+), 348 deletions(-) delete mode 100644 www/php4/patches/patch-configure delete mode 100644 www/php4/patches/patch-configure_in delete mode 100644 www/php4/patches/patch-crypt.c delete mode 100644 www/php4/patches/patch-ext_imap_php_imap_c delete mode 100644 www/php4/patches/patch-ext_mcrypt_config_m4 delete mode 100644 www/php4/patches/patch-ext_openssl_openssl_c delete mode 100644 www/php4/patches/patch-ext_pgsql_php_pgsql_h create mode 100644 www/php4/patches/patch-main_php_open_temporary_file_c diff --git a/www/php4/Makefile b/www/php4/Makefile index 6e24587796f..994d3ef6f34 100644 --- a/www/php4/Makefile +++ b/www/php4/Makefile @@ -1,12 +1,12 @@ -# $OpenBSD: Makefile,v 1.38 2001/05/06 04:22:57 lebel Exp $ +# $OpenBSD: Makefile,v 1.39 2001/05/10 22:58:06 avsm Exp $ COMMENT= "server-side HTML-embedded scripting language" # This port current only works with archs supporting dynamic loading ONLY_FOR_ARCHS= i386 m68k sparc -DISTNAME= php-4.0.4pl1 -PKGNAME= php4-4.0.4pl1 +DISTNAME= php-4.0.5 +PKGNAME= php4-4.0.5 CATEGORIES= www lang NEED_VERSION= 1.402 @@ -14,11 +14,10 @@ MAINTAINER= Anil Madhavapeddy , Jakob Schlyter = 0.9.5) " - ac_help="$ac_help - --enable-sigchild Enable PHP's own SIGCHLD handler." - ac_help="$ac_help -@@ -7578,7 +7578,7 @@ echo "configure:7576: checking for OpenS - #include "confdefs.h" - - #include -- #if OPENSSL_VERSION_NUMBER >= 0x0090600fL -+ #if OPENSSL_VERSION_NUMBER >= 0x0090500fL - yes - #endif - -@@ -7587,12 +7587,12 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>& - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - -- echo "$ac_t"">= 0.9.6" 1>&6 -+ echo "$ac_t"">= 0.9.5" 1>&6 - - else - rm -rf conftest* - -- { echo "configure: error: OpenSSL version 0.9.6 or greater required." 1>&2; exit 1; } -+ { echo "configure: error: OpenSSL version 0.9.5 or greater required." 1>&2; exit 1; } - - fi - rm -f conftest* -@@ -23084,12 +23084,7 @@ fi - - LIBS=$old_LIBS - LDFLAGS="$old_LDFLAGS" -- if test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then -- cat >> confdefs.h <<\EOF --#define HAVE_LIBMCRYPT22 1 --EOF -- -- elif test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then -+ if test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then - - case "ltdl" in - c|c_r|pthread*) ;; -@@ -23106,6 +23101,11 @@ EOF - #define HAVE_LIBMCRYPT24 1 - EOF - -+ elif test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then -+ cat >> confdefs.h <<\EOF -+#define HAVE_LIBMCRYPT22 1 -+EOF -+ - else - { echo "configure: error: Sorry" 1>&2; exit 1; } - fi -@@ -39359,7 +39359,7 @@ echo "configure:39357: checking for Open - #include "confdefs.h" - - #include -- #if OPENSSL_VERSION_NUMBER >= 0x0090600fL -+ #if OPENSSL_VERSION_NUMBER >= 0x0090500fL - yes - #endif - -@@ -39368,12 +39368,12 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>& - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - -- echo "$ac_t"">= 0.9.6" 1>&6 -+ echo "$ac_t"">= 0.9.5" 1>&6 - - else - rm -rf conftest* - -- { echo "configure: error: OpenSSL version 0.9.6 or greater required." 1>&2; exit 1; } -+ { echo "configure: error: OpenSSL version 0.9.5 or greater required." 1>&2; exit 1; } - - fi - rm -f conftest* diff --git a/www/php4/patches/patch-configure_in b/www/php4/patches/patch-configure_in deleted file mode 100644 index ee82153151f..00000000000 --- a/www/php4/patches/patch-configure_in +++ /dev/null @@ -1,20 +0,0 @@ -$OpenBSD: patch-configure_in,v 1.1 2001/01/07 21:08:12 avsm Exp $ ---- configure.in.orig Sun Jan 7 18:36:11 2001 -+++ configure.in Sun Jan 7 18:37:19 2001 -@@ -532,13 +532,13 @@ AC_DEFUN(PHP_SETUP_OPENSSL,[ - AC_MSG_CHECKING(for OpenSSL version) - AC_EGREP_CPP(yes,[ - #include -- #if OPENSSL_VERSION_NUMBER >= 0x0090600fL -+ #if OPENSSL_VERSION_NUMBER >= 0x0090500fL - yes - #endif - ],[ -- AC_MSG_RESULT(>= 0.9.6) -+ AC_MSG_RESULT(>= 0.9.5) - ],[ -- AC_MSG_ERROR(OpenSSL version 0.9.6 or greater required.) -+ AC_MSG_ERROR(OpenSSL version 0.9.5 or greater required.) - ]) - CPPFLAGS=$old_CPPFLAGS - diff --git a/www/php4/patches/patch-crypt.c b/www/php4/patches/patch-crypt.c deleted file mode 100644 index cee11eb0fc8..00000000000 --- a/www/php4/patches/patch-crypt.c +++ /dev/null @@ -1,16 +0,0 @@ -$OpenBSD: patch-crypt.c,v 1.3 2001/01/07 21:08:12 avsm Exp $ - -NOTE: This patch has been added to php-4.0.5-dev and can be -removed in the next release. - ---- ext/standard/crypt.c.orig Mon Nov 27 13:31:21 2000 -+++ ext/standard/crypt.c Sun Jan 7 18:31:47 2001 -@@ -71,7 +71,7 @@ extern char *crypt(char *__key,char *__s - - #if PHP_BLOWFISH_CRYPT - #undef PHP_MAX_SALT_LEN --#define PHP_MAX_SALT_LEN 17 -+#define PHP_MAX_SALT_LEN 60 /* For OpenBSD */ - #endif - - /* diff --git a/www/php4/patches/patch-ext_imap_php_imap_c b/www/php4/patches/patch-ext_imap_php_imap_c deleted file mode 100644 index 97b49add5ab..00000000000 --- a/www/php4/patches/patch-ext_imap_php_imap_c +++ /dev/null @@ -1,103 +0,0 @@ -$OpenBSD: patch-ext_imap_php_imap_c,v 1.3 2001/03/08 22:58:27 avsm Exp $ - -This is a backport from PHP-4.0.5-dev to fix imap-ssl linking -(to simplify the patches, it assumes OpenSSL is present) -and fix a buffer overflow in the username/password handling. -- avsm - ---- ext/imap/php_imap.c.orig Wed Oct 25 17:43:52 2000 -+++ ext/imap/php_imap.c Tue Mar 6 08:47:56 2001 -@@ -71,7 +71,7 @@ void *fs_get(size_t size); - int imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char *rpath); - - --void mail_close_it(zend_rsrc_list_entry *rsrc); -+void mail_close_it (zend_rsrc_list_entry *rsrc); - #ifdef OP_RELOGIN - /* AJS: close persistent connection */ - void mail_userlogout_it(zend_rsrc_list_entry *rsrc); -@@ -183,7 +183,19 @@ extern char imsp_password[80]; - void mail_close_it(zend_rsrc_list_entry *rsrc) - { - pils *imap_le_struct = (pils *)rsrc->ptr; -+ IMAPLS_FETCH(); -+ - mail_close_full(imap_le_struct->imap_stream, imap_le_struct->flags); -+ -+ if (IMAPG(imap_user)) { -+ efree(IMAPG(imap_user)); -+ IMAPG(imap_user) = 0; -+ } -+ if (IMAPG(imap_password)) { -+ efree(IMAPG(imap_password)); -+ IMAPG(imap_password) = 0; -+ } -+ - efree(imap_le_struct); - } - -@@ -411,6 +423,8 @@ PHP_MINIT_FUNCTION(imap) - mail_link(&newsdriver); /* link in the news driver */ - mail_link(&philedriver); /* link in the phile driver */ - auth_link(&auth_log); /* link in the log authenticator */ -+ ssl_onceonlyinit(); -+ auth_link (&auth_ssl); /* link in the ssl authenticator */ - #endif - mail_link(&dummydriver); /* link in the dummy driver */ - #else -@@ -633,6 +647,14 @@ void imap_do_open(INTERNAL_FUNCTION_PARA - } - } - -+ if (IMAPG(imap_user)) { -+ efree(IMAPG(imap_user)); -+ } -+ -+ if (IMAPG(imap_password)) { -+ efree(IMAPG(imap_password)); -+ } -+ - IMAPG(imap_user) = estrndup(Z_STRVAL_PP(user), Z_STRLEN_PP(user)); - IMAPG(imap_password) = estrndup(Z_STRVAL_PP(passwd), Z_STRLEN_PP(passwd)); - -@@ -712,6 +734,8 @@ void imap_do_open(INTERNAL_FUNCTION_PARA - } - } - efree(hashed_details); -+ efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; -+ efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; - RETURN_FALSE; - } - -@@ -721,6 +745,8 @@ void imap_do_open(INTERNAL_FUNCTION_PARA - node = malloc(sizeof(pils)); - if (node == NULL) { - efree(hashed_details); -+ efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; -+ efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; - RETURN_FALSE; - } - -@@ -757,6 +783,8 @@ void imap_do_open(INTERNAL_FUNCTION_PARA - - free(headp); - efree(hashed_details); -+ efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; -+ efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; - RETURN_FALSE; - } - -@@ -766,11 +794,11 @@ void imap_do_open(INTERNAL_FUNCTION_PARA - } else { - #endif - imap_stream = mail_open(NIL, Z_STRVAL_PP(mailbox), flags); -- efree(IMAPG(imap_user)); -- efree(IMAPG(imap_password)); - - if (imap_stream == NIL) { - php_error(E_WARNING, "Couldn't open stream %s\n", (*mailbox)->value.str.val); -+ efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; -+ efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; - RETURN_FALSE; - } - diff --git a/www/php4/patches/patch-ext_mcrypt_config_m4 b/www/php4/patches/patch-ext_mcrypt_config_m4 deleted file mode 100644 index c42aab4e378..00000000000 --- a/www/php4/patches/patch-ext_mcrypt_config_m4 +++ /dev/null @@ -1,25 +0,0 @@ -$OpenBSD: patch-ext_mcrypt_config_m4,v 1.2 2001/01/07 21:08:12 avsm Exp $ ---- ext/mcrypt/config.m4.orig Sat Sep 9 12:24:20 2000 -+++ ext/mcrypt/config.m4 Sun Jan 7 18:31:47 2001 -@@ -1,4 +1,4 @@ --dnl $Id: patch-ext_mcrypt_config_m4,v 1.2 2001/01/07 21:08:12 avsm Exp $ -+dnl $Id: patch-ext_mcrypt_config_m4,v 1.2 2001/01/07 21:08:12 avsm Exp $ - dnl config.m4 for extension mcrypt - dnl don't forget to call PHP_EXTENSION(mcrypt) - -@@ -27,11 +27,11 @@ if test "$PHP_MCRYPT" != "no"; then - AC_CHECK_LIB(mcrypt, mcrypt_module_open, [LIBS="$LIBS -lltdl"],[ ],) - LIBS=$old_LIBS - LDFLAGS="$old_LDFLAGS" -- if test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then -- AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ]) -- elif test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then -+ if test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then - AC_ADD_LIBRARY(ltdl) -- AC_DEFINE(HAVE_LIBMCRYPT24,1,[ ]) -+ AC_DEFINE(HAVE_LIBMCRYPT24,1,[ ]) -+ elif test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then -+ AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ]) - else - AC_MSG_ERROR(Sorry, I was not able to diagnose which libmcrypt version you have installed.) - fi diff --git a/www/php4/patches/patch-ext_openssl_openssl_c b/www/php4/patches/patch-ext_openssl_openssl_c deleted file mode 100644 index 648648bb004..00000000000 --- a/www/php4/patches/patch-ext_openssl_openssl_c +++ /dev/null @@ -1,77 +0,0 @@ -$OpenBSD: patch-ext_openssl_openssl_c,v 1.2 2001/01/11 08:10:41 avsm Exp $ ---- ext/openssl/openssl.c.orig Fri Nov 17 19:49:12 2000 -+++ ext/openssl/openssl.c Sun Jan 7 18:33:35 2001 -@@ -403,6 +403,7 @@ PHP_FUNCTION(openssl_seal) - i++; - } - -+#if OPENSSL_VERSION_NUMBER >= 0x0090600fL - if (!EVP_EncryptInit(&ctx,EVP_rc4(),NULL,NULL)) { - for (i=0; i= 0x0090600fL -+ || !EVP_SealUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data), -+ Z_STRLEN_PP(data)) -+#endif -+ ) { - efree(buf); - for (i=0; i= 0x0090600fL -+ && EVP_OpenUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data), -+ Z_STRLEN_PP(data)) -+#endif -+ ) { -+#if OPENSSL_VERSION_NUMBER < 0x0090600fL -+ EVP_OpenUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data), -+ Z_STRLEN_PP(data)); -+#endif -+ if (!EVP_OpenFinal(&ctx, buf + len1, &len2) || -+ (len1 + len2 == 0)) { -+ efree(buf); -+ RETURN_FALSE; -+ } -+ } else { - efree(buf); - RETURN_FALSE; - } diff --git a/www/php4/patches/patch-ext_pgsql_php_pgsql_h b/www/php4/patches/patch-ext_pgsql_php_pgsql_h deleted file mode 100644 index 6643587514c..00000000000 --- a/www/php4/patches/patch-ext_pgsql_php_pgsql_h +++ /dev/null @@ -1,12 +0,0 @@ -$OpenBSD: patch-ext_pgsql_php_pgsql_h,v 1.1 2001/04/24 19:43:28 naddy Exp $ ---- ext/pgsql/php_pgsql.h.orig Tue Sep 12 22:13:36 2000 -+++ ext/pgsql/php_pgsql.h Tue Apr 24 13:15:55 2001 -@@ -29,7 +29,7 @@ extern zend_module_entry pgsql_module_en - - #ifdef PHP_PGSQL_PRIVATE - #undef SOCKET_SIZE_TYPE --#include -+#include - #include - - #ifdef PHP_WIN32 diff --git a/www/php4/patches/patch-main_php_open_temporary_file_c b/www/php4/patches/patch-main_php_open_temporary_file_c new file mode 100644 index 00000000000..5a5a3681579 --- /dev/null +++ b/www/php4/patches/patch-main_php_open_temporary_file_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-main_php_open_temporary_file_c,v 1.1 2001/05/10 22:58:34 avsm Exp $ +--- main/php_open_temporary_file.c.orig Thu May 10 19:32:30 2001 ++++ main/php_open_temporary_file.c Thu May 10 19:32:44 2001 +@@ -110,7 +110,7 @@ static FILE *php_do_open_temporary_file( + trailing_slash = "/"; + } + +- (void)snprintf(opened_path, MAXPATHLEN, "%s%s%sXXXXXX", path, trailing_slash, pfx); ++ (void)snprintf(opened_path, MAXPATHLEN, "%s%s%sXXXXXXXXXX", path, trailing_slash, pfx); + + #ifdef PHP_WIN32 + if (GetTempFileName(path, pfx, 0, opened_path)) {