Commit 51cd902a authored by Adam Conrad's avatar Adam Conrad Committed by Mark A. Hershberger

Imported Debian patch 5.0.4-1

parent 0e920280
This diff is collapsed.
This diff is collapsed.
This package was debianized by Gergely Madarasz <gorgo@sztaki.hu> on
Tue, 16 Nov 1999 19:33:42 +0100.
The last maintainer was Petr Cech <cech@debian.org>, who did a LOT of
work on these packages.
The current maintainer is Adam Conrad <adconrad@0c3.net>, who gets a
significant chunk of input and help from Steve Langasek <vorlon@debian.org>
and Andres Salomon <dilinger@debian.org>.
It was downloaded from www.php.net/version5/downloads
Changes: removed ext/dbase dir (non-free)
Upstream Authors: The PHP group for PHP5, Andi Gutmans and Zeev Suraski
for libzend
Two different licences apply to this package, one for PHP5, the other for
libzend. Both licences are shown here below.
LoadModule: php5_module /usr/lib/apache/1.3/libphp5.so
Directives:
php_value
php_flag
php_admin_value
php_admin_flag
Description: Support for the PHP5 HTML-embedded scripting language
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>
/etc/php5/apache
/etc/apache/conf.d
/usr/lib/apache/1.3
#!/bin/sh
set -e
#DEBHELPER#
if [ "$1" != "configure" ]; then
exit 0
fi
phpini="/etc/php5/apache/php.ini"
if ! [ -f $phpini ]; then
mkdir -p /etc/php5/apache
cp /usr/share/php5/php.ini-dist $phpini
fi
if [ -n "$2" ]; then
# we're upgrading. don't ask again
exit 0
fi
for i in apache apache-ssl apache-perl; do
if [ -e /etc/$i/httpd.conf ]; then
apache-modconf $i enable mod_php5
fi
done
exit 0
#! /bin/sh
# postrm script for #PACKAGE#
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
# for details, see /usr/share/doc/packaging-manual/
case "$1" in
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
purge)
rm -rf /etc/php5/apache
if [ -d /etc/php5 ]; then
rmdir --ignore-fail-on-non-empty /etc/php5
fi
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 0
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
#!/bin/sh
set -e
#DEBHELPER#
if [ "$1" != "remove" -a "$1" != "purge" ]; then
exit 0
fi
for i in apache apache-ssl apache-perl; do
if [ -e /etc/$i/httpd.conf ]; then
apache-modconf $i disable mod_php5 quiet
fi
done
exit 0
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>
/etc/apache2/mods-available
/etc/php5/apache2
/usr/lib/apache2/modules
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
#!/bin/sh
set -e
#DEBHELPER#
if [ "$1" != "configure" ]; then
exit 0
fi
phpini="/etc/php5/apache2/php.ini"
if ! [ -f $phpini ]; then
mkdir -p /etc/php5/apache2
cp /usr/share/php5/php.ini-dist $phpini
fi
reload_apache()
{
if apache2ctl configtest 2>/dev/null; then
invoke-rc.d apache2 force-reload || true
else
echo "Your apache2 configuration is broken, so we're not restarting it for you."
fi
}
if [ -n "$2" ]; then
# we're upgrading. test if we're enabled, and if so, restart to reload the module.
if [ -e /etc/apache2/mods-enabled/php5.load ]; then
reload_apache
fi
exit 0
fi
if [ -e /etc/apache2/apache2.conf ]; then
# Enable the module, but hide a2enmod's misleading message about apachectl
# and force-reload the thing ourselves.
a2enmod php5 >/dev/null || true
reload_apache
fi
exit 0
#! /bin/sh
# postrm script for #PACKAGE#
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
# for details, see /usr/share/doc/packaging-manual/
case "$1" in
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
purge)
rm -rf /etc/php5/apache2
if [ -d /etc/php5 ]; then
rmdir --ignore-fail-on-non-empty /etc/php5
fi
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 0
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
#!/bin/sh
set -e
#DEBHELPER#
if [ "$1" != "remove" -a "$1" != "purge" ]; then
exit 0
fi
if [ -e /etc/apache2/apache2.conf ]; then
a2dismod php5 || true
fi
exit 0
#!/bin/sh -e
max=1440
for ini in /etc/php5/*/php.ini; do
cur=$(sed -n -e 's/^[[:space:]]*session.gc_maxlifetime[[:space:]]*=[[:space:]]*\([0-9]\+\).*$/\1/p' $ini 2>/dev/null || true);
[ -z "$cur" ] && cur=0
[ "$cur" -gt "$max" ] && max=$cur
done
echo $(($max/60))
exit 0
curl CURL
gd GD
ldap LDAP
mhash MHASH
mysql MySQL
odbc ODBC
pgsql PostgreSQL
recode recode
snmp SNMP
sqlite SQLite
sybase Sybase sybase_ct
xmlrpc XML-RPC
xsl XSL
diff -urN php4-4.3.4.orig/TSRM/configure.in php4-4.3.4/TSRM/configure.in
--- php4-4.3.4.orig/TSRM/configure.in 2001-08-08 06:26:21.000000000 -0400
+++ php4-4.3.4/TSRM/configure.in 2004-02-16 00:57:50.000000000 -0500
@@ -13,9 +13,6 @@
TSRM_THREADS_CHECKS
AM_PROG_LIBTOOL
-if test "$enable_debug" != "yes"; then
- AM_SET_LIBTOOL_VARIABLE([--silent])
-fi
dnl TSRM_PTHREAD
diff -urN php4-4.3.4.orig/acinclude.m4 php4-4.3.4/acinclude.m4
--- php4-4.3.4.orig/acinclude.m4 2003-10-03 00:29:24.000000000 -0400
+++ php4-4.3.4/acinclude.m4 2004-02-16 00:59:06.000000000 -0500
@@ -779,13 +779,13 @@
dnl
AC_DEFUN([PHP_BUILD_PROGRAM],[
OVERALL_TARGET=[]ifelse($1,,php,$1)
- php_c_pre='$(CC)'
+ php_c_pre='$(LIBTOOL) --mode=compile $(CC)'
php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
- php_c_post=' && echo > $[@]'
- php_cxx_pre='$(CXX)'
+ php_c_post=
+ php_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
- php_cxx_post=' && echo > $[@]'
- php_lo=o
+ php_cxx_post=
+ php_lo=lo
case $with_pic in
yes) pic_setting='-prefer-pic';;
diff -urN php4-4.3.4.orig/configure.in php4-4.3.4/configure.in
--- php4-4.3.4.orig/configure.in 2003-11-02 17:15:05.000000000 -0500
+++ php4-4.3.4/configure.in 2004-02-16 01:00:52.000000000 -0500
@@ -1216,9 +1216,6 @@
LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
AC_PROG_LIBTOOL
-if test "$enable_debug" != "yes"; then
- PHP_SET_LIBTOOL_VARIABLE([--silent])
-fi
dnl libtool 1.4.3 needs this.
PHP_SET_LIBTOOL_VARIABLE([--preserve-dup-deps])
diff -urN php4-4.3.4.orig/acinclude.m4 php4-4.3.4/acinclude.m4
--- php4-4.3.4.orig/acinclude.m4 2004-02-16 01:01:22.000000000 -0500
+++ php4-4.3.4/acinclude.m4 2004-02-16 01:03:12.000000000 -0500
@@ -1751,9 +1751,7 @@
PHP_ADD_INCLUDE($OPENSSL_INCDIR)
- PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
- PHP_ADD_LIBRARY(crypto,,$1)
- ],[
+ PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [:],[
AC_MSG_ERROR([libcrypto not found!])
],[
-L$OPENSSL_LIBDIR
--- php4-4.3.4.orig/ext/ldap/ldap.c
+++ php4-4.3.4/ext/ldap/ldap.c
@@ -1255,7 +1255,7 @@
}
i=0;
- while (ldap_value[i] != NULL) i++;
+ while (ldap_value && ldap_value[i] != NULL) i++;
count = i;
array_init(return_value);
@@ -1265,7 +1265,8 @@
add_index_string(return_value, i, ldap_value[i], 1);
}
- ldap_value_free(ldap_value);
+ if (ldap_value)
+ ldap_value_free(ldap_value);
}
/* }}} */
This diff is collapsed.
--- php4-4.3.4.orig/ext/snmp/snmp.c
+++ php4-4.3.4/ext/snmp/snmp.c
@@ -352,9 +352,9 @@
struct snmp_pdu *pdu=NULL, *response;
struct variable_list *vars;
oid name[MAX_NAME_LEN];
- int name_length;
+ size_t name_length;
oid root[MAX_NAME_LEN];
- int rootlen = 0;
+ size_t rootlen = 0;
int gotroot = 0;
int status, count;
char buf[2048];
--- php4-4.3.10/configure.in 2004-12-15 17:00:57.000000000 -0700
+++ php4-4.3.10/configure.in 2004-12-15 17:03:30.000000000 -0700
@@ -570,50 +570,50 @@
dnl Check for getaddrinfo, should be a better way, but...
dnl Also check for working getaddrinfo
-AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
-[AC_TRY_LINK([#include <netdb.h>],
- [struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);],
- AC_TRY_RUN([
-#include <netdb.h>
-#include <sys/types.h>
-#ifndef AF_INET
-# include <sys/socket.h>
-#endif
-int main(void) {
- struct addrinfo *ai, *pai, hints;
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_flags = AI_NUMERICHOST;
-
- if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
- exit(1);
- }
-
- if (ai == 0) {
- exit(1);
- }
-
- pai = ai;
-
- while (pai) {
- if (pai->ai_family != AF_INET) {
- /* 127.0.0.1/NUMERICHOST should only resolve ONE way */
- exit(1);
- }
- if (pai->ai_addr->sa_family != AF_INET) {
- /* 127.0.0.1/NUMERICHOST should only resolve ONE way */
- exit(1);
- }
- pai = pai->ai_next;
- }
- freeaddrinfo(ai);
- exit(0);
-}
- ],ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no),
-ac_cv_func_getaddrinfo=no)])
-if test "$ac_cv_func_getaddrinfo" = yes; then
+dnl AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
+dnl [AC_TRY_LINK([#include <netdb.h>],
+dnl [struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);],
+dnl AC_TRY_RUN([
+dnl #include <netdb.h>
+dnl #include <sys/types.h>
+dnl #ifndef AF_INET
+dnl # include <sys/socket.h>
+dnl #endif
+dnl int main(void) {
+dnl struct addrinfo *ai, *pai, hints;
+dnl
+dnl memset(&hints, 0, sizeof(hints));
+dnl hints.ai_flags = AI_NUMERICHOST;
+dnl
+dnl if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
+dnl exit(1);
+dnl }
+dnl
+dnl if (ai == 0) {
+dnl exit(1);
+dnl }
+dnl
+dnl pai = ai;
+dnl
+dnl while (pai) {
+dnl if (pai->ai_family != AF_INET) {
+dnl /* 127.0.0.1/NUMERICHOST should only resolve ONE way */
+dnl exit(1);
+dnl }
+dnl if (pai->ai_addr->sa_family != AF_INET) {
+dnl /* 127.0.0.1/NUMERICHOST should only resolve ONE way */
+dnl exit(1);
+dnl }
+dnl pai = pai->ai_next;
+dnl }
+dnl freeaddrinfo(ai);
+dnl exit(0);
+dnl }
+dnl ],ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no),
+dnl ac_cv_func_getaddrinfo=no)])
+dnl if test "$ac_cv_func_getaddrinfo" = yes; then
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
-fi
+dnl fi
AC_REPLACE_FUNCS(strlcat strlcpy getopt)
AC_FUNC_UTIME_NULL
--- php4-4.3.8/acinclude.m4.orig 2004-08-09 07:41:27.000000000 -0600
+++ php4-4.3.8/acinclude.m4 2004-08-09 07:42:19.000000000 -0600
@@ -347,7 +347,7 @@
}
],[
- ac_cv_pwrite=yes
+ ac_cv_pwrite=no
],[
ac_cv_pwrite=no
],[
@@ -374,7 +374,7 @@
exit(0);
}
],[
- ac_cv_pread=yes
+ ac_cv_pread=no
],[
ac_cv_pread=no
],[
This diff is collapsed.
--- php4-4.3.9/ext/readline/config.m4 2003-09-30 20:54:04.000000000 -0600
+++ php4-4.3.9/ext/readline/config.m4 2004-10-04 21:40:38.000000000 -0600
@@ -10,7 +10,7 @@
if test "$PHP_READLINE" != "no"; then
for i in $PHP_READLINE /usr/local /usr; do
- test -f $i/include/readline/readline.h && READLINE_DIR=$i && break
+ test -f $i/include/editline/readline.h && READLINE_DIR=$i && break
done
if test -z "$READLINE_DIR"; then
@@ -54,7 +54,7 @@
elif test "$PHP_LIBEDIT" != "no"; then
for i in $PHP_LIBEDIT /usr/local /usr; do
- test -f $i/include/readline/readline.h && LIBEDIT_DIR=$i && break
+ test -f $i/include/editline/readline.h && LIBEDIT_DIR=$i && break
done
if test -z "$LIBEDIT_DIR"; then
--- php4-4.3.9/ext/readline/readline.c 2002-12-31 09:35:15.000000000 -0700
+++ php4-4.3.9/ext/readline/readline.c 2004-10-04 21:42:15.000000000 -0600
@@ -29,9 +29,9 @@
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
-#include <readline/readline.h>
+#include <editline/readline.h>
#ifndef HAVE_LIBEDIT
-#include <readline/history.h>
+#include <editline/history.h>
#endif
PHP_FUNCTION(readline);
This diff is collapsed.
--- php4-4.3.10/build/build2.mk.orig 2005-02-06 00:49:53.000000000 -0700
+++ php4-4.3.10/build/build2.mk 2005-02-06 00:51:58.000000000 -0700
@@ -52,6 +52,11 @@
aclocal.m4: configure.in acinclude.m4
@echo rebuilding $@
+ @libtoolize=`./build/shtool path glibtoolize libtoolize`; \
+ $$libtoolize --copy --automake --force; \
+ ltpath=`dirname $$libtoolize`; \
+ ltfile=`cd $$ltpath/../share/aclocal; pwd`/libtool.m4; \
+ cp $$ltfile ./build/libtool.m4
cat acinclude.m4 ./build/libtool.m4 > $@
configure: aclocal.m4 configure.in $(config_m4_files)
Save and restore umask across requests correctly.
--- php-4.3.10/sapi/apache2handler/sapi_apache2.c.umask
+++ php-4.3.10/sapi/apache2handler/sapi_apache2.c
@@ -402,6 +402,19 @@
return APR_SUCCESS;
}
+static int saved_umask;
+
+static void php_save_umask(void)
+{
+ saved_umask = umask(077);
+ umask(saved_umask);
+}
+
+static void php_restore_umask(void)
+{
+ umask(saved_umask);
+}
+
static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
{
char *content_type;
@@ -546,6 +559,8 @@
} else {
zend_file_handle zfd;
+ php_save_umask();
+
zfd.type = ZEND_HANDLE_FILENAME;
zfd.filename = (char *) r->filename;
zfd.free_filename = 0;
@@ -556,6 +571,9 @@
} else {
zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &zfd);
}
+
+ php_restore_umask();
+
#if MEMORY_LIMIT
{
char *mem_usage;
diff -urN php-5.0.4.orig/ext/sockets/sockets.c php-5.0.4/ext/sockets/sockets.c
--- php-5.0.4.orig/ext/sockets/sockets.c 2005-02-15 00:44:31.000000000 +0100
+++ php-5.0.4/ext/sockets/sockets.c 2005-04-10 17:32:15.851738072 +0200
@@ -531,6 +531,7 @@
php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
+ if (php_sock->bsd_socket > FD_SETSIZE) continue; /* must ignore it */
PHP_SAFE_FD_SET(php_sock->bsd_socket, fds);
if (php_sock->bsd_socket > *max_fd) {
diff -urN php-5.0.4.orig/ext/standard/streamsfuncs.c php-5.0.4/ext/standard/streamsfuncs.c
--- php-5.0.4.orig/ext/standard/streamsfuncs.c 2005-01-15 05:51:03.000000000 +0100
+++ php-5.0.4/ext/standard/streamsfuncs.c 2005-04-10 17:34:29.274454736 +0200
@@ -546,6 +546,9 @@
* is not displayed.
* */
if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) {
+ if (this_fd > FD_SETSIZE)
+ continue;
+
PHP_SAFE_FD_SET(this_fd, fds);
Index: ext/standard/config.m4
===================================================================
RCS file: /repository/php-src/ext/standard/config.m4,v
retrieving revision 1.47.2.14
diff -u -r1.47.2.14 config.m4
--- 4.3/ext/standard/config.m4 10 May 2004 07:25:11 -0000 1.47.2.14
+++ 4.3/ext/standard/config.m4 19 Aug 2004 13:55:54 -0000
@@ -259,8 +259,11 @@
AC_MSG_CHECKING([whether rounding works as expected])
AC_TRY_RUN([
#include <math.h>
+ double my_floor(double n) {
+ return floor(n*pow(10,2) + 0.5);
+ }
int main() {
- return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5;
+ return my_floor(0.045)/10.0 != 0.5;
}
],[
PHP_ROUND_FUZZ=0.5
--- php4-4.3.10/ext/snmp/snmp.c 2005-03-23 00:32:06.000000000 -0700
+++ php4-4.3.10/ext/snmp/snmp.c 2005-03-23 00:30:18.000000000 -0700
@@ -215,7 +215,9 @@
*/
PHP_MSHUTDOWN_FUNCTION(snmp)
{
+/*** This should be re-enabled when I have a newer libsnmp to play with ***
snmp_shutdown("snmpapp");
+**************************************************************************/
return SUCCESS;
}
--- php-5.0.4/ext/recode/recode.c 2005-07-13 14:43:06.000000000 +1000
+++ php-5.0.4/ext/recode/recode.c 2005-07-13 14:43:45.000000000 +1000
@@ -130,8 +130,8 @@
RECODE_REQUEST request = NULL;
char *r = NULL;
bool success;
- int r_len = 0, r_alen = 0;
- int req_len, str_len;
+ size_t r_len = 0, r_alen = 0;
+ size_t req_len, str_len;
char *req, *str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &req, &req_len, &str, &str_len) == FAILURE) {
--- php4-4.3.10/Zend/zend_strtod.c 2005-02-14 17:17:51.000000000 -0700
+++ php4-4.3.10/Zend/zend_strtod.c 2005-02-14 17:18:31.000000000 -0700
@@ -123,13 +123,25 @@
#define IEEE_LITTLE_ENDIAN
#endif
-#if defined(__arm__) && !defined(__VFP_FP__)
-/*
- * Although the CPU is little endian the FP has different
- * byte and word endianness. The byte order is still little endian
- * but the word order is big endian.
- */
-#define IEEE_BIG_ENDIAN
+#if defined(__arm__) || defined(__thumb__)
+/* ARM traditionally used big-endian words; and within those words the
+ byte ordering was big or little endian depending upon the target.
+ Modern floating-point formats are naturally ordered; in this case
+ __VFP_FP__ will be defined, even if soft-float. */
+#undef IEEE_LITTLE_ENDIAN
+#undef IEEE_BIG_ENDIAN
+#if defined(__VFP_FP__) || defined(__MAVERICK__)
+# ifdef __ARMEL__
+# define IEEE_LITTLE_ENDIAN
+# else
+# define IEEE_BIG_ENDIAN
+# endif
+#else
+# define IEEE_BIG_ENDIAN
+# ifdef __ARMEL__
+# define IEEE_BYTES_LITTLE_ENDIAN
+# endif
+#endif
#endif
#ifdef __vax__
@@ -237,8 +245,7 @@
#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \
defined(IBM) != 1
-Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or
-IBM should be defined.
+#error "Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or IBM should be defined."
#endif
typedef union {
@@ -258,7 +265,7 @@
* An alternative that might be better on some machines is
* #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
*/
-#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm__)
+#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(IEEE_BYTES_LITTLE_ENDIAN)
#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
((unsigned short *)a)[0] = (unsigned short)c, a++)