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)
This commit is contained in:
avsm 2001-05-10 22:58:06 +00:00
parent 3e1bf4717f
commit 308cdee07a
10 changed files with 20 additions and 348 deletions

View File

@ -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 <avsm@openbsd.org>, Jakob Schlyter <jakob@open
HOMEPAGE= http://www.php.net/
MASTER_SITES= http://www.php.net/distributions/ \
http://us.php.net/distributions/ \
MASTER_SITES= http://www.php.net:8000/ \
http://se.php.net/distributions/ \
http://no.php.net/distributions/ \
http://uk.php.net/distributions/
http://uk.php.net/distributions/
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes

View File

@ -1,3 +1,3 @@
MD5 (php-4.0.4pl1.tar.gz) = ae3ab0105154dddea1fa2ca18a902f85
RMD160 (php-4.0.4pl1.tar.gz) = 9d5dddb9b07c611a4897e6e92113a39e9604cdf7
SHA1 (php-4.0.4pl1.tar.gz) = 15570c0d59277588ff825d4e09ea615205e1b852
MD5 (php-4.0.5.tar.gz) = 763739f64eeac7099035fd86c1d39ad2
RMD160 (php-4.0.5.tar.gz) = dee0c2d6f0c8c0eb4004c0e611e7620db89e3e17
SHA1 (php-4.0.5.tar.gz) = 91819cc92200b2839bfc94d55e0f14e4b0375f68

View File

@ -1,86 +0,0 @@
$OpenBSD: patch-configure,v 1.4 2001/01/07 21:08:11 avsm Exp $
--- configure.orig Wed Dec 20 07:44:27 2000
+++ configure Sun Jan 7 18:38:39 2001
@@ -376,7 +376,7 @@ ac_help="$ac_help
--with-exec-dir[=DIR] Only allow executables in DIR when in safe mode
defaults to /usr/local/php/bin"
ac_help="$ac_help
- --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6) "
+ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 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 <openssl/opensslv.h>
- #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 <openssl/opensslv.h>
- #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*

View File

@ -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 <openssl/opensslv.h>
- #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

View File

@ -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
/*

View File

@ -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;
}

View File

@ -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

View File

@ -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<nkeys; i++) {
efree(eks[i]);
@@ -412,6 +413,9 @@ PHP_FUNCTION(openssl_seal)
efree(pkeys);
RETURN_FALSE;
}
+#else
+ EVP_EncryptInit(&ctx,EVP_rc4(),NULL,NULL);
+#endif
#if 0
/* Need this if allow ciphers that require initialization vector */
@@ -443,9 +447,12 @@ PHP_FUNCTION(openssl_seal)
RETURN_FALSE;
}
- if (!EVP_SealInit(&ctx, EVP_rc4(), eks, eksl, NULL, pkeys, nkeys) ||
- !EVP_SealUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data),
- Z_STRLEN_PP(data))) {
+ if (!EVP_SealInit(&ctx, EVP_rc4(), eks, eksl, NULL, pkeys, nkeys)
+#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
+ || !EVP_SealUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data),
+ Z_STRLEN_PP(data))
+#endif
+ ) {
efree(buf);
for (i=0; i<nkeys; i++) {
efree(eks[i]);
@@ -456,6 +463,9 @@ PHP_FUNCTION(openssl_seal)
RETURN_FALSE;
}
+#if OPENSSL_VERSION_NUMBER < 0x0090600fL
+ EVP_SealUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data), Z_STRLEN_PP(data));
+#endif
EVP_SealFinal(&ctx, buf + len1, &len2);
efree(pkeys);
@@ -536,12 +546,23 @@ PHP_FUNCTION(openssl_open)
RETURN_FALSE;
}
- if (!EVP_OpenInit(&ctx, EVP_rc4(), Z_STRVAL_PP(ekey),
- Z_STRLEN_PP(ekey), NULL, pkey) ||
- !EVP_OpenUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data),
- Z_STRLEN_PP(data)) ||
- !EVP_OpenFinal(&ctx, buf + len1, &len2) ||
- (len1 + len2 == 0)) {
+ if (EVP_OpenInit(&ctx, EVP_rc4(), Z_STRVAL_PP(ekey),
+ Z_STRLEN_PP(ekey), NULL, pkey)
+#if OPENSSL_VERSION_NUMBER >= 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;
}

View File

@ -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 <postgres.h>
+#include <postgres_fe.h>
#include <libpq-fe.h>
#ifdef PHP_WIN32

View File

@ -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)) {