debian/ 0000775 0000000 0000000 00000000000 13457376511 007204 5 ustar debian/php-pear.dirs 0000664 0000000 0000000 00000000072 12300436054 011563 0 ustar /usr/share/doc/php-pear/PEAR
/usr/share/lintian/overrides
debian/README.Debian.security 0000664 0000000 0000000 00000002116 12300436054 013074 0 ustar The Debian stable security team does not provide security support for
certain configurations known to be inherently insecure. This includes
the interpreter itself, extensions, and user scripts written in the PHP
language. Most specifically, but not exclusively, the security team will
not provide support for the following.
* Security issues which are caused by careless programming, such as:
- extracting a tar file without first checking the contents;
- using unserialize() on untrusted data;
- relying on a specific value of short_open_tag.
* Vulnerabilities involving any kind of open_basedir violation, as
this feature is not considered a security model either by us or by
PHP upstream.
* Any "works as expected" vulnerabilities, such as "user can cause
PHP to crash by writing a malicious PHP script", unless such
vulnerabilities involve some kind of higher-level DoS or privilege
escalation that would not otherwise be available.
PHP upstream has published a statement regarding their view on security
and the PHP interpreter:
http://www.php.net/security-note.php
debian/php5-fpm.logrotate 0000664 0000000 0000000 00000000230 12506505025 012541 0 ustar /var/log/php5-fpm.log {
rotate 12
weekly
missingok
notifempty
compress
delaycompress
postrotate
/usr/lib/php5/php5-fpm-reopenlogs
endscript
}
debian/php5-common.docs 0000664 0000000 0000000 00000000224 12300436054 012177 0 ustar CREDITS
EXTENSIONS
CODING_STANDARDS
README.EXT_SKEL
README.SELF-CONTAINED-EXTENSIONS
README.PHP4-TO-PHP5-THIN-CHANGES
debian/README.Debian.security
debian/php5-mysqlnd.preinst.extra 0000664 0000000 0000000 00000000176 12300436054 014262 0 ustar dpkg-maintscript-helper mv_conffile /etc/php5/conf.d/10-mysqlnd.ini /etc/php5/mods-available/mysqlnd.ini 5.4.0~rc6-1 -- "$@";
debian/php5-module.bug.script 0000775 0000000 0000000 00000001030 12300436054 013323 0 ustar #!/bin/sh
MATCH="^[[:space:]]*($|;)"
echo "==== Additional PHP 5 information ====" >&3
echo "" >&3
echo "++++ PHP 5 SAPI (php5query -S): ++++" >&3
/usr/sbin/php5query -S >&3
echo "" >&3
echo "++++ PHP 5 Extensions (php5query -M -v): ++++" >&3
/usr/sbin/php5query -M -v >&3
echo "" >&3
echo "++++ Configuration files: ++++" >&3
for dsoname in @modules@; do
inifile=${dsoname}.ini
echo "**** /etc/php5/mods-available/$dsoname.ini ****" >&3
grep -Ev "$MATCH" "/etc/php5/mods-available/$dsoname.ini" >&3
echo "" >&3
done
debian/extramodulelist 0000664 0000000 0000000 00000000440 12300436054 012333 0 ustar common ZendOpcache opcache 05 zend_extension
mysql MySQL mysqli
mysql MySQL pdo_mysql
mysqlnd MySQL mysql
mysqlnd MySQL mysqli
mysqlnd MySQL pdo_mysql
interbase InterBase/Firebird pdo_firebird
odbc ODBC pdo_odbc
pgsql PostgreSQL pdo_pgsql
sqlite SQLite pdo_sqlite
sybase Sybase pdo_dblib
debian/php5filter.conf 0000664 0000000 0000000 00000000360 12300436054 012115 0 ustar
SetInputFilter PHP
SetOutputFilter PHP
# Deny access to files without filename (e.g. '.php')
Order Deny,Allow
Deny from all
debian/rules 0000775 0000000 0000000 00000102777 12506505025 010266 0 ustar #!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
# Set this flag to 'yes' if you want to disable all modifications breaking abi
# compatibility to upstream
PHP5_COMPAT=no
# enable dpkg build flags
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_HOST_MULTIARCH
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
PHP5_SOURCE_VERSION = $(shell dpkg-parsechangelog | grep ^Version | sed "s/Version: //")
PHP5_UPSTREAM_VERSION = $(shell echo $(PHP5_SOURCE_VERSION) | sed -e "s/-.*//" -e "s/.*://")
PHP5_DEBIAN_REVISION = $(shell echo $(PHP5_SOURCE_VERSION) | sed "s/.*-//")
RUN_TESTS = yes
ifeq (nocheck,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
$(warning Disabling checks due DEB_BUILD_OPTIONS)
RUN_TESTS = no
endif
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),hurd-i386 mips mipsel))
$(warning Disabling checks on $(DEB_HOST_ARCH))
RUN_TESTS = no
endif
ifeq (yes,$(RUN_TESTS))
MYSQL_PORT := $(shell for i in $$(seq 1025 3600 | sort -R); do nc -z localhost $$i || { echo $$i; exit; } ; done)
MYSQL_DATA_DIR ?= $(shell readlink -f mysql_db)
ifeq (,$(MYSQL_PORT))
$(error Could not find available port for mysql server)
endif
MYSQL_SOCKET = $(MYSQL_DATA_DIR)/mysql.sock
endif
ifeq (linux,$(DEB_HOST_ARCH_OS))
CONFIGURE_SYSTEMD = --with-fpm-systemd
else
CONFIGURE_SYSTEMD = --without-fpm-systemd
endif
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),amd64 armel armhf i386 ia64 powerpc))
CONFIGURE_DTRACE_ARGS = --enable-dtrace
else
CONFIGURE_DTRACE_ARGS = --disable-dtrace
endif
# specify some options to our patch system
QUILT_DIFF_OPTS=-p
QUILT_NO_DIFF_TIMESTAMPS=1
export QUILT_DIFF_OPTS QUILT_NO_DIFF_TIMESTAMPS
PROG_SENDMAIL = /usr/sbin/sendmail
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O2
else
CFLAGS += -O0
endif
CFLAGS += -Wall -fsigned-char -fno-strict-aliasing
# LFS support
ifneq (yes,$(PHP5_COMPAT))
CFLAGS += $(shell getconf LFS_CFLAGS)
endif
# Enable IEEE-conformant floating point math on alphas (not the default)
ifeq (alpha-linux-gnu,$(DEB_HOST_GNU_TYPE))
CFLAGS += -mieee
endif
# Enable producing of debugging information
CFLAGS += -g
# some other helpful (for readability at least) shorthand variables
PHPIZE_BUILDDIR = debian/php5-dev/usr/lib/php5/build
# support new (>= 2.2) and older versions of libtool for backporting ease
LIBTOOL_DIRS = /usr/share/libtool/config /usr/share/libtool
LTMAIN = $(firstword $(wildcard $(foreach d,$(LIBTOOL_DIRS),$d/ltmain.sh)))
LTMAIN_DIR = $(dir $(LTMAIN))
ifeq ($(LTMAIN_DIR), /usr/share/libtool/)
LIBTOOL_CONFLICTS:=libtool (>= 2.2)
else ifeq ($(LTMAIN_DIR), /usr/share/libtool/config/)
LIBTOOL_CONFLICTS:=libtool (<< 2.2)
else
LIBTOOL_CONFLICTS:=$(error "could not resolve path to ltmain.sh")
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
COMMON_CONFIG=--build=$(DEB_BUILD_GNU_TYPE) \
--host=$(DEB_HOST_GNU_TYPE) \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--disable-debug \
--with-regex=php \
--disable-rpath \
--disable-static \
--with-pic \
--with-layout=GNU \
--with-pear=/usr/share/php \
--enable-calendar \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-bcmath \
--with-bz2 \
--enable-ctype \
--with-db4 \
--without-gdbm \
--with-iconv \
--enable-exif \
--enable-ftp \
--with-gettext \
--enable-mbstring \
--with-pcre-regex=/usr \
--enable-shmop \
--enable-sockets \
--enable-wddx \
--with-libxml-dir=/usr \
--with-zlib \
--with-kerberos=/usr \
--with-openssl=/usr \
--enable-soap \
--enable-zip \
--with-mhash=yes \
--with-system-tzdata \
--with-mysql-sock=/var/run/mysqld/mysqld.sock \
$(CONFIGURE_DTRACE_ARGS)
BUILTIN_EXTENSION_CHECK=$$e=get_loaded_extensions(); natcasesort($$e); \
$$s="The following extensions are built in:"; \
foreach($$e as $$i) { $$s .= " $$i"; } \
echo("php:Extensions=" . wordwrap($$s . ".\n", 75, "\$${Newline}"));
prepared: prepared-stamp
prepared-stamp:
dh_testdir
sed -i -e 's/EXTRA_VERSION=""/EXTRA_VERSION="-$(PHP5_DEBIAN_REVISION)"/' configure.in
./buildconf --force
touch prepared-stamp
unprepared:
dh_testdir
sed -i -e 's/EXTRA_VERSION="-$(PHP5_DEBIAN_REVISION)"/EXTRA_VERSION=""/' configure.in
rm -f prepared-stamp
test-results.txt: build-apache2-stamp build-cli-stamp build-cgi-stamp
ifeq (yes,$(RUN_TESTS))
mkdir -p temp_session_store
# start our own mysql server for the tests
$(SHELL) -x debian/setup-mysql.sh $(MYSQL_PORT) $(MYSQL_DATA_DIR)
extensions=""; \
for f in $(CURDIR)/apache2-build/modules/*.so; do \
ext=`basename "$$f"`; \
test -d "$(CURDIR)/ext/$${ext%.so}/tests" || continue; \
test "$$ext" != "imap.so" || continue; \
test "$$ext" != "interbase.so" || continue; \
test "$$ext" != "ldap.so" || continue; \
test "$$ext" != "odbc.so" || continue; \
test "$$ext" != "pgsql.so" || continue; \
test "$$ext" != "pdo_dblib.so" || continue; \
test "$$ext" != "pdo_firebird.so" || continue; \
test "$$ext" != "pdo_odbc.so" || continue; \
test "$$ext" != "pdo_pgsql.so" || continue; \
test "$$ext" != "snmp.so" || continue; \
test "$$ext" != "opcache.so" || continue; \
extensions="$$extensions -d extension=$$ext"; \
done; \
[ "$$extensions" ] || { echo "extensions list is empty"; exit 1; }; \
env MYSQL_TEST_HOST=127.0.0.1 MYSQL_TEST_PORT=$(MYSQL_PORT) MYSQL_TEST_SOCKET=$(MYSQL_SOCKET) PDO_MYSQL_TEST_HOST=127.0.0.1 PDO_MYSQL_TEST_PORT=$(MYSQL_PORT) PDO_MYSQL_TEST_SOCKET=$(MYSQL_SOCKET) NO_INTERACTION=1 TEST_PHP_CGI_EXECUTABLE=$(CURDIR)/cgi-build/sapi/cgi/cgi-bin.php5 TEST_PHP_EXECUTABLE=$(CURDIR)/cli-build/sapi/cli/php \
$(CURDIR)/cli-build/sapi/cli/php run-tests.php -n -d mysql.default_host=127.0.0.1 -d mysql.default_socket=$(MYSQL_SOCKET) -d mysqli.default_socket=$(MYSQL_SOCKET) -d extension_dir=$(CURDIR)/apache2-build/modules/ $$extensions| tee test-results.txt
rm -rf temp_session_store
@for test in `find . -name '*.log' -a '!' -name 'config.log' -a '!' -name 'bootstrap.log' -a '!' -name 'run.log'`; do \
echo; \
echo -n "$${test#./}:"; \
cat $$test; \
echo; \
done | tee -a test-results.txt
$(SHELL) -x debian/setup-mysql.sh $(MYSQL_PORT) $(MYSQL_DATA_DIR) stop
else
echo 'nocheck found in DEB_BUILD_OPTIONS or unsupported architecture' | tee test-results.txt
endif
build: build-apache2-stamp build-apache2filter-stamp build-cgi-stamp build-cli-stamp build-embed-stamp build-fpm-stamp build-pear-stamp test-results.txt
build-apache2-stamp: configure-apache2-stamp
dh_testdir
cd apache2-build && $(MAKE)
touch build-apache2-stamp
build-apache2filter-stamp: configure-apache2filter-stamp
dh_testdir
cd apache2filter-build && $(MAKE)
touch build-apache2filter-stamp
build-cli-stamp: configure-cli-stamp
dh_testdir
cd cli-build && $(MAKE)
touch build-cli-stamp
build-embed-stamp: configure-embed-stamp
dh_testdir
cd embed-build && $(MAKE)
touch build-embed-stamp
build-fpm-stamp: configure-fpm-stamp
dh_testdir
cd fpm-build && $(MAKE)
touch build-fpm-stamp
build-cgi-stamp: configure-cgi-stamp
dh_testdir
cd cgi-build && $(MAKE) && mv sapi/cgi/php-cgi sapi/cgi/cgi-bin.php5
# Dirty hack to not rebuild everything twice
cd cgi-build/main && \
sed -i -e 's/FORCE_CGI_REDIRECT 1/FORCE_CGI_REDIRECT 0/' \
-e 's/DISCARD_PATH 0/DISCARD_PATH 1/' php_config.h && \
sed -i -e 's/--enable-force-cgi-redirect/--enable-discard-path/' build-defs.h && \
touch ../../ext/standard/info.c && \
touch ../../sapi/cgi/cgi_main.c
cd cgi-build && $(MAKE) && mv sapi/cgi/php-cgi sapi/cgi/usr.bin.php5-cgi
touch build-cgi-stamp
build-pear-stamp: build-cgi-stamp
dh_testdir
-mkdir pear-build
-mkdir pear-build-download
cd cgi-build && PHP_PEAR_DOWNLOAD_DIR=$(CURDIR)/pear-build-download $(MAKE) install-pear PHP_PEAR_PHP_BIN=/usr/bin/php PHP_PEAR_INSTALL_DIR=/usr/share/php PHP_PEAR_SYSCONF_DIR=/etc/pear PHP_PEAR_SIG_BIN=/usr/bin/gpg INSTALL_ROOT=$(CURDIR)/pear-build
sed -i -e 's/-d output_buffering=1 -d open_basedir="" -d safe_mode=0/-d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d memory_limit="-1"/' \
$(CURDIR)/pear-build/usr/bin/pear && \
sed -i -e 's/-d output_buffering=1 -d safe_mode=0/-d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d memory_limit="-1"/' \
$(CURDIR)/pear-build/usr/bin/pecl && \
sed -i -e 's/-d memory_limit="-1"//' \
-e 's/-d output_buffering=1 -d open_basedir="" -d safe_mode=0/-d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d memory_limit="-1"/' \
$(CURDIR)/pear-build/usr/bin/peardev
sed -i -re "s#('PEAR_CONFIG_SYSCONFDIR', PHP_SYSCONFDIR)#\1 . '/pear'#" $(CURDIR)/pear-build/usr/share/php/PEAR/Config.php
patch -s -d $(CURDIR)/pear-build/usr/share/php/ -p1 -i $(CURDIR)/debian/patches/PEAR-Builder-print-info-about-php5-dev.patch
touch build-pear-stamp
configure: configure-apache2-stamp configure-apache2filter-stamp configure-cli-stamp configure-embed-stamp configure-fpm-stamp configure-cgi-stamp
configure-apache2-stamp: prepared-stamp
dh_testdir
if [ -d apache2-build ]; then rm -rf apache2-build; fi
-mkdir apache2-build
cd apache2-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --with-apxs2=/usr/bin/apxs2 \
--with-config-file-path=/etc/php5/apache2 \
--with-config-file-scan-dir=/etc/php5/apache2/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--with-curl=shared,/usr \
--with-enchant=shared,/usr \
--with-zlib-dir=/usr \
--with-gd=shared,/usr --enable-gd-native-ttf \
--with-gmp=shared,/usr \
--with-jpeg-dir=shared,/usr \
--with-xpm-dir=shared,/usr/X11R6 \
--with-png-dir=shared,/usr \
--with-freetype-dir=shared,/usr \
--with-vpx-dir=shared,/usr \
--enable-intl=shared \
--without-t1lib \
--with-ldap=shared,/usr \
--with-ldap-sasl=/usr \
--with-mysql=shared,/usr \
--with-mysqli=shared,/usr/bin/mysql_config \
--with-pspell=shared,/usr \
--with-unixODBC=shared,/usr \
--with-recode=shared,/usr \
--with-xsl=shared,/usr \
--with-snmp=shared,/usr \
--with-sqlite3=shared,/usr \
--with-mssql=shared,/usr \
--with-tidy=shared,/usr \
--with-xmlrpc=shared \
--with-pgsql=shared,/usr PGSQL_INCLUDE=`pg_config --includedir` \
--enable-pdo=shared \
--without-pdo-dblib \
--with-pdo-mysql=shared,/usr \
--with-pdo-odbc=shared,unixODBC,/usr \
--with-pdo-pgsql=shared,/usr/bin/pg_config \
--with-pdo-sqlite=shared,/usr \
--with-pdo-dblib=shared,/usr \
$(CONFIGURE_APACHE_ARGS)
cd apache2-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-apache2-stamp
configure-apache2filter-stamp: prepared-stamp
dh_testdir
if [ -d apache2filter-build ]; then rm -rf apache2filter-build; fi
-mkdir apache2filter-build
cd apache2filter-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --with-apxs2filter=/usr/bin/apxs2 \
--with-config-file-path=/etc/php5/apache2filter \
--with-config-file-scan-dir=/etc/php5/apache2filter/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--disable-pdo \
--without-mysql --without-sybase-ct --without-mssql \
--without-sqlite3
cd apache2filter-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-apache2filter-stamp
configure-cgi-stamp: prepared-stamp
dh_testdir
if [ -d cgi-build ]; then rm -rf cgi-build; fi
-mkdir cgi-build
cd cgi-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --enable-force-cgi-redirect --enable-fastcgi \
--with-config-file-path=/etc/php5/cgi \
--with-config-file-scan-dir=/etc/php5/cgi/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--enable-pdo=shared \
--enable-mysqlnd=shared \
--with-mysql=shared,mysqlnd \
--with-mysqli=shared,mysqlnd \
--with-pdo-mysql=shared,mysqlnd \
--without-pdo-sqlite \
--without-sybase-ct --without-mssql \
--without-sqlite3 \
--enable-pcntl
cd cgi-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-cgi-stamp
configure-cli-stamp: prepared-stamp
dh_testdir
if [ -d cli-build ]; then rm -rf cli-build; fi
-mkdir cli-build
cd cli-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --disable-cgi \
--with-config-file-path=/etc/php5/cli \
--with-config-file-scan-dir=/etc/php5/cli/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--disable-pdo \
--without-mysql --without-sybase-ct \
--without-mssql --without-sqlite3 --enable-pcntl \
--with-libedit=shared,/usr
cd cli-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-cli-stamp
configure-embed-stamp: prepared-stamp
dh_testdir
if [ -d embed-build ]; then rm -rf embed-build; fi
-mkdir embed-build
cd embed-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --enable-embed --disable-cgi \
--with-config-file-path=/etc/php5/embed \
--with-config-file-scan-dir=/etc/php5/embed/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--disable-pdo \
--without-mysql --without-sybase-ct \
--without-mssql --without-sqlite3 --enable-pcntl
cd embed-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-embed-stamp
configure-fpm-stamp: prepared-stamp
dh_testdir
if [ -d fpm-build ]; then rm -rf fpm-build; fi
-mkdir fpm-build
cd fpm-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --enable-fpm --disable-cgi \
--with-fpm-user=www-data --with-fpm-group=www-data \
--with-config-file-path=/etc/php5/fpm \
--with-config-file-scan-dir=/etc/php5/fpm/conf.d \
$(COMMON_CONFIG) \
--with-libevent-dir=/usr \
--without-mm \
--disable-pdo \
--without-mysql --without-sybase-ct \
--without-mssql --without-sqlite3 \
$(CONFIGURE_SYSTEMD)
cd fpm-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-fpm-stamp
clean: unprepared
dh_testdir
dh_testroot
rm -f configure-apache2-stamp build-apache2-stamp
rm -f configure-apache2filter-stamp build-apache2filter-stamp
rm -f configure-cgi-stamp build-cgi-stamp
rm -f configure-cli-stamp build-cli-stamp
rm -f configure-embed-stamp build-embed-stamp
rm -f configure-fpm-stamp build-fpm-stamp
rm -f build-pear-stamp
rm -f install-stamp
rm -rf apache2-build
rm -rf apache2filter-build
rm -rf cgi-build
rm -rf cli-build
rm -rf embed-build
rm -rf fpm-build
rm -rf pear-build pear-build-download
# just in case the build tests failed, kill the running mysqld
$(SHELL) debian/setup-mysql.sh $(MYSQL_PORT) $(MYSQL_DATA_DIR) stop > /dev/null 2>&1 || exit 0
rm -rf test-results.txt $(MYSQL_DATA_DIR)
dh_clean -Xorig
# clean up autogenerated cruft
cat debian/modulelist | while read package extname dsoname priority; do \
rm -f debian/php5-$$package.postinst; \
rm -f debian/php5-$$package.preinst; \
rm -f debian/php5-$$package.prerm; \
rm -f debian/php5-$$package.postrm; \
done
for sapi in libapache2-mod-php5 libapache2-mod-php5filter php5-cgi php5-cli libphp5-embed php5-fpm; do \
for cruft in postrm links; do \
rm -f debian/$${sapi}.$${cruft}; \
done; \
done
PCNTL_FUNCTIONS := $(shell < ext/pcntl/php_pcntl.h sed -ne "/^PHP_FUNCTION/ s/PHP_FUNCTION(\(.*\));/\1/;t end;d;:end p" | tr '\n' ',')
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
chmod 01733 debian/php5-common/var/lib/php5
# Mangle apache2filter DSO name before running dh_apache2
mv apache2filter-build/.libs/libphp5.so apache2filter-build/.libs/libphp5filter.so
# install apache2 DSO module
dh_apache2 --conditional=php5_enable
# sanitize php.ini file
cat php.ini-production | tr "\t" " " | sed -e'/session.gc_probability =/ s/1/0/g;/disable_functions =/ s/$$/ $(PCNTL_FUNCTIONS)/g;' > debian/php5-common/usr/share/php5/php.ini-production
cat php.ini-production | tr "\t" " " | sed -e'/memory_limit =/ s/128M/-1/g;/session.gc_probability =/ s/1/0/g' > debian/php5-common/usr/share/php5/php.ini-production.cli
cat php.ini-development | tr "\t" " " | sed -e'/session.gc_probability =/ s/1/0/g;/disable_functions =/ s/$$/ $(PCNTL_FUNCTIONS)/g;' > debian/php5-common/usr/share/php5/php.ini-development
cp test-results.txt debian/php5-common/usr/share/doc/php5-common/
# Install reportbug for php5 package
mkdir -p debian/php5/usr/share/reportbug/php5
install -m644 debian/php5.bug.control debian/php5/usr/share/reportbug/php5/control
ln -s ../php5-common/script debian/php5/usr/share/reportbug/php5/script
# Install helper shell fragment
install -m644 debian/php5-helper $(CURDIR)/debian/php5-common/usr/share/php5/
install -m644 debian/debhelper/php5-maintscript-helper $(CURDIR)/debian/php5-common/usr/share/php5/
# install embed SAPI
cd embed-build && make install-headers install-build install-sapi install-programs INSTALL_ROOT=$(CURDIR)/debian/libphp5-embed
# install the apache modules' files
cd apache2-build && $(MAKE) install-headers install-build install-modules install-programs INSTALL_ROOT=$(CURDIR)/debian/libapache2-mod-php5
# install the headers from cgi-build
cd cgi-build && $(MAKE) install-headers INSTALL_ROOT=$(CURDIR)/debian/php5-dev
# remove netware and win32 headers that we don't want
cd debian/libapache2-mod-php5/usr/include/php5/ && \
$(RM) TSRM/readdir.h \
TSRM/tsrm_config.nw.h TSRM/tsrm_config.w32.h\
TSRM/tsrm_nw.h TSRM/tsrm_win32.h\
Zend/zend_config.nw.h Zend/zend_config.w32.h\
main/config.nw.h main/config.w32.h\
main/win95nt.h
# install PEAR
cp -a pear-build/* debian/php-pear/
# everything under usr/share/php/data except 'PEAR' is b0rken
# and actually needs to be fixed
[ ! -f debian/php-pear/usr/share/php/data/Structures_Graph/LICENSE ] || \
$(RM) debian/php-pear/usr/share/php/data/Structures_Graph/LICENSE
[ ! -f debian/php-pear/usr/share/php/doc/PEAR/INSTALL ] || \
$(RM) debian/php-pear/usr/share/php/doc/PEAR/INSTALL
[ ! -f debian/php-pear/usr/share/php/doc/Structures_Graph/docs/generate.sh ] || \
$(RM) debian/php-pear/usr/share/php/doc/Structures_Graph/docs/generate.sh
for f in Structures_Graph/publish.sh Structures_Graph/package.sh \
Structures_Graph/genpackage.xml.pl; do \
$(RM) debian/php-pear/usr/share/php/data/$$f; \
done
# we don't want test suites
$(RM) -r debian/php-pear/usr/share/php/test/
[ -d debian/php-pear/usr/share/php/doc ] && { \
mkdir -p debian/php-pear/usr/share/doc/php5-common/PEAR; \
mv debian/php-pear/usr/share/php/doc/* \
debian/php-pear/usr/share/doc/php5-common/PEAR/; \
$(RM) -r debian/php-pear/usr/share/php/doc; \
ln -s ../doc/php-pear/PEAR debian/php-pear/usr/share/php/doc; \
echo "Dummy placeholder to prevent the directory's deletion" > \
debian/php-pear/usr/share/doc/php5-common/PEAR/.placeholder; \
}
# install extensions
ext=`./debian/libapache2-mod-php5/usr/bin/php-config --extension-dir`;\
for i in libapache2-mod-php5 libapache2-mod-php5filter php5-cgi php5-cli libphp5-embed php5-fpm; do \
mkdir -p debian/$$i/$${ext}; \
done; \
cat debian/modulelist debian/extramodulelist | while read package extname dsoname priority; do \
if [ "$$package" = "mysqlnd" ]; then \
modulepath=cgi-build/modules; \
elif [ "$$package" = "readline" ]; then \
modulepath=cli-build/modules; \
else \
modulepath=debian/libapache2-mod-php5/$${ext}; \
fi; \
if [ -z "$$dsoname" ]; then dsoname=$$package; fi; \
mkdir -p debian/php5-$$package$${ext}; \
install -m 644 -o root -g root \
$${modulepath}/$$dsoname.so \
debian/php5-$$package$${ext}/$$dsoname.so; \
rm $${modulepath}/$$dsoname.so; \
done
# install CGI
cp cgi-build/sapi/cgi/cgi-bin.php5 debian/php5-cgi/usr/lib/cgi-bin/php5
cp cgi-build/sapi/cgi/usr.bin.php5-cgi debian/php5-cgi/usr/bin/php5-cgi
cp cli-build/sapi/cli/php.1 debian/php5-cgi/usr/share/man/man1/php5-cgi.1
# install CLI
cp cli-build/sapi/cli/php debian/php5-cli/usr/bin/php5
cp cli-build/sapi/cli/php.1 debian/php5-cli/usr/share/man/man1/php5.1
# install FPM
mkdir -p debian/php5-fpm/usr/sbin debian/php5-fpm/usr/share/man/man8/ debian/php5-fpm/etc/php5/fpm/pool.d
cp fpm-build/sapi/fpm/php-fpm debian/php5-fpm/usr/sbin/php5-fpm
cp fpm-build/sapi/fpm/php-fpm.8 debian/php5-fpm/usr/share/man/man8/php5-fpm.8
# we don't want the pool definitions on the main file itself:
sed -r '/('"'"'|\[)www('"'"'|\])/Q' < fpm-build/sapi/fpm/php-fpm.conf > \
debian/php5-fpm/etc/php5/fpm/php-fpm.conf
# extract the first pool, called "www," from the config file:
sed -nr '/('"'"'|\[)www('"'"'|\])/{h;p;d};x;/www/{x;p}' < fpm-build/sapi/fpm/php-fpm.conf | \
sed -e's{^;listen\.owner{listen.owner{;' \
-e's{^;listen\.group{listen.group{;' \
> debian/php5-fpm/etc/php5/fpm/pool.d/www.conf
# install a helper script for checking PHP FPM configuration
install -m 755 debian/php5-fpm-checkconf debian/php5-fpm/usr/lib/php5/
install -m 755 debian/php5-fpm-reopenlogs debian/php5-fpm/usr/lib/php5/
# move and install -dev files
dh_movefiles --sourcedir=debian/libphp5-embed
dh_movefiles --sourcedir=debian/libapache2-mod-php5
rm -rf debian/libphp5-embed/usr/include/ \
debian/libphp5-embed/usr/bin/
rm -rf debian/libapache2-mod-php5/usr/lib/php5/build/ \
debian/libapache2-mod-php5/usr/include/ \
debian/libapache2-mod-php5/usr/bin/
rm -rf debian/libapache2-mod-php5filter/usr/lib/php5/build/ \
debian/libapache2-mod-php5filter/usr/include/ \
debian/libapache2-mod-php5filter/usr/bin/
for i in Makefile.global acinclude.m4 mkdep.awk phpize.m4 scan_makefile_in.awk; do \
chmod 644 debian/php5-dev/usr/lib/php5/build/$$i; \
done
mkdir -p debian/php5-dev/usr/share/php5
cp -a ext/skeleton ext/ext_skel debian/php5-dev/usr/share/php5
sed -i 's/skel_dir="skeleton"/skel_dir="\/usr\/share\/php5\/skeleton"/' \
debian/php5-dev/usr/share/php5/ext_skel
# shipping duplicate files from other packages is hell for security audits
ln -sf /usr/share/misc/config.guess $(PHPIZE_BUILDDIR)/config.guess
ln -sf /usr/share/misc/config.sub $(PHPIZE_BUILDDIR)/config.sub
ln -sf /usr/share/aclocal/libtool.m4 $(PHPIZE_BUILDDIR)/libtool.m4
ln -sf $(LTMAIN_DIR)ltmain.sh $(PHPIZE_BUILDDIR)/ltmain.sh
ln -sf /usr/bin/shtool $(PHPIZE_BUILDDIR)/shtool
# make php-dev stuff versioned
for i in php-config phpize; do \
mv debian/php5-dev/usr/bin/$$i debian/php5-dev/usr/bin/"$$i"5; \
mv debian/php5-dev/usr/share/man/man1/"$$i".1 debian/php5-dev/usr/share/man/man1/"$$i"5.1; \
done
# remove windows devel file
rm $(CURDIR)/debian/php5-dev/usr/share/php5/skeleton/skeleton.dsp
install -m755 debian/debhelper/dh_* $(CURDIR)/debian/php5-dev/usr/bin
install -d -m755 $(CURDIR)/debian/php5-dev/usr/share/debhelper/autoscripts/
install -m644 debian/debhelper/*-php5 $(CURDIR)/debian/php5-dev/usr/share/debhelper/autoscripts/
install -d -m755 $(CURDIR)/debian/php5-dev/usr/share/perl5/Debian/Debhelper/Sequence
install -m644 debian/debhelper/php5.pm $(CURDIR)/debian/php5-dev/usr/share/perl5/Debian/Debhelper/Sequence
# install common files
install -m755 debian/maxlifetime debian/php5-common/usr/lib/php5
install -m755 debian/sessionclean debian/php5-common/usr/lib/php5
install -m755 debian/php5enmod debian/php5-common/usr/sbin/php5enmod
ln -s php5enmod debian/php5-common/usr/sbin/php5dismod
install -m755 debian/php5query $(CURDIR)/debian/php5-common/usr/sbin/php5query
# remove libtool files
rm $(CURDIR)/debian/libphp5-embed/usr/lib/php5/libphp5.la
mv $(CURDIR)/debian/libphp5-embed/usr/lib/php5/* $(CURDIR)/debian/libphp5-embed/usr/lib/
# install lintian overrides
cp debian/php5.lintian-overrides $(CURDIR)/debian/php5-common/usr/share/lintian/overrides/php5-common
cp debian/php5-dev.lintian-overrides $(CURDIR)/debian/php5-dev/usr/share/lintian/overrides/php5-dev
cp debian/php-pear.lintian-overrides $(CURDIR)/debian/php-pear/usr/share/lintian/overrides/php-pear
# install the apport hook
install -D -m 644 debian/source_php5.py debian/php5-common/usr/share/apport/package-hooks/source_php5.py
# install some generic lintian overrides
ext=`debian/php5-dev/usr/bin/php-config5 --extension-dir | cut -b2- `; \
for sapi in php5-cli php5-fpm php5-cgi libapache2-mod-php5 libapache2-mod-php5filter libphp5-embed; do \
mkdir -p $(CURDIR)/debian/"$$sapi"/usr/share/lintian/overrides/; \
sed "s/@sapi@/$$sapi/g;s,@extdir@,$$ext,g" \
< $(CURDIR)/debian/php5-sapi.lintian-overrides | \
grep -E "^$${sapi}: " \
>> $(CURDIR)/debian/"$$sapi"/usr/share/lintian/overrides/"$$sapi"; \
done
# directories cleanup:
-rmdir -p debian/libapache2-mod-php5/usr/share/man/man1
-find debian/php-pear -type d -exec rmdir --ignore-fail-on-non-empty -p '{}' \; >/dev/null 2>&1
touch install-stamp
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: DH_OPTIONS=-i
binary-indep: build install
# Need this version of debhelper for DH_OPTIONS to work.
dh_testdir
dh_testroot
dh_installdocs
for package in php5 php-pear; do \
rm -rf debian/$$package/usr/share/doc/$$package; \
ln -s php5-common debian/$$package/usr/share/doc/$$package; \
done
dh_link
dh_compress -Xphp.ini
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
binary-arch: build install
# Need this version of debhelper for DH_OPTIONS to work.
dh_testdir
dh_testroot
# Do this first so we don't overwrite any debhelper-generated files
#
# generate the config snippets for various php
# modules from the templates.
cat debian/modulelist debian/extramodulelist | while read package extname dsoname priority extension; do \
if [ -z "$${dsoname}" ]; then dsoname=$$package; fi; \
if [ -z "$${priority}" ]; then priority=20; fi; \
if [ -z "$${extension}" ]; then extension=extension; fi; \
mkdir -p debian/php5-$$package/usr/share/php5/$$package; \
sed -e"s|@extname@|$${extname}|g; \
s/@dsoname@/$${dsoname}/g; \
s/@extension@/$${extension}/g; \
s/@priority@/$${priority}/g" \
< debian/php5-module.ini \
> debian/php5-$$package/usr/share/php5/$$package/$${dsoname}.ini; \
echo -n "$$dsoname " >> debian/php5-$$package.modules; \
done
# generate the maintscripts for various php
# modules from the templates.
cat debian/modulelist | while read package extname dsoname priority; do \
modules=$$(cat debian/php5-$$package.modules); \
for script in postinst preinst postrm prerm; do \
sed -e"s/@package@/$${package}/g; \
s/@modules@/$${modules}/g; \
/#EXTRA#/ r debian/php5-$${package}.$${script}.extra" \
< debian/php5-module.$${script} \
| sed -e'/#EXTRA#/ d' \
> debian/php5-$${package}.$${script}; \
done; \
cp debian/php5-module.triggers debian/php5-$${package}.triggers; \
rm debian/php5-$$package.modules; \
mkdir -p debian/php5-$$package/usr/share/bug/php5-$$package; \
sed -e"s/@package@/$${package}/g; \
s/@modules@/$${modules}/g;" \
< debian/php5-module.bug.script \
> debian/php5-$$package/usr/share/bug/php5-$$package/script; \
chmod 755 debian/php5-$$package/usr/share/bug/php5-$$package/script; \
cp debian/php5-module.bug.control debian/php5-$$package/usr/share/bug/php5-$$package/control; \
done
# likewise, for the different sapi implementations
for tmpl in postrm prerm postinst; do \
for sapi in cgi cli fpm; do \
sed -e "s/@sapi@/$${sapi}/g; \
s/@package@/php5-$${sapi}/g; \
/#EXTRA#/ r debian/php5-$${sapi}.$${tmpl}.extra" \
< debian/php5-sapi.$${tmpl} \
| sed -e'/#EXTRA#/ d' \
> debian/php5-$${sapi}.$${tmpl}; \
mkdir -p "$(CURDIR)/debian/php5-$$sapi/usr/share/php5/sapi/"; \
touch "$(CURDIR)/debian/php5-$$sapi/usr/share/php5/sapi/$$sapi"; \
mkdir -p debian/php5-$$sapi/usr/share/bug/php5-$$sapi; \
sed -e "s/@sapi@/$${sapi}/g; \
s/@package@/php5-$${sapi}/g;" \
< debian/php5-sapi.bug.script \
> debian/php5-$$sapi/usr/share/bug/php5-$$sapi/script; \
chmod 755 debian/php5-$$sapi/usr/share/bug/php5-$$sapi/script; \
cp debian/php5-sapi.bug.control debian/php5-$$sapi/usr/share/bug/php5-$$sapi/control; \
done; \
for sapi in embed; do \
sed -e "s/@sapi@/$${sapi}/g; \
s/@package@/libphp5-$${sapi}/g; \
/#EXTRA#/ r debian/libphp5-$${sapi}.$${tmpl}.extra" \
< debian/php5-sapi.$${tmpl} \
| sed -e'/#EXTRA#/ d' \
> debian/libphp5-$${sapi}.$${tmpl}; \
mkdir -p "$(CURDIR)/debian/libphp5-$$sapi/usr/share/php5/sapi/"; \
touch "$(CURDIR)/debian/libphp5-$$sapi/usr/share/php5/sapi/$$sapi"; \
mkdir -p debian/libphp5-$$sapi/usr/share/bug/libphp5-$$sapi; \
sed -e "s/@sapi@/$${sapi}/g; \
s/@package@/libphp5-$${sapi}/g;" \
< debian/php5-sapi.bug.script \
> debian/libphp5-$$sapi/usr/share/bug/libphp5-$$sapi/script; \
chmod 755 debian/libphp5-$$sapi/usr/share/bug/libphp5-$$sapi/script; \
cp debian/php5-sapi.bug.control debian/libphp5-$$sapi/usr/share/bug/libphp5-$$sapi/control; \
done; \
for sapi in "" "filter"; do \
sed -e "s/@sapi@/apache2$${sapi}/g; \
s/@package@/libapache2-mod-php5$${sapi}/g; \
/#EXTRA#/ r debian/libapache2-mod-php5$${sapi}.$${tmpl}.extra" \
< debian/php5-sapi.$${tmpl} \
| sed -e'/#EXTRA#/ d' \
> debian/libapache2-mod-php5$${sapi}.$${tmpl}; \
mkdir -p "$(CURDIR)/debian/libapache2-mod-php5$$sapi/usr/share/php5/sapi/"; \
touch "$(CURDIR)/debian/libapache2-mod-php5$$sapi/usr/share/php5/sapi/apache2$$sapi"; \
mkdir -p debian/libapache2-mod-php5$$sapi/usr/share/bug/libapache2-mod-php5$$sapi; \
sed -e "s/@sapi@/apache2$${sapi}/g; \
s/@package@/libapache2-mod-php5$${sapi}/g;" \
< debian/php5-sapi.bug.script \
> debian/libapache2-mod-php5$$sapi/usr/share/bug/libapache2-mod-php5$$sapi/script; \
chmod 755 debian/libapache2-mod-php5$$sapi/usr/share/bug/libapache2-mod-php5$$sapi/script; \
cp debian/php5-sapi.bug.control debian/libapache2-mod-php5$$sapi/usr/share/bug/libapache2-mod-php5$$sapi/control; \
done; \
done
dh_installdocs -s
cat debian/modulelist | grep -v common | while read package extname dsoname priority; do \
rm -rf debian/php5-$$package/usr/share/doc/php5-$$package; \
ln -s php5-common debian/php5-$$package/usr/share/doc/php5-$$package; \
done
for package in php5-dbg php5-dev php5-cgi php5-cli php5-fpm libapache2-mod-php5 libapache2-mod-php5filter libphp5-embed; do \
rm -rf debian/$$package/usr/share/doc/$$package; \
ln -s php5-common debian/$$package/usr/share/doc/$$package; \
done
dh_perl
dh_installlogrotate -pphp5-fpm
dh_installcron -pphp5-common --name=php5
dh_installchangelogs -pphp5-common NEWS
dh_installinit
dh_link -s
dh_compress -s -Xphp.ini
dh_fixperms -s -X/var/lib/php5
dh_strip -s --dbg-package=php5-dbg
dh_makeshlibs -s -plibphp5-embed -V 'libphp5-embed (>= 5.5.0)'
dh_shlibdeps -s
dh_installdeb -s
phpapi=`./debian/php5-dev/usr/bin/php-config5 --phpapi`; \
stored=`cat debian/phpapi`; \
if [ "$${phpapi%+lfs}" != "$${stored}" ]; then echo "PHPAPI has changed, please modify debian/phpapi"; exit 1; fi; \
for i in php5-common; do \
echo "php:Provides=phpapi-$${phpapi}" >> debian/$$i.substvars; \
done; \
cat debian/modulelist | while read package extname dsoname priority; do \
echo "php:Depends=phpapi-$${phpapi}" >> debian/php5-$$package.substvars; \
done
for i in cgi cli fpm; do \
"$$i"-build/sapi/cli/php -n -r '$(BUILTIN_EXTENSION_CHECK)' \
>> debian/php5-"$$i".substvars; \
done
for i in embed; do \
"$$i"-build/sapi/cli/php -n -r '$(BUILTIN_EXTENSION_CHECK)' \
>> debian/libphp5-"$$i".substvars; \
done
for i in apache2; do \
"$$i"-build/sapi/cli/php -n -r '$(BUILTIN_EXTENSION_CHECK)' \
>> debian/lib"$$i"-mod-php5.substvars; \
"$$i"filter-build/sapi/cli/php -n -r '$(BUILTIN_EXTENSION_CHECK)' \
>> debian/lib"$$i"-mod-php5filter.substvars; \
done
echo "libtool:Conflicts=$(LIBTOOL_CONFLICTS)" >>debian/php5-dev.substvars
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
binary: binary-arch binary-indep
build-arch: build
build-indep: build
.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install configure
debian/php5-module.bug.control 0000664 0000000 0000000 00000000160 12300436054 013477 0 ustar report-with: php5-common php5-cli libphp5-embed libapache2-mod-php5 libapache2-mod-php5filter php5-cgi php5-fpm
debian/source/ 0000775 0000000 0000000 00000000000 13457356003 010476 5 ustar debian/source/format 0000664 0000000 0000000 00000000014 12300436054 011673 0 ustar 3.0 (quilt)
debian/source/include-binaries 0000664 0000000 0000000 00000000162 13457356003 013635 0 ustar debian/patches/use_updated_install-pear-nozlib.phar.patch
ext/exif/tests/bug77563.jpg
ext/exif/tests/bug77540.jpg
debian/php5-cgi.conf 0000664 0000000 0000000 00000002500 12300436054 011445 0 ustar # This file replaces old system MIME types and sets them only in the
# Apache webserver
# application/x-httpd-php phtml pht php
# application/x-httpd-php3 php3
# application/x-httpd-php4 php4
# application/x-httpd-php5 php
SetHandler application/x-httpd-php
# application/x-httpd-php-source phps
SetHandler application/x-httpd-php-source
# Deny access to raw php sources by default
# To re-enable it's recommended to enable access to the files
# only in specific virtual host or directory
Order Deny,Allow
Deny from all
# Deny access to files without filename (e.g. '.php')
Order Deny,Allow
Deny from all
# To enable PHP CGI site-wide, just uncomment following lines, however
# as a security measure, it's recommended to enable PHP just in the
# specific virtual servers or just specific directories
#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
#
# AllowOverride None
# Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
# Order allow,deny
# Allow from all
#
#Action application/x-httpd-php /cgi-bin/php5
debian/php5-sapi.postrm 0000664 0000000 0000000 00000001321 12300436054 012236 0 ustar #!/bin/sh
set -e
#EXTRA#
php5_enable() { return 0; }
if [ "$1" = "purge" ]; then
phpini=/etc/php5/@sapi@/php.ini
# remove the flag to remember the original state
if [ -e /etc/php5/@sapi@/.start ]; then
rm -f /etc/php5/@sapi@/.start
fi
for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist; do
rm -f $phpini$ext
done
rm -f $phpini
if which ucf >/dev/null; then
ucf --purge $phpini
fi
if which ucfr >/dev/null; then
ucfr --purge @package@ $phpini
fi
fi
if [ -e /usr/share/php5/php5-maintscript-helper ]; then
. /usr/share/php5/php5-maintscript-helper
mods=$(php5query -M)
for mod in $mods; do
php5_invoke dismod @sapi@ $mod
done
fi
#DEBHELPER#
exit 0
debian/php5-fpm.preinst 0000664 0000000 0000000 00000000217 12300436054 012227 0 ustar #!/bin/sh
set -e
dpkg-maintscript-helper mv_conffile /etc/php5/fpm/main.conf /etc/php5/fpm/php-fpm.conf 5.3.5-1 -- "$@"
#DEBHELPER#
exit 0
debian/php5.bug.control 0000664 0000000 0000000 00000000027 12300436054 012216 0 ustar Submit-As: php5-common
debian/watch 0000664 0000000 0000000 00000000340 12300436054 010213 0 ustar version=3
opts=downloadurlmangle=s#/a/#/this/#,\
filenamemangle=s#/get/(php-(5\.[0-9\.]*)\.tar\.gz)/.*#$1#,\
dversionmangle=s/\+dfsg$// \
http://www.php.net/downloads.php /get/php-(5\.[0-9\.]*)\.tar\.gz/from/a/mirror debian
debian/php5-mysqlnd.postrm.extra 0000664 0000000 0000000 00000000176 12300436054 014122 0 ustar dpkg-maintscript-helper mv_conffile /etc/php5/conf.d/10-mysqlnd.ini /etc/php5/mods-available/mysqlnd.ini 5.4.0~rc6-1 -- "$@";
debian/control 0000664 0000000 0000000 00000053670 12300437522 010604 0 ustar Source: php5
Section: php
Priority: optional
Maintainer: Ubuntu Developers
XSBC-Original-Maintainer: Debian PHP Maintainers
Uploaders: Ondřej Surý ,
Sean Finney ,
Thijs Kinkhorst ,
Lior Kaplan
Build-Depends: apache2-dev (>= 2.4),
dh-apache2,
libsystemd-daemon-dev [linux-any],
autoconf (>= 2.63),
automake (>= 1.11) | automake1.11,
bison,
chrpath,
debhelper (>= 5),
dpkg-dev (>= 1.16.1~),
flex,
freetds-dev,
libapr1-dev (>= 1.2.7-8),
libbz2-dev,
libcurl4-openssl-dev | libcurl-dev,
libdb-dev,
libedit-dev (>= 2.11-20080614-4),
libenchant-dev,
libevent-dev (>= 1.4.11),
libexpat1-dev (>= 1.95.2-2.1),
libfreetype6-dev,
libgcrypt11-dev,
libgd-dev | libgd2-dev,
libglib2.0-dev,
libgmp3-dev,
libicu-dev,
libjpeg-dev | libjpeg62-dev,
libkrb5-dev,
libldap2-dev,
libmagic-dev,
libmhash-dev (>= 0.8.8),
libmysqlclient-dev | libmysqlclient15-dev,
libpam0g-dev,
libpcre3-dev (>= 6.6),
libpng-dev | libpng12-dev,
libpq-dev,
libpspell-dev,
librecode-dev,
libsasl2-dev,
libsnmp-dev,
libsqlite3-dev,
libssl-dev,
libtidy-dev,
libtool (>= 2.2),
libwrap0-dev,
libxmltok1-dev,
libxml2-dev,
libxslt1-dev (>= 1.0.18),
systemtap-sdt-dev [amd64 i386 powerpc armel armhf ia64],
locales-all | language-pack-de,
mysql-server,
netbase,
netcat-openbsd | netcat,
re2c,
unixodbc-dev,
zlib1g-dev,
tzdata
Build-Conflicts: bind-dev
Standards-Version: 3.9.4
Vcs-Git: git://anonscm.debian.org/pkg-php/php.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-php/php.git
Homepage: http://www.php.net/
XS-Testsuite: autopkgtest
Package: php5
Architecture: all
Depends: ${misc:Depends}, libapache2-mod-php5 (>= ${source:Version}) | libapache2-mod-php5filter (>= ${source:Version}) | php5-cgi (>= ${source:Version}) | php5-fpm (>= ${source:Version}), php5-common (>= ${source:Version})
Description: server-side, HTML-embedded scripting language (metapackage)
This package is a metapackage that, when installed, guarantees that you
have at least one of the four server-side versions of the PHP5 interpreter
installed. Removing this package won't remove PHP5 from your system, however
it may remove other packages that depend on this one.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-common
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
sed (>= 4.1.1-1),
psmisc (>= 22.15-1~),
lsof [!kfreebsd-any !hurd-any],
ucf,
php5-json
Provides: php5-mhash, ${php:Provides}
Conflicts: php5-mhash
Suggests: php5-user-cache
Breaks: php5-xdebug (<< 2.2.2),
php-apc (<< 4.0.0),
php5-xcache (<< 3.1~),
php5-suhosin (<< 0.9.34),
php5-json (<< 1.3.1-1~),
php-crypt-gpg (<< 1.3.2)
Description: Common files for packages built from the php5 source
This package contains the documentation and example files relevant to all
the other packages built from the php5 source.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: libapache2-mod-php5
Section: httpd
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
apache2 (>= 2.4),
mime-support,
php5-common (= ${binary:Version}),
libmagic1,
ucf,
tzdata
Conflicts: libapache2-mod-php4,
libapache2-mod-php5filter
Provides: ${php:Provides}
Recommends: php5-cli
Suggests: php-pear
Description: server-side, HTML-embedded scripting language (Apache 2 module)
This package provides the PHP5 module for the Apache 2 webserver (as
found in the apache2-mpm-prefork package). Please note that this package
ONLY works with Apache's prefork MPM, as it is not compiled thread-safe.
.
${php:Extensions}
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: libapache2-mod-php5filter
Section: httpd
Priority: extra
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
apache2 (>= 2.4),
mime-support,
php5-common (= ${binary:Version}),
libmagic1,
ucf,
tzdata
Conflicts: libapache2-mod-php4, libapache2-mod-php5
Provides: ${php:Provides}
Suggests: php-pear
Description: server-side, HTML-embedded scripting language (apache 2 filter module)
This package provides the PHP5 Filter module for the Apache 2 webserver (as
found in the apache2-mpm-prefork package). Please note that this package
ONLY works with Apache's prefork MPM, as it is not compiled thread-safe.
.
Unless you specifically need filter-module support, you most likely
should instead install libapache2-mod-php5.
.
${php:Extensions}
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-cgi
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, mime-support, php5-common (= ${binary:Version}), libmagic1, ucf, tzdata
Provides: ${php:Provides}
Suggests: php-pear
Description: server-side, HTML-embedded scripting language (CGI binary)
This package provides the /usr/lib/cgi-bin/php5 CGI interpreter built
for use in Apache 2 with mod_actions, or any other CGI httpd that
supports a similar mechanism. Note that MOST Apache users probably
want the libapache2-mod-php5 package.
.
${php:Extensions}
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-cli
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, mime-support, php5-common (= ${binary:Version}), libmagic1, ucf, tzdata, libedit2 (>= 2.11-20080614-4)
Provides: ${php:Provides}
Recommends: php5-readline
Suggests: php-pear
Description: command-line interpreter for the php5 scripting language
This package provides the /usr/bin/php5 command interpreter, useful for
testing PHP scripts from a shell or performing general shell scripting tasks.
.
${php:Extensions}
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-fpm
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, mime-support, php5-common (= ${binary:Version}), libmagic1, ucf, tzdata
Provides: ${php:Provides}
Suggests: php-pear
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: server-side, HTML-embedded scripting language (FPM-CGI binary)
This package provides the Fast Process Manager interpreter that runs
as a daemon and receives Fast/CGI requests. Note that MOST Apache users
probably want the libapache2-mod-php5 package.
.
${php:Extensions}
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: libphp5-embed
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, mime-support, php5-common (= ${binary:Version}), libmagic1, ucf, tzdata
Provides: ${php:Provides}
Suggests: php-pear
Priority: optional
Description: HTML-embedded scripting language (Embedded SAPI library)
This package provides the library /usr/lib/libphp5.so which can
be used by application developers to embed PHP scripting functionality.
.
${php:Extensions}
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
.
WARNING: The embed SAPI is experimental and there's no guarantee that
the API/ABI will be kept compatible even between minor releases. You
have been warned.
Package: php5-dev
Depends: ${misc:Depends}, autoconf (>= 2.63), automake (>= 1.11), libssl-dev, libtool (>= 2.2), shtool, php5-common (>= ${binary:Version}), ${perl:Depends}
Conflicts: ${libtool:Conflicts}
Architecture: any
Provides: dh-php5
Recommends: pkg-php-tools
Description: Files for PHP5 module development
This package provides the files from the PHP5 source needed for compiling
additional modules.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-dbg
Depends: ${misc:Depends}, php5-common (= ${binary:Version}), libapache2-mod-php5 (= ${binary:Version}) | libapache2-mod-php5filter (= ${binary:Version}) | php5-cgi (= ${binary:Version}) | php5-cli (= ${binary:Version}) | php5-fpm (= ${binary:Version}) | php5-curl (= ${binary:Version}) | php5-enchant (= ${binary:Version}) | php5-gd (= ${binary:Version}) | php5-gmp (= ${binary:Version}) | php5-intl (= ${binary:Version}) | php5-ldap (= ${binary:Version}) | php5-mysql (= ${binary:Version}) | php5-odbc (= ${binary:Version}) | php5-pgsql (= ${binary:Version}) | php5-pspell (= ${binary:Version}) | php5-readline (= ${binary:Version}) | php5-recode (= ${binary:Version}) | php5-snmp (= ${binary:Version}) | php5-sqlite (= ${binary:Version}) | php5-sybase (= ${binary:Version}) | php5-tidy (= ${binary:Version}) | php5-xmlrpc (= ${binary:Version}) | php5-xsl (= ${binary:Version})
Recommends: gdb
Section: debug
Priority: extra
Architecture: any
Description: Debug symbols for PHP5
This package provides the debug symbols for PHP5 needed for properly
debugging errors in PHP5 with gdb.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php-pear
Architecture: all
Depends: ${misc:Depends}, php5-common (>= ${source:Version}), php5-cli
Recommends: gnupg
Conflicts: php-xml-util
Suggests: php5-dev
Replaces: php4-pear (<< 4:4.4.0-0), php-xml-util
Provides: php-xml-util
Description: PEAR - PHP Extension and Application Repository
This package contains the base PEAR classes for PHP, as well as the PEAR
installer. Many PEAR classes are already packaged for Debian, and can be
easily identified by names beginning with "php-", such as php-db and
php-auth. Note: to build and install precompiled PECL extensions, you
will need one of the php development packages installed.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-curl
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: CURL module for php5
CURL is a library for getting files from FTP, GOPHER, HTTP server.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-enchant
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: Enchant module for php5
This package provides a module for the generic spell checking library
Enchant, which can use engines such as ispell, aspell and myspells.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-gd
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: GD module for php5
This package provides a module for handling graphics directly from PHP
scripts. It supports the PNG, JPEG, XPM formats as well as Freetype/ttf fonts.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-gmp
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: GMP module for php5
This package provides a module for arbitrary precision arithmetic via the
GNU Multiple Precision (GMP) Arithmetic Library.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-intl
Architecture: any
Depends: ${shlibs:Depends}, ${php:Depends}, ${misc:Depends}, php5-common (= ${binary:Version}), ucf
Conflicts: php5-idn
Replaces: php5-idn
Provides: php5-idn
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: internationalisation module for php5
This package provides a module to ease internationalisation of PHP scripts.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-ldap
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: LDAP module for php5
This package provides a module for LDAP functions in PHP scripts.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-readline
Architecture: any
Depends: ${shlibs:Depends}, ${php:Depends}, ${misc:Depends}, php5-common (= ${binary:Version}), php5-cli (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: Readline module for php5
This package provides a module for readline functions (based on libedit)
in PHP scripts.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-mysql
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Conflicts: php5-mysqli, php5-mysqlnd
Replaces: php5-mysqli, php5-mysqlnd
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: MySQL module for php5
This package provides modules for MySQL database connections directly from
PHP scripts. It includes the generic "mysql" module which can be used
to connect to all versions of MySQL, an improved "mysqli" module for
MySQL version 4.1 or later, and the pdo_mysql module for use with
the PHP Data Object extension.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-mysqlnd
Architecture: any
Priority: extra
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Conflicts: php5-mysqli, php5-mysql
Replaces: php5-mysqli, php5-mysql
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: MySQL module for php5 (Native Driver)
This package provides modules for MySQL database connections directly from
PHP scripts. It includes the generic "mysql" module which can be used
to connect to all versions of MySQL, an improved "mysqli" module for
MySQL version 4.1 or later, and the pdo_mysql module for use with
the PHP Data Object extension.
.
This package use the MySQL Native Driver.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-odbc
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: ODBC module for php5
This package provides a module for database access through ODBC drivers.
It uses the unixODBC library as an ODBC provider. It also contains the
pdo_odbc module, for use with the PHP Data Object extension.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-pgsql
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: PostgreSQL module for php5
This package provides a module for PostgreSQL database connections
directly from PHP scripts. It also includes the pdo_pgsql module for
use with the PHP Data Object extension.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-pspell
Architecture: any
Depends: ${shlibs:Depends}, ${php:Depends}, ${misc:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: pspell module for php5
This package provides a module for pspell functions in PHP scripts.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-recode
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: recode module for php5
This package provides a module for recode - character set recoding.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-snmp
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: SNMP module for php5
This package provides a module for SNMP functions in PHP scripts.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-sqlite
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Breaks: roundcube-sqlite (<< 0.7.1-2)
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: SQLite module for php5
This package provides a module allowing you to use the SQLite self-contained
database engine from within your PHP scripts, eliminating the need for a full
SQL server installation like MySQL or PostgreSQL. It also includes the
pdo_sqlite module, for use with the PHP Data Object extension.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-sybase
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Provides: php5-mssql
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: Sybase / MS SQL Server module for php5
This package provides a module for Sybase and Microsoft SQL Server
database connections directly from PHP scripts. It also includes the
pdo_dblib module for use with the PHP Data Object extension.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-tidy
Architecture: any
Depends: ${shlibs:Depends}, ${php:Depends}, ${misc:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: tidy module for php5
This package provides a module for tidy functions in PHP scripts.
.
Tidy is an extension based on Libtidy (http://tidy.sf.net/) and allows
a PHP developer to clean, repair, and traverse HTML, XHTML, and XML
documents -- including ones with embedded scripting languages such as PHP
or ASP within them using OO constructs.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-xmlrpc
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: XML-RPC module for php5
This package provides a module for XML-RPC functions in PHP scripts.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Package: php5-xsl
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${binary:Version}), ucf
Pre-Depends: dpkg (>= 1.15.7.2~)
Description: XSL module for php5
This package provides a module for XSL using the libxslt XSL parser.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
debian/php5-fpm.service 0000664 0000000 0000000 00000000511 12300436054 012200 0 ustar [Unit]
Description=The PHP FastCGI Process Manager
After=network.target
[Service]
Type=notify
PIDFile=/var/run/php5-fpm.pid
ExecStartPre=/usr/lib/php5/php5-fpm-checkconf
ExecStart=/usr/sbin/php5-fpm --nodaemonize --fpm-config /etc/php5/fpm/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
debian/php5-cgi.postrm.extra 0000664 0000000 0000000 00000000362 12300436054 013172 0 ustar dpkg-maintscript-helper mv_conffile /etc/apache2/mods-available/php5_cgi.conf /etc/apache2/conf-available/php5-cgi.conf 5.5.0~beta4-1 -- "$@"
dpkg-maintscript-helper rm_conffile /etc/apache2/mods-available/php5_cgi.load 5.5.0~beta4-1 -- "$@"
debian/php5-mysqlnd.postinst.extra 0000664 0000000 0000000 00000000363 12300436054 014457 0 ustar if [ "$1" = "configure" ]; then
ucf /usr/share/php5/mysqlnd/mysqlnd.ini /etc/php5/mods-available/mysqlnd.ini
fi
dpkg-maintscript-helper mv_conffile /etc/php5/conf.d/10-mysqlnd.ini /etc/php5/mods-available/mysqlnd.ini 5.4.0~rc6-1 -- "$@";
debian/php-pear.lintian-overrides 0000664 0000000 0000000 00000000111 12300436054 014252 0 ustar php-pear: extra-license-file usr/share/doc/php5-common/PEAR/PEAR/LICENSE
debian/libapache2-mod-php5.triggers 0000664 0000000 0000000 00000000042 12300436054 014352 0 ustar interest /etc/php5/apache2/conf.d
debian/sessionclean 0000664 0000000 0000000 00000000533 12300436054 011577 0 ustar #!/bin/sh
# first find all used files and touch them (hope it's not massive amount of files)
[ -x /usr/bin/lsof ] && /usr/bin/lsof -w -l +d "${1}" | awk -- '{ if (NR > 1) { print $9; } }' | xargs -i touch -c {}
# find all files older then maxlifetime
find "${1}" -depth -mindepth 1 -maxdepth 1 -ignore_readdir_race -type f -cmin "+${2}" -delete
debian/libapache2-mod-php5filter.triggers 0000664 0000000 0000000 00000000050 12300436054 015557 0 ustar interest /etc/php5/apache2filter/conf.d
debian/php5-sqlite.preinst.extra 0000664 0000000 0000000 00000000117 12300436054 014067 0 ustar dpkg-maintscript-helper rm_conffile /etc/php5/conf.d/sqlite.ini 5.3.9~ -- "$@"
debian/php5-module.ini 0000664 0000000 0000000 00000000130 12300436054 012017 0 ustar ; configuration for php @extname@ module
; priority=@priority@
@extension@=@dsoname@.so
debian/README.source 0000664 0000000 0000000 00000003337 12300436054 011352 0 ustar == Generation of the php5-dbg package Depends ==
The following command can be used to generate a heuristic list of
packages the php5-dbg package probably needs to Depend on:
dh_testdir && egrep '^Package' debian/control | cut '-d ' -f2 | \
egrep -v '(^php5|dbg|dev|common|pear)$' | tr "\n" "|" | sed 's/|$//' |\
sed -r 's/([^|]+)(\||$)/ \1 (= ${binary:Version}) \2/g'; echo
== Making some sense out of the configure options ==
The COMMON_CONFIG variable contains the configure options that are to
be used on all the SAPIs. Built-in extensions and other general options
should be set here.
The shared extensions are built when building the apache2 SAPI and as
such they need to be specified there.
The calls to configure for the other SAPIs usually only need
--without-foo when the extension or feature is otherwise enabled by
default.
== The *modulelist files ==
When building a new module (or extension) on an individual binary
package, it must be added to the debian/modulelist file. However, if
the extension is to be included in an existing binary package, it
must be added to the debian/extramodulelist file.
The format of these files is:
" "
E.g. for, if we want the mysql extension to be shipped in the
php5-mysql package we use:
"mysql MySQL mysql"
But we also want mysqli and the PDO in the same package, so we add the
following lines to extramoduleslist:
"mysql MySQLi mysqli
mysql MySQL_PDO pdo_mysql"
== More debian/rules foo ==
* The shared extensions are built under the apache2 target (see above).
* The CLI SAPI is built on the build-cli-stamp AND build-cgi-stamp, with
different configure options.
-- Ondřej Surý , Tue, 27 Nov 2012 17:01:53 +0100
debian/php5-cli.dirs 0000664 0000000 0000000 00000000100 12300436054 011460 0 ustar /etc/php5/cli
/etc/php5/cli/conf.d
/usr/bin
/usr/share/man/man1
debian/php5-sapi.prerm 0000664 0000000 0000000 00000000423 12300436054 012041 0 ustar #!/bin/sh
set -e
#EXTRA#
php5_enable() { return 0; }
if [ -e /usr/share/php5/php5-maintscript-helper ]; then
. /usr/share/php5/php5-maintscript-helper
mods=$(php5query -M)
for mod in $mods; do
php5_invoke dismod @sapi@ $mod
done
fi
#DEBHELPER#
exit 0
debian/php5-sybase.postinst.extra 0000664 0000000 0000000 00000000117 12300436054 014253 0 ustar dpkg-maintscript-helper rm_conffile /etc/php5/conf.d/mssql.ini 5.2.3-1 -- "$@"
debian/copyright 0000664 0000000 0000000 00000016613 12300436054 011127 0 ustar This package was debianized by Gergely Madarasz on
Tue, 16 Nov 1999 19:33:42 +0100.
Previous maintainers of the package also include:
Petr Cech , who did a LOT of work on these packages.
Adam Conrad , who got a significant chunk of input and
help from Steve Langasek and
Andres Salomon .
The current maintainers can be contacted via the debian php packaging list:
pkg-php-maint@lists.alioth.debian.org
It was downloaded from www.php.net/version5/downloads
Changes: removed ext/dbase dir (non-free)
Noteworthy/non-trivial patches:
patch: use_embedded_timezonedb.patch
contributor: Joe Orton
copyright © 2008 Red Hat, Inc.
may be used/modified/redistributed under the terms of PHP itself
Upstream Authors: The PHP group for PHP5, Andi Gutmans and Zeev Suraski
for libzend
The file ext/standard/rand.c contains the following clause with a statement
that isn't compatible with the DFSG:
"The code as Shawn received it included the following notice:
Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. When
you use this, send an e-mail to with
an appropriate reference to your work."
However, this requirement has been rescinded by the copyright holder in
message <48E334A2.6050301@math.sci.hiroshima-u.ac.jp> to bug #498621.
Two different licences apply to this package, one for PHP5, the other for
libzend. Both licences are shown here below.
--------------------------------------------------------------------
The PHP License, version 3.01
Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The name "PHP" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact group@php.net.
4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group@php.net. You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"
5. The PHP Group may publish revised and/or new versions of the
license from time to time. Each version will be given a
distinguishing version number.
Once covered code has been published under a particular version
of the license, you may always continue to use it under the terms
of that version. You may also choose to use such covered code
under the terms of any subsequent version of the license
published by the PHP Group. No one other than the PHP Group has
the right to modify the terms applicable to covered code created
under this License.
6. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes PHP software, freely available from
".
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------
This software consists of voluntary contributions made by many
individuals on behalf of the PHP Group.
The PHP Group can be contacted via Email at group@php.net.
For more information on the PHP Group and the PHP project,
please see .
PHP includes the Zend Engine, freely available at
.
--------------------------------------------------------------------
The Zend Engine License, Version 2.00
Copyright (c) 1999-2006 Zend Technologies Ltd. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
3. The names "Zend" and "Zend Engine" must not be used to endorse
or promote products derived from this software without prior
permission from Zend Technologies Ltd. For written permission,
please contact license@zend.com.
4. Zend Technologies Ltd. may publish revised and/or new versions
of the license from time to time. Each version will be given a
distinguishing version number.
Once covered code has been published under a particular version
of the license, you may always continue to use it under the
terms of that version. You may also choose to use such covered
code under the terms of any subsequent version of the license
published by Zend Technologies Ltd. No one other than Zend
Technologies Ltd. has the right to modify the terms applicable
to covered code created under this License.
5. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes the Zend Engine, freely available at
http://www.zend.com"
6. All advertising materials mentioning features or use of this
software must display the following acknowledgment:
"The Zend Engine is freely available at http://www.zend.com"
THIS SOFTWARE IS PROVIDED BY ZEND TECHNOLOGIES LTD. ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZEND
TECHNOLOGIES LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
--------------------------------------------------------------------
debian/php5-cgi.preinst 0000664 0000000 0000000 00000000441 12300436054 012206 0 ustar #!/bin/sh
set -e
#DEBHELPER#
dpkg-maintscript-helper mv_conffile /etc/apache2/mods-available/php5_cgi.conf \
/etc/apache2/conf-available/php5-cgi.conf 5.5.0~beta4-1 -- "$@"
dpkg-maintscript-helper rm_conffile /etc/apache2/mods-available/php5_cgi.load 5.5.0~beta4-1 -- "$@"
exit 0
debian/php5-module.prerm 0000664 0000000 0000000 00000000450 12300436054 012372 0 ustar #!/bin/sh
set -e
#EXTRA#
if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
if [ -e /usr/share/php5/php5-maintscript-helper ] ; then
. /usr/share/php5/php5-maintscript-helper
for dsoname in @modules@; do
php5_invoke dismod ALL ${dsoname}
done
fi
fi
#DEBHELPER#
exit 0
debian/php5-cgi.NEWS 0000664 0000000 0000000 00000003515 12300436054 011303 0 ustar php5 (5.4.4-5) unstable; urgency=low
Please be aware that the mime-support package has dropped non-standard
definitions for PHP, which might affect any systems using PHP 5
running as CGI or FastCGI. The following definitions were dropped:
application/x-httpd-php phtml pht php
application/x-httpd-php-source phps
application/x-httpd-php3 php3
application/x-httpd-php3-preprocessed php3p
application/x-httpd-php4 php4
application/x-httpd-php5 php5
The php5-cgi package mitigates any known issues by creating a (dummy)
apache2 module php5_cgi with a configuration containing handlers for
all previously defined extensions. Even though we believe that this
configuration should keep your PHP scripts working, it might be a
good idea to check your apache2 site-wide configuration as well as
any specific PHP configuration for websites running on your system.
The new (dummy) php5_cgi configuration uses the SetHandler directive,
which might interfere with existing custom configurations such as
FastCGI (mod_fcgid or mod_fastcgi). If so, you can reenable the
existing functionality of your custom configuration by disabling the
php5_cgi module (a2dismod php5_cgi), but you are also advised to
check whether your custom configuration is vulnerable to foo.php.jpeg
attacks. The php5_cgi configuration snippet can be used as a base -
it's important to use the FilesMatch or Files directive to limit the
handling to the last extension.
As far as we know definitions from the mime-support packages are not
used in any other webserver included in Debian, but it might affect
any application which relies on system MIME types to interpret PHP
files.
-- Ondřej Surý Wed, 15 Aug 2012 10:31:31 +0200
debian/phpapi 0000664 0000000 0000000 00000000011 12300436054 010361 0 ustar 20121212
debian/php5-dev.dirs 0000664 0000000 0000000 00000000046 12300436054 011500 0 ustar /usr/bin
/usr/share/lintian/overrides
debian/modulelist 0000664 0000000 0000000 00000000441 12300436325 011271 0 ustar curl CURL
common PDO pdo 10
enchant Enchant
gd GD
gmp GMP
intl Internationalisation
ldap LDAP
mysql MySQL
mysqlnd MySQL mysqlnd 10
odbc ODBC
pgsql PostgreSQL
pspell pspell
readline readline
recode recode
snmp SNMP
sqlite SQLite sqlite3
sybase Sybase mssql
tidy tidy
xmlrpc XML-RPC
xsl XSL
debian/php5-common.preinst.extra 0000664 0000000 0000000 00000000177 12300436054 014064 0 ustar if [ -d /var/lib/php5/module/ ]; then
cp -a /var/lib/php5/module/ /var/lib/php5/modules/
rm -rf /var/lib/php5/module/
fi
debian/php5-dev.prerm 0000664 0000000 0000000 00000000266 12300436054 011670 0 ustar #!/bin/sh
set -e
if [ "$1" = "remove" -o "$1" = "purge" ]; then
for i in php-config phpize; do
update-alternatives --remove $i /usr/bin/"$i"5
done
fi
#DEBHELPER#
exit 0
debian/php5-cli.prerm.extra 0000664 0000000 0000000 00000000153 12300436054 012776 0 ustar if [ "$1" = "remove" -o "$1" = "deconfigure" ]; then
update-alternatives --remove php /usr/bin/php5
fi
debian/php5enmod 0000664 0000000 0000000 00000014333 12300436054 011013 0 ustar #!/bin/sh
#
# php5enmod - a php5 module manager for Debian
#
# Copyright 2013 Ondřej Surý
#
# This program is licensed at your choice under the terms of the GNU General
# Public License version 2+ or under the terms of the PHP License 3.01.
#
# For GPL-2+:
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# For PHP 3.01:
# This source file is subject to version 3.01 of the PHP license,
# that is bundled with this package in the file LICENSE, and is
# available through the world-wide-web at the following url:
# http://www.php.net/license/3_01.txt
# If you did not receive a copy of the PHP license and are unable to
# obtain it through the world-wide-web, please send a note to
# license@php.net so we can mail you a copy immediately.
#
set -ue
SCRIPT_NAME=${0##*/}
QUIET=no
NEED_RESTART=no
MAINT_MODE=no
. /usr/share/php5/php5-helper
usage() {
[ -n "$@" ] && warning $@
echo "usage: ${SCRIPT_NAME} [ -s ALL|sapi_name ] module_name [ module_name_2 ]"
exit 1
}
enmods() {
local sapis="$1"
local mods="$2"
local register="$3"
local sapi
local mod
for mod in $mods; do
for sapi in $sapis; do
enmod_ret=0
enmod $sapi $mod || enmod_ret=$?
case $enmod_ret in
0)
NEED_RESTART=yes
record_state enabled $sapi $mod
;;
esac
done
if [ "$register" = "yes" ]; then
mod_registry register $mod
fi
done
}
dismods() {
local sapis="$1"
local mods="$2"
local register="$3"
local purge="$4"
local sapi
local mod
for mod in $mods; do
for sapi in $sapis; do
local dismod_ret=0
dismod $sapi $mod $purge || dismod_ret=$?
case $dismod_ret in
0)
NEED_RESTART=yes
record_state disabled $sapi $mod
;;
esac
done
if [ "$purge" = "yes" ]; then
remove_state enabled $sapi $mod
remove_state disabled $sapi $mod
mod_registry unregister $mod
elif [ "$register" = "yes" ]; then
mod_registry unregister $mod
fi
done
}
enmod() {
local sapi=$1
local modname=$2
if ! module_exists $modname; then
warning "Module $modname ini file doesn't exist under /etc/php5/mods-available"
return 1
fi
local priority=$(get_priority $sapi $modname)
local live_link=$(get_live_link $sapi $modname $priority)
local live_link_content=$(get_live_link_content $sapi $modname $priority)
module_cleanup $sapi $modname $priority
local module_state=0
php5query -q -s $sapi -m $modname || module_state=$?
case $module_state in
# module enabled, but re-enable the conf.d link just in case
0)
;;
# module not yet enabled
1)
;;
# module disabled by maintainer script
33)
;;
# module disabled by site administrator
# enable module only if not running in maintainer mode
32)
if [ "$MAINT_MODE" = "yes" ]; then
warning "Not enabling the ${modname} module for ${sapi} SAPI since the module"
warning "was disabled by local administrator."
return 1
fi
;;
34)
warning "Not enabling the ${modname} module for ${sapi} SAPI since module symlink"
warning "already exists in /etc/php5/${sapi}/conf.d with different content."
return 1
;;
# fail if we get any different result
*)
warning "Unable to get module state, run php5query -s $sapi -m $modname manually"
warning "and fix the module state."
return 1
esac
if [ -d "/etc/php5/$sapi/conf.d" ]; then
if [ ! -h "${live_link}" ]; then
ln -s "${live_link_content}" "${live_link}"
fi
else
warning "Directory /etc/php5/$sapi/conf.d doesn't exist, not enabling the module"
return 1
fi
return 0
}
dismod() {
local sapi=$1
local modname=$2
local purge=$3
if ! module_exists $modname; then
if [ "$purge" = "no" ]; then
warning "Module $modname ini file doesn't exist under /etc/php5/mods-available"
return 1
fi
fi
local priority=$(get_priority $sapi $modname)
local live_link=$(get_live_link $sapi $modname $priority)
local live_link_content=$(get_live_link_content $sapi $modname $priority)
module_cleanup $sapi $modname $priority
local module_state=0
php5query -q -s $sapi -m $modname || module_state=$?
case $module_state in
# module enabled
0)
;;
# module not enabled, but re-remove the link just in case
1|32|33)
;;
34)
warning "Not disabling module $modname for $sapi SAPI. The configuration was"
warning "modified by local administrator."
return 1
;;
# fail if we get any different result
*)
warning "Unable to get module state, run php5query -s $sapi -m $modname manually"
warning "and fix the module state."
return 1
esac
if [ -d "/etc/php5/$sapi/conf.d" ]; then
if [ -h "$live_link" ]; then
rm -f "$live_link"
fi
fi
return 0
}
sapis=
register=no
purge=no
while getopts pfs:mqr opt; do
case $opt in
r) register=yes;;
s)
if [ "$sapis" = "ALL" -o \( "$OPTARG" = "ALL" -a -n "$sapis" \) ]; then
warning "You cannot specify ALL and individual sapis"
usage
fi
sapis="${sapis}${sapis:+ }$OPTARG"
;;
m) MAINT_MODE=yes;;
p) purge=yes;;
q) QUIET=yes;;
\?) usage;;
esac
done
shift $(expr $OPTIND - 1)
mods=""
for mod in $@; do
mods="${mods}${mods:+ }${mod%%/*}"
done
if [ "$register" = "no" ]; then
sapis="${sapis:-ALL}"
if [ "$sapis" = "ALL" ]; then
register=yes
fi
fi
if [ "$sapis" = "ALL" ]; then
sapis=$(php5query -S)
fi
[ -z "$mods" ] && usage
case "${SCRIPT_NAME}" in
php5enmod)
enmods "$sapis" "$mods" "$register"
;;
php5dismod)
dismods "$sapis" "$mods" "$register" "$purge"
;;
*)
usage
;;
esac
exit 0
debian/php5query 0000775 0000000 0000000 00000012061 12300436054 011055 0 ustar #!/bin/sh
#
# php5query - a php5 module manager for Debian
#
# Copyright 2013 Ondřej Surý
#
# This program is licensed at your choice under the terms of the GNU General
# Public License version 2+ or under the terms of the PHP License 3.01.
#
# For GPL-2+:
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# For PHP 3.01:
# This source file is subject to version 3.01 of the PHP license,
# that is bundled with this package in the file LICENSE, and is
# available through the world-wide-web at the following url:
# http://www.php.net/license/3_01.txt
# If you did not receive a copy of the PHP license and are unable to
# obtain it through the world-wide-web, please send a note to
# license@php.net so we can mail you a copy immediately.
#
set -ue
SCRIPT_NAME=${0##*/}
QUIET=no
. /usr/share/php5/php5-helper
usage() {
[ -n "$@" ] && warning $@
echo "usage: ${SCRIPT_NAME} [ -q ] -s sapi_name [ -m module_name ] [ -M ] [ -S ]"
exit 1
}
check_mod() {
local sapi=$1
local modname=$2
if ! module_exists $modname; then
output "No module matches $modname"
return 1
fi
local priority=$(get_priority $sapi $modname)
local live_link=$(get_live_link $sapi $modname $priority)
local live_link_content=$(get_live_link_content $sapi $modname $priority)
found=no
if [ -e "${live_link}" ] ; then
if [ -h "${live_link}" ] ; then
local content="$(readlink "${live_link}")"
if [ "${content}" = "${live_link_content}" ] ; then
found=yes
fi
fi
if [ "$found" != "yes" ]; then
output "Module $modname symlink was modified by local administrator."
return 34
fi
fi
local state_dir="$(get_state_dir $sapi)"
if [ -e "${state_dir}/enabled_by_admin/$modname" ]; then
output "$modname (Enabled for $sapi by local administrator)"
return 0
elif [ -e "${state_dir}/enabled_by_maint/$modname" ]; then
output "$modname (Enabled for $sapi by maintainer script)"
return 0
elif [ -e "${state_dir}/disabled_by_admin/$modname" ]; then
output "No module matches $modname (Disabled for $sapi by local administrator)"
return 32
elif [ -e "${state_dir}/disabled_by_maint/$modname" ]; then
output "No module matches $modname (Disabled for $sapi by maintainer script)"
return 33
elif [ "$found" = "yes" ]; then
output "$modname (Enabled for $sapi by unknown)"
return 0
else
output "No module matches $modname"
return 1
fi
}
list_mod() {
local verbose=$1
local registry_dir="$(get_registry_dir)"
sapis=$(list_sapi)
if [ -d "$registry_dir" ]; then
for mod in $(list_parts "$registry_dir"); do
if [ "$verbose" = "yes" ]; then
for sapi in $sapis; do
check_mod $sapi $mod
done
else
echo $mod
fi
done
return 0
fi
}
list_sapi() {
local sapi_dir="$(get_sapi_dir)"
if [ -d "$sapi_dir" ]; then
for sapi in $(list_parts "$sapi_dir"); do
echo $sapi;
done
fi
}
check_sapi() {
local sapi=$1
local sapi_dir="$(get_sapi_dir)"
if [ -e "$sapi_dir/$sapi" ]; then
return 0
fi
return 1
}
QUIET=no
verbose=no
action=
sapi=
while getopts s:m:SMqv opt; do
case $opt in
s)
if [ -n "$action" ]; then
if [ "$action" != "check_mod" ]; then
usage "Only one mode of operation can be used at the same time."
else
action="check_sapi"
fi
fi
sapi="$OPTARG"
;;
S)
if [ -n "$action" ]; then
usage "Only one mode of operation can be used at the same time."
fi
action="list_sapi"
;;
m)
if [ -n "$action" -a "$action" != "check_sapi" ]; then
usage "Only one mode of operation can be used at the same time."
fi
action="check_mod"
mod="$OPTARG"
;;
M)
[ -n "$action" ] && usage "Only one mode of operation can be used at the same time."
action="list_mod"
;;
q)
QUIET=yes
;;
v)
verbose=yes
;;
\?) usage "Unknown parameter specified";;
esac
done
shift $(expr $OPTIND - 1)
if [ -z "$action" ]; then
usage "You need to specify at least one action."
fi
if [ -n "$sapi" ]; then
check_sapi $sapi || usage "Invalid SAPI specified"
fi
ret=0
case "$action" in
check_mod)
[ -z "$sapi" ] && usage "You need to specify sapi"
check_mod $sapi $mod || ret=$?
;;
check_sapi)
check_sapi $sapi || ret=$?
if [ "$ret" -eq 0 ]; then
output "$sapi"
fi
;;
list_mod) list_mod $verbose || ret=$?;;
list_sapi) list_sapi || ret=$?;;
*) usage "Unknown action $action"
esac
exit $ret
debian/tests/ 0000775 0000000 0000000 00000000000 12300436341 010326 5 ustar debian/tests/cgi 0000664 0000000 0000000 00000001536 12300436326 011023 0 ustar #!/bin/sh
set -e
# Author: Robie Basak
# /etc/apache2/conf-available/php5-cgi.conf should exist. If this is renamed
# to /etc/apache2/conf-available/php5-cgi in the future, then this test needs
# to be updated.
if [ ! -f /etc/apache2/conf-available/php5-cgi.conf ]; then
echo "/etc/apache2/conf-available/php5-cgi.conf not found" >&2
exit 1
fi
echo "Action application/x-httpd-php /cgi-bin/php5" >> /etc/apache2/conf-available/php5-cgi.conf
cat > /var/www/html/hello.php <
EOT
# Make sure that any mod_php mechanism is disabled, since we want to get CGI
# mode here.
a2dismod php5 2>/dev/null || true
a2enmod actions
a2enmod cgi 2>/dev/null
a2enconf php5-cgi
service apache2 restart 2>/dev/null
result=`wget -O- http://localhost/hello.php 2>/dev/null`
test "$result" = "Hello, world!"
debian/tests/control 0000664 0000000 0000000 00000000243 12300436341 011730 0 ustar Tests: cli
Depends: php5-cli
Tests: cgi
Depends: apache2, php5-cgi
Restrictions: needs-root
Tests: mod-php
Depends: libapache2-mod-php5
Restrictions: needs-root
debian/tests/mod-php 0000664 0000000 0000000 00000000754 12300436326 011626 0 ustar #!/bin/sh
set -e
# Author: Robie Basak
cat > /var/www/html/hello.php <
EOT
# Make sure that any CGI mechanism is disabled, since we want to test mod_php
# mode here.
a2dismod actions 2>/dev/null || true
a2dismod cgi 2>/dev/null || true
a2disconf php5-cgi 2>/dev/null || true
a2enmod php5 2>/dev/null
service apache2 restart 2>/dev/null
result=`wget -O- http://localhost/hello.php 2>/dev/null`
test "$result" = "Hello, world!"
debian/tests/cli 0000664 0000000 0000000 00000000304 12300436326 011020 0 ustar #!/bin/sh
set -e
# Author: Robie Basak
cd "$ADTTMP"
cat > hello.php <
EOT
result=`php5 hello.php`
test "$result" = "Hello, world!"
debian/php5-helper 0000664 0000000 0000000 00000011125 12300436054 011241 0 ustar #!/bin/sh
#
# php5enmod - a php5 module manager for Debian
#
# Copyright 2013 Ondřej Surý
#
# This program is licensed at your choice under the terms of the GNU General
# Public License version 2+ or under the terms of the PHP License 3.01.
#
# For GPL-2+:
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# For PHP 3.01:
# This source file is subject to version 3.01 of the PHP license,
# that is bundled with this package in the file LICENSE, and is
# available through the world-wide-web at the following url:
# http://www.php.net/license/3_01.txt
# If you did not receive a copy of the PHP license and are unable to
# obtain it through the world-wide-web, please send a note to
# license@php.net so we can mail you a copy immediately.
#
warning() {
echo "WARNING: ${@}" >&2
}
remove_state() {
local action=$1
local sapi=$2
local modname=$3
local state_dir="$(get_state_dir $sapi)"
rm -f "${state_dir}/${action}_by_admin/$modname"
rm -f "${state_dir}/${action}_by_maint/$modname"
return 0
}
mod_registry() {
local action=$1
local modname=$2
local registry_dir="$(get_registry_dir)"
local registry_file="$registry_dir/$modname"
case $action in
register)
if [ ! -d "$registry_dir" ]; then
mkdir -p "$registry_dir"
fi
touch "$registry_file"
;;
unregister)
rm -f "$registry_file"
;;
status)
if [ -e "$registry_file" ]; then
return 0
else
return 1
fi
;;
*)
return 1
;;
esac
return 0
}
record_state() {
local action=$1
local sapi=$2
local modname=$3
local state_dir="/var/lib/php5/modules/${sapi}"
local admin_state="${state_dir}/${action}_by_admin/$modname"
local maint_state="${state_dir}/${action}_by_maint/$modname"
if [ -e "$admin_state" ]; then
return
fi
if [ -e "$maint_state" ]; then
if [ "$MAINT_MODE" = "yes" ]; then
return
else
rm "$maint_state"
fi
fi
# cleanup previous state
remove_state disabled $sapi $modname
remove_state enabled $sapi $modname
if [ "$MAINT_MODE" = "yes" ]; then
mkdir -p "$(dirname $maint_state)"
touch "$maint_state"
else
mkdir -p "$(dirname $admin_state)"
touch "$admin_state"
fi
return 0
}
output() {
if [ "$QUIET" != "yes" ]; then
echo "$@"
fi
}
get_priority() {
local sapi=$1
local modname=$2
local source_ini="/etc/php5/mods-available/${modname}.ini"
module_ret=0
module_exists $modname || module_ret=$?
if [ "$module_ret" -eq 0 ]; then
priority=$(sed -ne "s/^; priority=\([0-9]\+\)$/\\1/p" $source_ini)
[ -z "$priority" ] && priority=20
echo $priority
return 0
fi
return $module_ret
}
get_live_link() {
local sapi=$1
local modname=$2
local priority=$3
echo "/etc/php5/$sapi/conf.d/$priority-$modname.ini"
}
get_live_link_content() {
local sapi=$1
local modname=$2
local priority=$3
echo "../../mods-available/$modname.ini"
}
module_exists() {
local modname=$1
local source_ini="/etc/php5/mods-available/${modname}.ini"
if [ ! -r "${source_ini}" ]; then
return 1
fi
return 0
}
module_cleanup() {
local sapi=$1
local modname=$2
local priority=$3
if [ -L "/etc/php5/conf.d/$priority-$modname.ini" ]; then
rm "/etc/php5/conf.d/$priority-$modname.ini";
fi
}
get_state_dir() {
local sapi=$1
echo "/var/lib/php5/modules/$sapi"
return 0
}
get_registry_dir() {
echo "/var/lib/php5/modules/registry"
return 0
}
get_sapi_dir() {
echo "/usr/share/php5/sapi"
return 0
}
list_parts() {
local dir=$1
local regex=${2:-}
local args="! ( -name '*.dpkg-old' -name '*.dpkg-new' -name '*.dpkg-dist' -name '*~' -name '*.bak' -name '*.ucf-old' -name '*.ucf-new' -name '*.ucf-dist' -name '*%' )"
if [ -d "$dir" ]; then
if [ -n "$regex" ]; then
args="${args} -regex '$regex'"
fi
find "$dir" -mindepth 1 -maxdepth 1 -printf '%f\n' $args
return $?
else
return 1
fi
}
debian/php5-sybase.postrm.extra 0000664 0000000 0000000 00000000117 12300436054 013714 0 ustar dpkg-maintscript-helper rm_conffile /etc/php5/conf.d/mssql.ini 5.2.3-1 -- "$@"
debian/libapache2-mod-php5filter.dirs 0000664 0000000 0000000 00000000154 12300436054 014677 0 ustar /etc/apache2/mods-available
/etc/php5/apache2filter
/etc/php5/apache2filter/conf.d
/usr/lib/apache2/modules
debian/php5filter.load 0000664 0000000 0000000 00000000101 12300436054 012100 0 ustar LoadModule php5_module /usr/lib/apache2/modules/libphp5filter.so
debian/php5-sapi.bug.script 0000775 0000000 0000000 00000001110 12300436054 012771 0 ustar #!/bin/sh
MATCH="^[[:space:]]*($|;)"
echo "==== Additional PHP 5 information ====" >&3
echo "" >&3
echo "++++ PHP 5 SAPI (php5query -S): ++++" >&3
/usr/sbin/php5query -S >&3
echo "" >&3
echo "++++ PHP 5 Extensions (php5query -M -v): ++++" >&3
/usr/sbin/php5query -M -v >&3
echo "" >&3
echo "++++ Configuration files: ++++" >&3
"**** /etc/php5/@sapi@/php.ini ****" >&3
grep -Ev "$MATCH" /etc/php5/@sapi@/php.ini >&3
echo "" >&3
find /etc/php5/@sapi@/conf.d/ -name '*.ini' | \
while read CONF; do
echo "**** $CONF ****" >&3
grep -Ev "$MATCH" "$CONF" >&3
echo "" >&3
done
debian/php5-common.php5.cron.d 0000664 0000000 0000000 00000000776 12300436054 013321 0 ustar # /etc/cron.d/php5: crontab fragment for php5
# This purges session files older than X, where X is defined in seconds
# as the largest value of session.gc_maxlifetime from all your php.ini
# files, or 24 minutes if not defined. See /usr/lib/php5/maxlifetime
# Look for and purge old sessions every 30 minutes
09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime)
debian/php5-fpm-checkconf 0000664 0000000 0000000 00000000353 12300436054 012466 0 ustar #!/bin/sh
set -e
errors=$(/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/php-fpm.conf -t 2>&1 | grep "\[ERROR\]" || true);
if [ -n "$errors" ]; then
echo "Please fix your configuration file..."
echo $errors
exit 1
fi
exit 0
debian/libapache2-mod-php5.dirs 0000664 0000000 0000000 00000000140 12300436054 013464 0 ustar /etc/apache2/mods-available
/etc/php5/apache2
/etc/php5/apache2/conf.d
/usr/lib/apache2/modules
debian/php5-fpm.init 0000664 0000000 0000000 00000010463 12300436054 011512 0 ustar #!/bin/sh
### BEGIN INIT INFO
# Provides: php-fpm php5-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php5-fpm
# Description: Starts The PHP FastCGI Process Manager Daemon
### END INIT INFO
# Author: Ondrej Sury
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="PHP5 FastCGI Process Manager"
NAME=php5-fpm
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS="--daemonize --fpm-config /etc/php5/fpm/php-fpm.conf"
PIDFILE=/var/run/php5-fpm.pid
TIMEOUT=30
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# Don't run if we are running upstart
if init_is_upstart; then
exit 1
fi
#
# Function to check the correctness of the config file
#
do_check()
{
/usr/lib/php5/php5-fpm-checkconf || return 1
return 0
}
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS 2>/dev/null \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=QUIT/$TIMEOUT/TERM/5/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/TERM/5/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal USR2 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_check $VERBOSE
case "$?" in
0)
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
1) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
check)
do_check yes
;;
reload|force-reload)
log_daemon_msg "Reloading $DESC" "$NAME"
do_reload
log_end_msg $?
;;
reopen-logs)
log_daemon_msg "Reopening $DESC logs" $NAME
if start-stop-daemon --stop --signal USR1 --oknodo --quiet \
--pidfile $PIDFILE --exec $DAEMON
then
log_end_msg 0
else
log_end_msg 1
fi
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload}" >&2
exit 1
;;
esac
:
debian/libapache2-mod-php5.postinst.extra 0000664 0000000 0000000 00000001477 12300436054 015546 0 ustar if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
php5_enable() {
mpm=$(a2query -M)
case "$(a2query -M)" in
prefork|itk) return 0;;
*) if apache2_switch_mpm prefork; then return 0; fi;;
esac
apache2_msg err "Could not switch to prefork MPM, not enabling php5"
return 1
}
else
echo "Warning: Could not load Apache 2.4 maintainer script helper."
php5_enable() {
return 1;
}
fi
# we've registered a trigger to handle extension updates.
if [ "$1" = "triggered" ] && [ "$2" = "/etc/php5/apache2/conf.d" ]; then
if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
apache2_reload restart
fi
exit 0
elif [ "$1" != "configure" ]; then
exit 0
fi
debian/php5-fpm.upstart 0000664 0000000 0000000 00000001045 12321265412 012246 0 ustar # php5-fpm - The PHP FastCGI Process Manager
description "The PHP FastCGI Process Manager"
author "Ondřej Surý "
start on runlevel [2345]
stop on runlevel [016]
# Precise upstart does not support reload signal, and thus rejects the
# job. We'd rather start the daemon, instead of forcing users to
# reboot https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1272788
#
# reload signal USR2
pre-start exec /usr/lib/php5/php5-fpm-checkconf
respawn
exec /usr/sbin/php5-fpm --nodaemonize --fpm-config /etc/php5/fpm/php-fpm.conf
debian/php5-dev.postinst 0000664 0000000 0000000 00000000426 12300436054 012424 0 ustar #!/bin/sh
set -e
if [ "$1" = "configure" ]; then
for i in php-config phpize; do
update-alternatives \
--install /usr/bin/"$i" $i /usr/bin/"$i"5 50 \
--slave /usr/share/man/man1/"$i".1.gz "$i".1.gz /usr/share/man/man1/"$i"5.1.gz
done
fi
#DEBHELPER#
exit 0
debian/php5-cli.postinst.extra 0000664 0000000 0000000 00000000270 12300436054 013534 0 ustar if [ "$1" = "configure" ]; then
update-alternatives \
--install /usr/bin/php php /usr/bin/php5 50 \
--slave /usr/share/man/man1/php.1.gz php.1.gz /usr/share/man/man1/php5.1.gz
fi debian/php5-dev.files 0000664 0000000 0000000 00000000175 12300436054 011644 0 ustar usr/bin/php-config
usr/bin/phpize
usr/share/man/man1/php-config.1
usr/share/man/man1/phpize.1
usr/include
usr/lib/php5/build
debian/php5-sqlite.postinst.extra 0000664 0000000 0000000 00000000117 12300436054 014266 0 ustar dpkg-maintscript-helper rm_conffile /etc/php5/conf.d/sqlite.ini 5.3.9~ -- "$@"
debian/compat 0000664 0000000 0000000 00000000002 12300436054 010363 0 ustar 5
debian/php5-common.README.Debian 0000664 0000000 0000000 00000022006 12300436054 013367 0 ustar Table of Contents:
----------------------------------------------------------------------
* Using PHP 5 with threaded webservers (e.g. apache2-mpm-worker)
* Problems starting Apache HTTP Server with PHP 5
* Session storage
* Other caveats
* PHP 5 and Apache 2 Multiviews (HTTP Content Negotiation)
* PHP 5 CGI and Apache HTTP Server
* Configuration layout
* Timezone data from system timezone database
* Further documentation, errata, etc
Using PHP 5 with threaded webservers (e.g. apache2-mpm-worker)
----------------------------------------------------------------------
After much back-and-forth with upstream (and even building our
packages thread-safe for a while), we're currently admitting defeat
on that front, and are NOT building any thread-safe versions of PHP
5 for any webservers. Our recommendation is that, if you need to use
a threaded webserver, you should use php5-fpm and interface to your
webserver with FastCGI.
Problems starting Apache HTTP Server with PHP 5
----------------------------------------------------------------------
At the time of writing, there are no *known* incompatibilities
between any of the PHP 5 modules we ship. However, there have been
many bug reports in the past due to dynamically-loaded extensions,
and it's possible there are still bugs in the released packages. If
Apache fails to start after you install PHP 5, check your list of
enabled extensions at the bottom of /etc/php5/apache2/php.ini (and
in the per-SAPI configuration directory), and try commenting out or
reordering the extensions until you find a combination that works.
For example, in the past the mhash extension was incompatible with
some other common extensions. To work around this, you could list
the mhash extension first in php.ini.
If you find an extension-related bug in the Debian packages, and you
are willing to help debug the problem, please send us a bug report
that lists all enabled PHP 5 extensions (extension=), in the order
in which they appear in php.ini, as well as all enabled Apache
modules (LoadModule), with version numbers where possible.
Session storage
----------------------------------------------------------------------
Session files are stored in /var/lib/php5. For security purposes,
this directory is unreadable to non-root users. This means that PHP
5 running from Apache HTTP Server, for example, will not be able to
clean up stale session files. Instead, we have a cron job run every
30 minutes that cleans up stale session files; /etc/cron.d/php5. You
may need to modify how often this runs, if you've modified
session.gc_maxlifetime in your php.ini; otherwise, it may be too lax
or overly aggressive in cleaning out stale session files.
Other caveats
----------------------------------------------------------------------
Configuration directives extension_dir and include_path should be
commented out, unless you need special settings for them so PHP will
look in compiled-in paths. If you set them, you should also add
appropriate PHP install directories there.
PHP 5 and Apache 2 Multiviews (HTTP Content Negotiation)
----------------------------------------------------------------------
Apache 2’s mod_negotiation needs files to have a MIME-Type (amongst
others) associated with them in order to be considered for HTTP
content negotiation.
Per default, the Debian PHP packages use Apache 2 handlers
(SetHandler directive) to enable PHP interpretation, while no
MIME-Type is being associated with the common PHP file extensions.
Thus, by default, the HTTP content negotiation is disabled for PHP
file extensions.
Possible use cases:
1) You intend to use HTTP content negotiation in order to tidy up URLs:
For example, you wanted the file “http://example.org/foo.php”
being accessible as “http://example.org/foo”, too. In that case
you really shouldn’t abuse mod_negotiation but use mod_rewrite.
An example of rewrite-rules, which allow any file ending in “.php”
to be accessed without this extension is:
RewriteCond "%{REQUEST_FILENAME}" !-f
RewriteCond "%{REQUEST_FILENAME}" !-d
RewriteRule "^(.*)$" "$1.php" [last]
Depending on your setup you may need to set other flags, too,
especially “passthrough” or “qsappend”.
2) You really wanted to use HTTP content negotiation on PHP files
(be they interpreted or not).
An example for this might be, when you have the files
http://example.org/foo.php
http://example.org/foo.js
which both do the same job, but the former is executed as PHP on
the server-side, while the later is executed as JavaScript on the
client-side.
If you really want it, just add MIME type definitions for file
extensions you need to your Apache 2 configuration. For example
to recognize php and phps extensions you would add:
AddType application/x-php php
AddType application/x-php-source phps
This scenario is really very rarely used (if at all)!
PHP 5 CGI and Apache HTTP Server
----------------------------------------------------------------------
In simple cases, what you probably want isn't the php5-cgi package
at all, but rather the libapache2-mod-php5 package, which will
configure itself on installation and Just Work(tm). However, if you
have a need to use the CGI version of PHP 5 with Apache HTTP Server,
the following should help get you going, though there are dozens of
different ways to do this.
The current recommended approach is to install the php5-fpm package
and use FastCGI to interface to your webserver. However, you will
have to use the libapache2-mod-fastcgi package (from non-free) or a
different FastCGI-capable webserver (such as nginx or lighttpd),
since the libapache2-mod-fcgid available from the main archive has
no way of interacting with external FastCGI servers.
Please note that this process will never be made automatic, as
php5-cgi is meant to be a webserver-agnostic package that can be
used with any httpd, and we don't want it to conflict with the
httpd-specific packages such as libapache2-mod-php5. If both were
installed side-by-side and both were automatically enabled, the
results would be a bit confusing, obviously.
You should also be aware that a server deployed in CGI mode is open
to several possible vulnerabilities. See the upstream CGI security
page to learn how to defend yourself from such attacks:
http://www.php.net/manual/en/security.cgi-bin.php
To use php5-cgi with Apache HTTP Server:
1) activate php5_cgi module: run 'a2enconf php5-cgi'
2) this will also activate the mod_actions module as a dependency
3) comment out the last block of configuration in the
/etc/apache2/mods-enabled/php5_cgi.conf file to enable
server-wide PHP 5 CGI or add the mentioned configuration block to
one or more virtual hosts or directories.
4) It's advised to not mix-and-match multiple SAPIs (such as
php5-cgi along with libapache2-mod-php5) in the same apache2
configuration as it is likely to create unpredictable results.
Configuration Layout
----------------------------------------------------------------------
Each SAPI (apache2/apache2filter/cgi/cli/fpm) has a different
central configuration file /etc/php5/$SAPI/php.ini.
Additionally, each SAPI is configured with the compile-time option
--with-config-file-scan-dir=/etc/php5/$SAPI/conf.d
which for all SAPIs is actually a symlink pointing to a central
directory /etc/php5/conf.d. Any file found in this directory ending
in .ini will be treated as a configuration file by the PHP SAPI.
The rationale behind this method is that each SAPI can thus be
identically configured with a minimal amount of conffile handling,
but at the same time if you want to have SAPI-specific
configuration, you can just remove the symlink.
Note that the usage of the PHP_INI_SCAN_DIR environment variable
overrides what is set with --with-config-file-scan-dir and thus the
directory /etc/php5/$SAPI/conf.d will no longer be included.
Timezone data from system timezone database
----------------------------------------------------------------------
Debian PHP has been patched to use the system wide timezone database
from the tzdata package, making sure any updates there are
automatically used by PHP as well.
Note that this requires that the PHP process has access to
/etc/localtime and /usr/share/zoneinfo. For any regular installation
this should be the case, but in specific secured environments when
reading the timezone database is impossible PHP will give a
"Timezone database is corrupt - this should *never* happen!" error.
Further documentation, errata, misc.
----------------------------------------------------------------------
Errata and other general information about PHP in Debian can be
found in the debian wiki at:
http://wiki.debian.org/PHP
If after reading the documentation in this file you still have
unanswered questions, that's a good next place to go.
-- Ondřej Surý , Sun, 5 May 2013 22:00:06 +0200
debian/debhelper/ 0000775 0000000 0000000 00000000000 12300436054 011117 5 ustar debian/debhelper/postrm-php5 0000664 0000000 0000000 00000000347 12300436054 013244 0 ustar if [ "$1" = "purge" ] ; then
if [ -e /usr/share/php5/php5-maintscript-helper ] ; then
. /usr/share/php5/php5-maintscript-helper
for conf in #NAMES# ; do
php5_invoke #HELPER# ALL $conf || #ERROR_HANDLER#
done
fi
fi
debian/debhelper/postinst-php5 0000664 0000000 0000000 00000000312 12300436054 013573 0 ustar if [ -e /usr/share/php5/php5-maintscript-helper ] ; then
. /usr/share/php5/php5-maintscript-helper
for conf in #NAMES# ; do
php5_invoke #HELPER# ALL $conf || #ERROR_HANDLER#
done
fi
debian/debhelper/dh_php5 0000775 0000000 0000000 00000027346 12300436054 012410 0 ustar #! /usr/bin/perl
# dh_php5 - PHP 5 configuration helper for debhelper
# Copyright (C) 2012 Arno Töll
# 2013 Ondřej Surý
#
# This program is licensed at your choice under the terms of the GNU General
# Public License vserion 2+ or under the terms of the Apache Software License
# 2.0.
#
# For GPL-2+:
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# For ASF 2.0:
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use strict;
use File::Find;
use Debian::Debhelper::Dh_Lib;
=head1 NAME
dh_php5 - register configuration snippets to the PHP 5
=cut
# auto-generated do not edit
our $API = `php-config --phpapi`;
our $MODULE_DIR = `php-config --extension-dir`;
our $SERVER_VERSION = `php-config --version`;
sub php5_api_version
{
return "phpapi-$API";
}
sub php5_version
{
return ">= $SERVER_VERSION~";
}
sub php5_api_installdir
{
return $MODULE_DIR;
}
sub php5_conf_installdir
{
my $type = shift;
return "etc/php5/${type}-available/"
}
=head1 SYNOPSIS
B [S>] [S>=I] [B<--error-handler=>I] [B<-n>|B<--noscripts>]
=head1 DESCRIPTION
B is a debhelper program that is responsible for correctly installing
Php5 configuration snippets and setting postinst, prerm and dependencies in
Php5 web server modules and web applications.
It supports the following configuration types
=over 4
=item *
PHP 5 modules
=item *
PHP 5 configuration snippets
=back
B supports two modes: A limited auto-configuration heuristic or
alternatively a configuration file driven approach. If a file named
debian/package.php5 exists, actual actions are determined by that file.
=head1 OPERATION MODES
B can be used in two modes: A configuration file driven approach and
a heuristic approach. The configuration driven mode is fully documented in the
B section below. This mode is activated by supplying a L
configuration file (e.g. debian/I.php5).
The alternative is a heuristic mode, in which no files are installed through
B. Instead the helper will scan the package installation directory
for recognized files and guess their purpose depending on their installation
path in the file system. Use with caution.
=head1 INVOKATION
B is not part of debhelper and might require information available
in the php5-dev package. Packages making use of B should declare
a build-dependency against the virtual B package.
B supports both, called directly from a debian/rules file or as
L addon. In the former case the helper should run after L
or their respective counter parts in local implementations at earliest.
Alternatively it can be used as L addon by invoking it with
%:
dh $@ --with php5
=head1 FILES
=over 4
=item debian/I.php5
=item debian/php5
=back
Lists files to be registered with the PHP 5. The file is interpreted
as line separated list of installation stanzas, where each entry
consists of whitespace separated values conforming to the file
semantics below.
=head2 FILE SEMANTICS
Each line consists of a triple
I I [I]
where the values are interpreted as follows:
=head3 I
Denotes the type of file to be installed. Recognized values are B
for PHP 5 global configuration snippets and B for PHP 5 modules.
=head3 I
Is interpreted as existing file name within the source package. No path
expansion is effectuated. Just like L, B can not
rename files.
=head2 GLOBAL CONFIGURATION FILES
Global configuration files (determined by the B type) must have a I<.conf>
suffix and are installed to I. Moreover, the
configuration is activated in the maintainer script at installation time.
Such global configuration snippets are supposed to be used by web applications.
Such stanzas accept an optional third I which is interpreted as
dependency line of alternative web servers the package supports. See I
below.
B will set dependencies in B<${misc:Recommends}> accordingly when
this type of configuration is found. Alternatives from the optional I
is incorporated into this dependency line.
=head2 MODULES
Modules are handled specially and are determined by the B type. Modules can
either have a I<.conf> or I<.load> suffix. In that case the file is interpreted
as module load file or module configuration file respectively and is installed to
I. If the file is ending with a I<.so> suffix it is
interpreted as actual module shared object and is installed to the PHP 5 module
directory. Moreover, if a I<.load> file is installed the configuration is
activated in the maintainer script at installation time.
A typical module configuration has two lines, one for the I<.load> file, and one
for the I<.so> file, albeit the latter could be installed by upstream's
makefile, too.
B will set dependencies in B<${misc:Depends}> accordingly when
this type of configuration is found.
=head1 OPTIONS
=over 4
=item B<--error-handler=>I
Call the named shell I if running the maintainer script fails. The
function should be provided in the F and F scripts, before the
B<#DEBHELPER#> token.
=item B<-e>, B<--noenable>
Install maintainer scripts accordingly, but do not enable the scripts or
configuration by default.
=item B<-n>, B<--noscripts>
Do not modify F/F/F maintainer scripts.
=back
=head1 NOTES
Note that this command is not idempotent. L should be called
between invocations of this command. Otherwise, it may cause multiple
instances of the same text to be added to maintainer scripts.
=head1 EXAMPLES
The examples below lists valid entries for a debian/I.php5 file. For
example, the two lines below install a fictional I PHP 5 module along
a Debian specific I<.ini> file:
mod src/foo/mod_foo.so
mod debian/foo.ini
=head1 SEE ALSO
L(8), L(8), L(7), L(1)
=head1 AUTHOR
This manual and L was written by Arno Toell
for Apache 2 and modified for PHP 5 by Ondřej Surý .
=cut
##
## main code starts here
##
init(options => {
"e|noenable" => \$dh{NOENABLE},
});
foreach my $package ((@{$dh{DOPACKAGES}}))
{
my %PACKAGE_TYPE = (
has_a_module => [],
has_a_conf_file => [],
dependency_line => "",
handler => $dh{ERROR_HANDLER},
);
my $file = pkgfile($package, "php5");
my $tmp = tmpdir($package);
my @files_to_register = filedoublearray($file, ".") if $file;
foreach my $line (@files_to_register)
{
my $type = lc(shift @{$line}) if $line->[0];
my $source = shift @{$line} if $line->[0];
my @arguments = map {"$_ "} @{$line};
$type .= "s" unless $type eq "conf";
my $installdir = $tmp . "/" . php5_conf_installdir($type);
if ($type eq "mods" or $type eq "conf")
{
my $basesource = basename($source);
if ($type eq "mods")
{
if ($basesource =~ m/\.ini$/)
{
my $enablename = $basesource;
$enablename =~ s/\.ini$//;
push @{$PACKAGE_TYPE{'has_a_module'}}, $enablename;
verbose_print("Installing module configuration $enablename into $installdir\n");
}
elsif ($basesource =~ m/\.so$/)
{
my $modinstalldir = $tmp . "/" . php5_api_installdir();
verbose_print("Installing module binary $source into $modinstalldir\n");
if (! -d $modinstalldir)
{
complex_doit("mkdir","-p", $modinstalldir);
complex_doit("chmod","755","$modinstalldir");
}
complex_doit("cp", $source, $modinstalldir);
next;
}
error("module: \"$basesource\" needs .so or .ini suffix") if $basesource !~ m/\.(ini|so)/;
}
if (! -d $installdir)
{
complex_doit("mkdir","-p",$installdir);
complex_doit("chmod","755","$installdir");
}
complex_doit("cp",$source,$installdir);
complex_doit("chmod","644","$installdir/$basesource");
}
else
{
error("Unknown parameter: $type\n");
}
}
if (! $file)
{
# do black magic only if there is no .php5 configuration file
find({ no_chdir => 1,
wanted => sub
{
my ($dir, $file) = (dirname($File::Find::name), basename($File::Find::name));
# remove extension
my $conf_name = $file;
$conf_name =~ s/\.[^.]+$//;
if ($dir =~ m#etc/php5/mods-available# and $file =~ m#.(load|conf)$#)
{
verbose_print("package $package appears to be a web server module\n");
push @{$PACKAGE_TYPE{'has_a_module'}}, $conf_name if $file =~ m/\.load/;
}
if ($dir =~ m#etc/php5/conf-available# and $file =~ m#.conf$#)
{
verbose_print("package $package appears to contain a global configuration file \n");
push @{$PACKAGE_TYPE{'has_a_conf_file'}}, $conf_name;
}
}}, tmpdir($package));
}
my @postinst_autoscripts;
if ($#{$PACKAGE_TYPE{'has_a_module'}} >= 0)
{
if ($package !~ m/php5-\w+?/)
{
warning("Package $package appears to be an PHP 5 module. It should comply to the package naming scheme php5-\n");
}
addsubstvar($package, "misc:Depends", php5_api_version());
my $modules = "";
foreach my $module (@{$PACKAGE_TYPE{'has_a_module'}})
{
$modules .= "$module ";
}
push @postinst_autoscripts, ["enmod", $modules];
}
if ($#{$PACKAGE_TYPE{'has_a_conf_file'}} >= 0)
{
$PACKAGE_TYPE{'dependency_line'} .= "| php5";
addsubstvar($package, "misc:Recommends", "php5 (" . php5_version() . ") " . $PACKAGE_TYPE{'dependency_line'} );
my $confs = "";
foreach my $conf (@{$PACKAGE_TYPE{'has_a_conf_file'}})
{
$confs .= "$conf ";
}
if ($confs)
{
push @postinst_autoscripts, ["enconf", $confs];
}
}
if (! $dh{NOSCRIPTS})
{
foreach my $ref (@postinst_autoscripts)
{
for my $script_type (qw/postinst prerm postrm/)
{
if ($script_type eq "postinst" && $dh{NOENABLE})
{
next
}
my %replacements = (
HELPER => $ref->[0],
NAMES => $ref->[1],
ERROR_HANDLER => $PACKAGE_TYPE{handler}
);
if ($script_type eq "prerm" || $script_type eq "postrm")
{
$replacements{'HELPER'} =~ s/en/dis/;
}
my $sed_command = "";
foreach my $key (sort keys %replacements)
{
my $val = $replacements{$key};
# Use a control char as separator for sed, to
# reduce escaping issues. Everything else is
# passed verbatim, i.e. it must not contain any
# shell or sed special characters.
my $sep = "\x17";
$sed_command .= "s" . $sep . "#$key#" .
$sep . $val .
$sep . "g; ";
}
autoscript($package, "$script_type", "$script_type-php5", $sed_command);
}
}
}
}
# vim: syntax=perl sw=8 sts=8 sr noet
debian/debhelper/prerm-php5 0000664 0000000 0000000 00000000405 12300436054 013040 0 ustar if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
if [ -e /usr/share/php5/php5-maintscript-helper ] ; then
. /usr/share/php5/php5-maintscript-helper
for conf in #NAMES# ; do
php5_invoke #HELPER# ALL $conf || #ERROR_HANDLER#
done
fi
fi
debian/debhelper/php5-maintscript-helper 0000664 0000000 0000000 00000021604 12300436054 015531 0 ustar # php5-maintscript-helper - Php5 helper function for maintainer scripts
# Copyright (C) 2012 Arno Töll
# 2013 Ondřej Surý
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# VARIABLES
#
# global environment variables used by php5-maintscript-helper:
# * PHP5_MAINTSCRIPT_DEBUG:
# set this to any non-zero value to get debug output
# * PHP5_MAINTSCRIPT_HELPER_QUIET:
# set this to any non-zero value to omit any output
# * EXPORT_PHP5_MAINTSCRIPT_HELPER:
# will be defined by php5-maintscript-helper
# to avoid inclusion loops. Do not set this
# variable manually
# * PHP5_NEED_ACTION:
# will be defined if a function call wants to
# override the behavior of php5_needs_action.
# Do not rely on this variable. It is considered
# an implementation detail.
# * PHP5_MAINTSCRIPT_NAME
# * PHP5_MAINTSCRIPT_PACKAGE
# * PHP5_MAINTSCRIPT_METHOD
# * PHP5_MAINTSCRIPT_ARGUMENT
# these variables contain information about the
# maintainer script which is calling the
# maintscript-helper. It contains arguments which
# dpkg supplies to maintainer scripts and similar
# information. These variables are an
# implementation detail and not to be changed.
#
# You might want to set them manually only if you
# are calling php5-maintscript-helper from
# some place which does not preserve the original
# script arguments for example when calling from
# a subfunction instead of the main function in
# your maintainer script
#
# INITIALIZATION
#
if [ -n "${EXPORT_PHP5_MAINTSCRIPT_HELPER:-}" ] ; then
return
else
EXPORT_PHP5_MAINTSCRIPT_HELPER=1
if [ -n "${PHP5_MAINTSCRIPT_DEBUG:-}" ] ; then
set -x
fi
if [ -z "$1" ] ; then
echo "You must invoke php5-maintscript-helper with an unmodified environment when sourcing it" >&2
return 1
fi
PHP5_MAINTSCRIPT_NAME="$DPKG_MAINTSCRIPT_NAME"
[ "$PHP5_MAINTSCRIPT_NAME" ] || PHP5_MAINTSCRIPT_NAME="${0##*.}"
case "$PHP5_MAINTSCRIPT_NAME" in
preinst|prerm|postrm|postinst)
# yay - recognized script
;;
*)
echo "php5-maintscript-helper invoked from an unrecognized maintainer script: exiting" >&2
return 1
;;
esac
PHP5_MAINTSCRIPT_PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE"
if [ -z "$PHP5_MAINTSCRIPT_PACKAGE" ]; then
PHP5_MAINTSCRIPT_PACKAGE="${0##*/}"
PHP5_MAINTSCRIPT_PACKAGE="${PHP5_MAINTSCRIPT_PACKAGE%.*}"
fi
if [ -z "$PHP5_MAINTSCRIPT_METHOD" ] ; then
PHP5_MAINTSCRIPT_METHOD="$1"
fi
case "$PHP5_MAINTSCRIPT_METHOD" in
install|upgrade|abort-upgrade|configure|abort-remove|abort-remove|abort-deconfigure|remove|failed-upgrade|purge|disappear|abort-install)
# yay - recognized script
;;
*)
echo "php5-maintscript-helper invoked from a modified environment. Please hint required arguments manually" >&2
return 1
;;
esac
if [ -z "$PHP5_MAINTSCRIPT_ARGUMENT" ] ; then
PHP5_MAINTSCRIPT_ARGUMENT="${2:-}"
fi
fi
#
# FUNCTIONS
#
#
# Function php5_msg
# print out a warning to both, the syslog and a local standard output.
# This function should generally be used to display messages related to
# the web server in maintainer scripts.
# Parameters:
# priority
# The message priority. Recognized values are the same as defined
# by syslog(3), thus: one among debug, info, notice, warning,
# err, crit, alert, emerg.
# If no known priority is recognized, the priority is set to
# "warning".
# message
# The message as a string. It is printed out verbatim.
# Behavior:
# No message is displayed if PHP5_MAINTSCRIPT_HELPER_QUIET is defined
# Returns:
# this function always returns 0
# Since: 5.5.0+dfsg-7
php5_msg()
{
local PRIORITY="$1"
local MSG="$2"
case "$PRIORITY" in
debug|info|notice|warning|err|crit|alert|emerg)
;;
*)
PRIORITY="warning"
;;
esac
[ -z "$PHP5_MAINTSCRIPT_HELPER_QUIET" ] && ( [ -n "${PHP5_MAINTSCRIPT_DEBUG:-}" ] || [ "$PRIORITY" != "debug" ] ) && echo "$MSG" >&2
[ -x /usr/bin/logger ] || return 0
local LOGGER="/usr/bin/logger -p daemon.$PRIORITY -t $PHP5_MAINTSCRIPT_PACKAGE "
$LOGGER "$MSG" || return 0
}
#
# Function php5_invoke
# invokes an Apache 2 configuration helper to enable or disable a
# particular piece of configuration, a site or a module. It carefully
# checks whether the supplied configuration snippet exists and reloads the
# web server if the site administrator desires that by call dpkg trigger
# /etc/php5/SAPI/conf.d which is defined for apache2, apache2filter and fpm.
#
# Parameters:
# command - The command to invoke. Recognized commands are "enconf",
# "enmod", "ensite", "disconf", "dismod", "dissite"
#
# sapi - Either the specific SAPI (apache2, apache2filter, fpm,
# cgi, cli, embed) or ALL
#
# arguments
# - A single argument (e.g. a module) which shall be
# enabled or disabled respectively.
#
# Returns
# 0 if the changes could be activated
# 1 otherwise
# Since: 5.5.0+dsfg-7
php5_invoke()
{
local CMD=$1
local SAPI=$2
local MOD=$3
local check_switch=""
local invoke_string=""
local rcd_action=""
local rcd_scripts=""
local sapi_list=""
[ -x "/usr/sbin/php5$CMD" ] || return 1
[ -x "/usr/sbin/php5query" ] || return 1
sapi_list="$SAPI"
case "$SAPI" in
apache2|apache2filter|fpm|cli|cgi|embed)
;;
ALL)
sapi_list=$(php5query -S)
case "$CMD" in
enmod|dismod)
php5$CMD -q -m -r "$MOD" || return 1
;;
*)
return 1
;;
esac
;;
*)
return 1
;;
esac
for SAPI in $sapi_list; do
case "$CMD" in
enmod)
local php5query_ret=0
php5query -s "$SAPI" -m "$MOD" > /dev/null 2>&1 || php5query_ret=$?
if [ "$php5query_ret" -eq 0 ] ; then
# configuration is already enabled
php5$CMD -m -s "$SAPI" -q "$MOD" > /dev/null 2>&1 || return 1
php5_msg "info" "php5_invoke $MOD: already enabled for $SAPI SAPI"
PHP5_NEED_ACTION=1
elif [ "$php5query_ret" -eq 32 ] ; then
# the maintainer disabled the module
php5_msg "info" "php5_invoke $MOD: no action - module was disabled by maintainer for $SAPI SAPI"
return 0
else
# coming here either means:
# a) we have no clue about the module (e.g. for upgrades prior to maintscript-helper
# b) it's a fresh install
PHP5_NEED_ACTION=1
php5$CMD -m -s "$SAPI" -q "$MOD" > /dev/null 2>&1 || return 1
php5_msg "info" "php5_invoke: Enable module $MOD for $SAPI SAPI"
fi
;;
dismod)
local php5query_ret=0
php5query -s "$SAPI" -m "$MOD" > /dev/null 2>&1 || php5query_ret=$?
if [ "$php5query_ret" -eq 0 ] ; then
if [ "$PHP5_MAINTSCRIPT_NAME" = 'postrm' ] && [ "$PHP5_MAINTSCRIPT_METHOD" = "purge" ] ; then
php5$CMD -p -f -s "$SAPI" -q "$MOD" || return 1
php5_msg "info" "php5_invoke $PHP5_MAINTSCRIPT_NAME: Purging module $MOD for $SAPI SAPI"
PHP5_NEED_ACTION=1
elif [ "$PHP5_MAINTSCRIPT_NAME" = 'postrm' ] || [ "$PHP5_MAINTSCRIPT_NAME" = 'prerm' ] ; then
if [ "$PHP5_MAINTSCRIPT_METHOD" = "remove" ] ; then
php5$CMD -m -f -s "$SAPI" -q "$MOD" || return 1
php5_msg "info" "php5_invoke $PHP5_MAINTSCRIPT_NAME: Disable module $MOD for $SAPI SAPI"
PHP5_NEED_ACTION=1
fi
else
php5_msg "error" "php5_invoke: module $MOD not supported in $PHP5_MAINTSCRIPT_NAME for $SAPI SAPI"
return 1
fi
elif [ "$php5query_ret" -eq 32 ] || [ "$php5query_ret" -eq 33 ] ; then
if [ "$PHP5_MAINTSCRIPT_NAME" = 'postrm' ] && [ "$PHP5_MAINTSCRIPT_METHOD" = "purge" ] ; then
php5_msg "info" "php5_invoke $PHP5_MAINTSCRIPT_NAME: Purging state for $MOD for $SAPI SAPI"
# this will return RC=1
( php5$CMD -p -f -s "$SAPI" -q "$MOD" > /dev/null 2>&1 )
else
php5_msg "debug" "php5_invoke $MOD $PHP5_MAINTSCRIPT_NAME: No action required for $SAPI SAPI"
fi
else
php5_msg "debug" "php5_invoke $MOD $PHP5_MAINTSCRIPT_NAME: No action required for $SAPI SAPI"
fi
;;
*)
return 1
;;
esac
if [ -n "${PHP_NEED_ACTION:-}" -a -n "$rcd_action" ]; then
dpkg-trigger /etc/php5/$SAPI/conf.d
fi
done
}
# vim: syntax=sh sw=8 sts=8 sr noet
debian/debhelper/php5.pm 0000664 0000000 0000000 00000000165 12300436054 012333 0 ustar #!/usr/bin/perl
use warnings;
use strict;
use Debian::Debhelper::Dh_Lib;
insert_after("dh_install", "dh_php5");
1;
debian/php5-sapi.bug.control 0000664 0000000 0000000 00000000031 12300436054 013143 0 ustar report-with: php5-common
debian/dfsg-repack.sh 0000775 0000000 0000000 00000001175 12300436054 011716 0 ustar #!/bin/bash
set -e
if [ ! -f "$3" ] && [ ! -f "$1" ]; then
echo "This script must be run via uscan or by manually specifying the tarball" >&2
exit 1
fi
tarball=
[ -f "$3" ] && tarball="$3"
[ -z "$tarball" -a -f "$1" ] && tarball="$1"
fname="$(basename "$tarball")"
tarball="$(readlink -f "$tarball")"
tdir="$(mktemp -d)"
trap '[ ! -d "$tdir" ] || rm -r "$tdir"' EXIT
xzcat "$tarball" | \
tar --wildcards \
--delete '*/ext/json/*' \
> "$tdir/${fname/.xz}"
xz "$tdir/${fname/.xz}"
bare=$(dirname "$tarball")/$(basename "$(basename "${tarball}" .tar.xz)" .orig)
mv "$tdir/$fname" "${bare}+dfsg.orig.tar.xz"
debian/php5-module.triggers 0000664 0000000 0000000 00000000150 12300436054 013070 0 ustar activate /etc/php5/apache2/conf.d
activate /etc/php5/apache2filter/conf.d
activate /etc/php5/fpm/conf.d
debian/libapache2-mod-php5filter.postinst.extra 0000664 0000000 0000000 00000001477 12300436054 016754 0 ustar if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
php5_enable() {
mpm=$(a2query -M)
case "$(a2query -M)" in
prefork|itk) return 0;;
*) if apache2_switch_mpm prefork; then return 0; fi;;
esac
apache2_msg err "Could not switch to prefork MPM, not enabling php5"
return 1
}
else
echo "Warning: Could not load Apache 2.4 maintainer script helper."
php5_enable() {
return 1;
}
fi
# we've registered a trigger to handle extension updates.
if [ "$1" = "triggered" ] && [ "$2" = "/etc/php5/apache2/conf.d" ]; then
if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
apache2_reload restart
fi
exit 0
elif [ "$1" != "configure" ]; then
exit 0
fi
debian/php5-dev.lintian-overrides 0000664 0000000 0000000 00000000204 12300436054 014171 0 ustar php5-dev: script-not-executable ./usr/lib/php5/build/run-tests.php
php5-dev: script-not-executable usr/lib/php5/build/run-tests.php
debian/gbp.conf 0000664 0000000 0000000 00000000250 12300436054 010601 0 ustar [DEFAULT]
debian-branch = master
debian-tag = debian/%(version)s
upstream-branch = upstream
upstream-tag = upstream/%(version)s
pristine-tar = True
[git-dch]
meta = 1
debian/php-pear.doc-base.php-structures-graph 0000664 0000000 0000000 00000000474 12300436054 016413 0 ustar Document: php-structures-graph
Title: PEAR Structures_Graph
Abstract: API documentation of the Structures_Graph module.
Section: Programming
Format: HTML
Index: /usr/share/doc/php-pear/PEAR/Structures_Graph/docs/html/index.html
Files: /usr/share/doc/php-pear/PEAR/Structures_Graph/docs/html/Structures_Graph/*.html
debian/NEWS 0000664 0000000 0000000 00000021053 12300436054 007665 0 ustar php5 (5.5.0~rc1+dfsg-1) experimental; urgency=low
* Starting from this version, the JSON module is no longer compiled in
due to licensing problems, and you need to install the JSON extension
as external php5-json package that is using json-c library.
-- Ondřej Surý Fri, 17 May 2013 14:43:04 +0200
php5 (5.5.0~beta4-2) experimental; urgency=low
* short_open_tag configuration option now defaults to Off. This means
that your PHP applications have to use '/php.ini again.
-- Ondřej Surý Sun, 05 May 2013 23:37:54 +0200
php5 (5.4.4-7) unstable; urgency=low
* As a side effect of the MIME-Type changes in the mime-support package,
the default Apache 2 configuration will no longer perform HTTP content
negotiation on the PHP file extensions, which was very questionable
anyway. If you really want to re-enable this support then please read
/usr/share/doc/php5-common/README.Debian file for further
instructions.
-- Ondřej Surý Wed, 29 Aug 2012 09:18:41 +0200
php5 (5.4.4-5) unstable; urgency=low
* As a security measure the default configuration for Apache 2 has been
changed to a stricter model. Only files which have the correct
rightmost extension, and at least one character in the filename before
that extension, are now interpreted by PHP. For a full list of
handled extensions please see the Apache 2 configuration. At the time
of writing this paragraph, the list includes the following regular
expressions:
1. .+\.ph(p[345]?|t|tml)$ for PHP files (application/x-httpd-php)
2. .+\.phps$ for PHP source files (application/x-httpd-php-source)
Previously, as a side effect of system MIME type definitions, the
default configuration would allow the interpreting of files with a
double extension, where the second extension was either unrecognised
or a language or content encoding to be interpreted; e.g. an uploaded
file named blackhat.php.foobar or index.php.cs would be interpreted by
PHP. These non-standard definitions have been removed from the
mime-support packages and all configuration of PHP handlers is now
defined in the Apache 2 configuration files.
The standard configuration now also denies access to files with names
which consist of an extension and nothing more; e.g. accessing '/.php'
will now return Access Denied instead of the output of the PHP script.
You can use the following command to find whether there are any files
on your system which would be affected by this change (change
to the directory name where you store PHP files on your system):
# find -name '*.ph[pt].*' -o -name '*.php[345s].*' -o \
-name '*.phtml.*' -o -name '.ph[pt]' -o \
-name '.php[345s]' -o -name '.phtml'
-- Ondřej Surý Tue, 21 Aug 2012 09:14:47 +0200
php5 (5.4.0~rc8-1) unstable; urgency=low
php5-fpm default www spool now listens on unix socket located
in /var/run/php5-fpm.sock instead of localhost:9000. If you
have configured your webserver to use localhost:9000, you will
have to change your settings.
-- Ondřej Surý Wed, 08 Feb 2012 08:25:30 +0100
php5 (5.4.0~rc6-2) unstable; urgency=low
t1lib support was removed from PHP 5.4. t1lib has many security
issues and is unmaintained by upstream for a very long time (3 years).
For more information see:
+ http://bugs.debian.org/637488
+ http://bugs.debian.org/638755
This unfortunately also means that following functions are not
available in PHP5 from now:
- imagepsloadfont
- imagepsfreefont
- imagepsencodefont
- imagepsextendfont
- imagepsslantfont
- imagepstext
- imagepsbbox
If you really need those functions you will need to install t1lib from
sources. You will need to install php5-dev and recompile GD extension
(roughly) using following commands:
cd /ext/gd/
phpize
configure --with-gd=shared,/usr --enable-gd-native-ttf \
--with-t1lib=
make
make install
-- Ondřej Surý Wed, 01 Feb 2012 18:19:45 +0100
php5 (5.3.9-4) unstable; urgency=low
* The Suhosin patch is now disabled in the default build.
If you want to re-enable it again for your installation, you can
set the option PHP5_SUHOSIN=yes in debian/rules and recompile PHP.
-- Ondřej Surý Sat, 28 Jan 2012 08:39:36 +0100
php5 (5.3.6-13) unstable; urgency=low
* Updated blowfish crypt() algorithm fixes the 8-bit character handling
vulnerability (CVE-2011-2483) and adds more self-tests. Unfortunately
this change is incompatible with some old (wrong) generated hashes for
passwords containing 8-bit characters.
It is recommended that any passwords containing characters with
the 8th bit set be changed after this upgrade. In order to allow users
to log in after the upgrade even if they have a potentially affected
password, the newly introduced backwards compatibility hash encoding
prefix of "$2x$" may be used (in place of the usual "$2a$"). Such
password hashes should only be used during a transition period; when
passwords are changed, the usual "$2a$" prefix is used, denoting the
correct algorithm.
-- Ondřej Surý Mon, 04 Jul 2011 10:31:16 +0200
php5 (5.3.1-3) unstable; urgency=low
* mod_php disabled in userdirs.
The default Debian libapache2-mod-php5 package now disables the PHP
engine on ~/public_html directories when mod_userdir is enabled, for
security reasons. Although discouraged, it can be re-enabled by
commenting the block in
/etc/apache2/mods-available/php5.conf
* PHP 5.2 compatibility settings
Given the short time to the Squeeze release freeze, the
short_open_tag setting has been turned On again (upstream now
defaults to Off on the php.ini files.) However, the request_order and
auto_globals_jit settings continue to be the default from upstream
("GP" and On, respectively.)
-- Raphael Geissert Mon, 11 Jan 2010 16:49:28 -0600
php5 (5.2.11.dfsg.1-2) unstable; urgency=high
* Maximum number of file uploads per request limited
To prevent Denial of Service attacks by exhausting the number of
available temporary file names, upstream introduced the max_file_uploads
option in 5.3.1 and 5.2.12.
Due to the nature of this new option a default limit has been set
to 50, hoping it is sensible enough to not to cause disruptions on
existing services.
The value of this new limit can be changed in the php.ini file.
If you installed the php5-suhosin extension there was a limiting
mechanism in place already. In this case you may want to make sure
the new limit imposed by PHP itself is not smaller than suhosin's.
-- Raphael Geissert Sat, 21 Nov 2009 13:37:51 -0600
php5 (5.2.6-1) unstable; urgency=medium
* Now uses system timezone database.
Debian PHP now makes use of the system wide timezone database from the
tzdata package, making sure any updates there are automatically used
by PHP aswell. Note that this requires that the PHP process has access
to /etc/localtime and /usr/share/zoneinfo (this is usually the case).
* New php5-dbg package.
We are now shipping a php5-dgb package which will greatly aid in finding
the cause of many crashes that you may experience. So if you are going to
report a bug for a reproducible crash, please install this package before
sending a backtrace.
* New libapache2-mod-php5filter package.
We are now also shipping a new libapache2-mod-php5filter package which
uses the "Apache 2.0 filter-module support via DSO through APXS".
-- Thijs Kinkhorst Wed, 23 Jul 2008 17:42:06 +0200
php5 (5.2.3-2) unstable; urgency=low
The Suhosin patch is now enabled by default!
For more information, see
.
Special thanks to Blars Blarson for providing a sparc machine for testing
that the patch seems to work okay on that architecture. If you experience
otherwise let us know!
Suggestions are welcome for default configuration options, examples,
documentation, etc.
In any event please report successes and/or failures to us at
pkg-php-maint@lists.alioth.debian.org.
-- sean finney Thu, 12 Jul 2007 23:38:43 +0200
debian/libapache2-mod-php5filter.apache2 0000664 0000000 0000000 00000000145 12300436054 015241 0 ustar mod apache2filter-build/.libs/libphp5filter.so
mod debian/php5filter.load
mod debian/php5filter.conf
debian/php5-fpm-reopenlogs 0000664 0000000 0000000 00000000450 12506505025 012721 0 ustar #!/bin/sh
CONFFILE=/etc/php5/fpm/php-fpm.conf
[ -r /etc/default/php5-fpm ] && . /etc/default/php5-fpm
CONF_PIDFILE=$(sed -n 's/^[[:space:]]*pid[[:space:]]*=[[:space:]]*//p' $CONFFILE)
PIDFILE=${CONF_PIDFILE:-/run/php5-fpm.pid}
[ -r "$PIDFILE" ] && kill -USR1 $(cat "$PIDFILE") > /dev/null
exit 0
debian/php5-common.postrm.extra 0000664 0000000 0000000 00000000053 12300436054 013715 0 ustar [ "$1" = "purge" ] && rm -rf /var/lib/php5
debian/php5-common.postinst.extra 0000664 0000000 0000000 00000000242 12300436054 014254 0 ustar for sapi in apache2 apache2filter cli cgi embed fpm; do
CONFDIR=/etc/php5/$sapi/conf.d
if [ -L $CONFDIR ]; then
rm $CONFDIR
mkdir $CONFDIR
fi
done
debian/php5-fpm.dirs 0000664 0000000 0000000 00000000120 12300436054 011475 0 ustar /etc/php5/fpm
/etc/php5/fpm/conf.d
/etc/php5/fpm/pool.d
/usr/sbin
/usr/lib/php5
debian/php5-sqlite.postrm.extra 0000664 0000000 0000000 00000000117 12300436054 013727 0 ustar dpkg-maintscript-helper rm_conffile /etc/php5/conf.d/sqlite.ini 5.3.9~ -- "$@"
debian/libphp5-embed.postrm.extra 0000664 0000000 0000000 00000000040 12300436054 014164 0 ustar [ "$1" = "remove" ] && ldconfig
debian/libapache2-mod-php5.apache2 0000664 0000000 0000000 00000000115 12300436054 014030 0 ustar mod apache2-build/.libs/libphp5.so
mod debian/php5.load
mod debian/php5.conf
debian/php5-cgi.prerm.extra 0000664 0000000 0000000 00000000236 12300436054 012773 0 ustar if [ "$1" = "remove" ]; then
update-alternatives --remove php-cgi /usr/bin/php5-cgi
update-alternatives --remove php-cgi-bin /usr/lib/cgi-bin/php5
fi
debian/php5-cgi.dirs 0000664 0000000 0000000 00000000155 12300436054 011465 0 ustar /etc/apache2/mods-available
/etc/php5/cgi
/etc/php5/cgi/conf.d
/usr/lib/cgi-bin
/usr/bin
/usr/share/man/man1
debian/php5.load 0000664 0000000 0000000 00000000073 12300436054 010702 0 ustar LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
debian/php5-sapi.postinst 0000664 0000000 0000000 00000001127 12300436324 012601 0 ustar #!/bin/sh
set -e
#EXTRA#
CONFDIR=/etc/php5/@sapi@/conf.d
if [ -L $CONFDIR ]; then
rm $CONFDIR
mkdir $CONFDIR
fi
if [ "$1" = "configure" ]; then
phpini="/etc/php5/@sapi@/php.ini"
if [ "@sapi@" = "cli" ]; then
ucf /usr/share/php5/php.ini-production.@sapi@ $phpini
else
ucf /usr/share/php5/php.ini-production $phpini
fi
ucfr @package@ $phpini
if [ -e /usr/share/php5/php5-maintscript-helper ]; then
. /usr/share/php5/php5-maintscript-helper
mods=$(php5query -M)
for mod in $mods; do
php5_invoke enmod @sapi@ $mod
done
fi
fi
#DEBHELPER#
exit 0
debian/php5-common.dirs 0000664 0000000 0000000 00000000262 12300436054 012212 0 ustar /usr/lib/php5
/usr/share/lintian/overrides
/usr/share/doc/php5-common
/usr/share/php5
/usr/share/php5/sapi
/var/lib/php5/modules
/usr/lib/php5
/etc/php5/mods-available
/usr/sbin
debian/source.lintian-overrides 0000664 0000000 0000000 00000000072 12300436054 014044 0 ustar php5 source: license-problem-json-evil README.REDIST.BINS
debian/libphp5-embed.dirs 0000664 0000000 0000000 00000000060 12300436054 012461 0 ustar /etc/php5/embed
/etc/php5/embed/conf.d
/usr/lib
debian/php5-fpm.postrm.extra 0000664 0000000 0000000 00000000147 12300436054 013213 0 ustar dpkg-maintscript-helper mv_conffile /etc/php5/fpm/main.conf /etc/php5/fpm/php-fpm.conf 5.3.5-1 -- "$@"
debian/patches/ 0000775 0000000 0000000 00000000000 13457376706 010641 5 ustar debian/patches/CVE-2016-9935-1.patch 0000664 0000000 0000000 00000003242 13046673233 013420 0 ustar From 266ecb6d0a1ab5a37b4d652ca774a8adc4b06578 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Mon, 5 Dec 2016 21:40:55 -0800
Subject: [PATCH] Fix bug #73631 - Invalid read when wddx decodes empty boolean
element
---
NEWS | 4 ++++
ext/wddx/tests/bug73631.phpt | 19 +++++++++++++++++++
ext/wddx/wddx.c | 5 +++++
3 files changed, 28 insertions(+)
create mode 100644 ext/wddx/tests/bug73631.phpt
Index: php5-5.5.9+dfsg/ext/wddx/tests/bug73631.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/wddx/tests/bug73631.phpt 2017-02-08 14:50:48.604823123 -0500
@@ -0,0 +1,19 @@
+--TEST--
+Bug #73631 (Memory leak due to invalid wddx stack processing)
+--SKIPIF--
+
+--FILE--
+
+
+1234
+
+
+EOF;
+$wddx = wddx_deserialize($xml);
+var_dump($wddx);
+?>
+--EXPECTF--
+int(1234)
+
Index: php5-5.5.9+dfsg/ext/wddx/wddx.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/wddx/wddx.c 2017-02-08 14:50:48.608823182 -0500
+++ php5-5.5.9+dfsg/ext/wddx/wddx.c 2017-02-08 14:50:48.608823182 -0500
@@ -803,6 +803,11 @@
php_wddx_process_data(user_data, atts[i+1], strlen(atts[i+1]));
break;
}
+ } else {
+ ent.type = ST_BOOLEAN;
+ SET_STACK_VARNAME;
+ ZVAL_FALSE(&ent.data);
+ wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
}
} else if (!strcmp(name, EL_NULL)) {
ent.type = ST_NULL;
debian/patches/CVE-2016-10160.patch 0000664 0000000 0000000 00000002565 13047111414 013314 0 ustar From b28b8b2fee6dfa6fcd13305c581bb835689ac3be Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Fri, 30 Dec 2016 15:57:24 -0800
Subject: [PATCH] Fix bug #73768 - Memory corruption when loading hostile phar
---
ext/phar/phar.c | 3 +--
ext/phar/tests/bug73768.phar | Bin 0 -> 219 bytes
ext/phar/tests/bug73768.phpt | 16 ++++++++++++++++
3 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 ext/phar/tests/bug73768.phar
create mode 100644 ext/phar/tests/bug73768.phpt
Index: php5-5.5.9+dfsg/ext/phar/phar.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/phar/phar.c 2017-02-09 11:04:26.075490657 -0500
+++ php5-5.5.9+dfsg/ext/phar/phar.c 2017-02-09 11:04:26.071490595 -0500
@@ -980,7 +980,6 @@
/* if the alias is stored we enforce it (implicit overrides explicit) */
if (alias && alias_len && (alias_len != (int)tmp_len || strncmp(alias, buffer, tmp_len)))
{
- buffer[tmp_len] = '\0';
php_stream_close(fp);
if (signature) {
@@ -988,7 +987,7 @@
}
if (error) {
- spprintf(error, 0, "cannot load phar \"%s\" with implicit alias \"%s\" under different alias \"%s\"", fname, buffer, alias);
+ spprintf(error, 0, "cannot load phar \"%s\" with implicit alias \"%.*s\" under different alias \"%s\"", fname, tmp_len, buffer, alias);
}
efree(savebuf);
debian/patches/CVE-2016-7479.patch 0000664 0000000 0000000 00000070124 13047062247 013264 0 ustar Backport of:
From 0426b916df396a23e5c34514e4f2f0627efdcdf0 Mon Sep 17 00:00:00 2001
From: Nikita Popov
Date: Thu, 5 Jan 2017 00:19:26 +0100
Subject: [PATCH] Implement delayed __wakeup
---
ext/standard/var_unserializer.c | 1227 ++++++++++++++++++++------------------
ext/standard/var_unserializer.re | 84 ++-
2 files changed, 699 insertions(+), 612 deletions(-)
Index: php5-5.5.9+dfsg/ext/standard/var_unserializer.re
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/var_unserializer.re 2017-02-09 07:36:07.107643011 -0500
+++ php5-5.5.9+dfsg/ext/standard/var_unserializer.re 2017-02-09 07:40:06.270626277 -0500
@@ -26,6 +26,11 @@
#define VAR_ENTRIES_MAX 1024
#define VAR_ENTRIES_DBG 0
+#define VAR_WAKEUP_FLAG 1
+#define WITH_WAKEUP_FLAG(zv_ptr) ((zval *) ((zend_uintptr_t) zv_ptr | VAR_WAKEUP_FLAG))
+#define WITHOUT_WAKEUP_FLAG(zv_ptr) ((zval *) ((zend_uintptr_t) zv_ptr & ~VAR_WAKEUP_FLAG))
+#define HAS_WAKEUP_FLAG(zv_ptr) ((zend_uintptr_t) zv_ptr & VAR_WAKEUP_FLAG)
+
typedef struct {
zval *data[VAR_ENTRIES_MAX];
long used_slots;
@@ -56,12 +61,12 @@
var_hash->data[var_hash->used_slots++] = *rval;
}
-PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
+static inline zval **get_var_push_dtor_slot(php_unserialize_data_t *var_hashx)
{
var_entries *var_hash;
if (!var_hashx || !*var_hashx) {
- return;
+ return NULL;
}
var_hash = (*var_hashx)->last_dtor;
@@ -83,8 +88,14 @@
(*var_hashx)->last_dtor = var_hash;
}
+ return &var_hash->data[var_hash->used_slots++];
+}
+
+PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
+{
+ zval **slot = get_var_push_dtor_slot(var_hashx);
Z_ADDREF_PP(rval);
- var_hash->data[var_hash->used_slots++] = *rval;
+ *slot = *rval;
}
PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval)
@@ -162,6 +173,9 @@
void *next;
long i;
var_entries *var_hash = (*var_hashx)->first;
+ zend_bool wakeup_failed = 0;
+ TSRMLS_FETCH();
+
#if VAR_ENTRIES_DBG
fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L);
#endif
@@ -176,10 +190,35 @@
while (var_hash) {
for (i = 0; i < var_hash->used_slots; i++) {
+ zval *zv = var_hash->data[i];
#if VAR_ENTRIES_DBG
fprintf(stderr, "var_destroy dtor(%p, %ld)\n", var_hash->data[i], Z_REFCOUNT_P(var_hash->data[i]));
#endif
- zval_ptr_dtor(&var_hash->data[i]);
+
+ if (HAS_WAKEUP_FLAG(zv)) {
+ zv = WITHOUT_WAKEUP_FLAG(zv);
+ if (!wakeup_failed) {
+ zval *retval_ptr = NULL;
+ zval wakeup_name;
+ INIT_PZVAL(&wakeup_name);
+ ZVAL_STRINGL(&wakeup_name, "__wakeup", sizeof("__wakeup") - 1, 0);
+
+ BG(serialize_lock)++;
+ if (call_user_function_ex(CG(function_table), &zv, &wakeup_name, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC) == FAILURE || retval_ptr == NULL) {
+ wakeup_failed = 1;
+ zend_object_store_ctor_failed(zv TSRMLS_CC);
+ }
+ BG(serialize_lock)--;
+
+ if (retval_ptr) {
+ zval_ptr_dtor(&retval_ptr);
+ }
+ } else {
+ zend_object_store_ctor_failed(zv TSRMLS_CC);
+ }
+ }
+
+ zval_ptr_dtor(&zv);
}
next = var_hash->next;
efree(var_hash);
@@ -422,15 +461,12 @@
#endif
static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
{
- zval *retval_ptr = NULL;
- zval fname;
-
if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) {
- /* We've got partially constructed object on our hands here. Wipe it. */
- if(Z_TYPE_PP(rval) == IS_OBJECT) {
- zend_hash_clean(Z_OBJPROP_PP(rval));
- zend_object_store_ctor_failed(*rval TSRMLS_CC);
- }
+ /* We've got partially constructed object on our hands here. Wipe it. */
+ if (Z_TYPE_PP(rval) == IS_OBJECT) {
+ zend_hash_clean(Z_OBJPROP_PP(rval));
+ zend_object_store_ctor_failed(*rval TSRMLS_CC);
+ }
ZVAL_NULL(*rval);
return 0;
}
@@ -440,20 +476,16 @@
}
if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY &&
- zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) {
- INIT_PZVAL(&fname);
- ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0);
- BG(serialize_lock)++;
- call_user_function_ex(CG(function_table), rval, &fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC);
- BG(serialize_lock)--;
- }
-
- if (retval_ptr) {
- zval_ptr_dtor(&retval_ptr);
- }
-
- if (EG(exception)) {
- return 0;
+ zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))
+ ) {
+ /* Store object for delayed __wakeup call. Remove references. */
+ zval **slot = get_var_push_dtor_slot(var_hash);
+ zval *zv = *rval;
+ Z_ADDREF_P(zv);
+ if (PZVAL_IS_REF(zv)) {
+ SEPARATE_ZVAL(&zv);
+ }
+ *slot = WITH_WAKEUP_FLAG(zv);
}
return finish_nested_data(UNSERIALIZE_PASSTHRU);
Index: php5-5.5.9+dfsg/ext/standard/var_unserializer.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/var_unserializer.c 2017-02-09 07:35:54.335483571 -0500
+++ php5-5.5.9+dfsg/ext/standard/var_unserializer.c 2017-02-09 07:46:25.467347766 -0500
@@ -1,9 +1,9 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.13.5 on Thu Feb 9 07:46:25 2017 */
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2014 The PHP Group |
+ | Copyright (c) 1997-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -27,6 +27,11 @@
#define VAR_ENTRIES_MAX 1024
#define VAR_ENTRIES_DBG 0
+#define VAR_WAKEUP_FLAG 1
+#define WITH_WAKEUP_FLAG(zv_ptr) ((zval *) ((zend_uintptr_t) zv_ptr | VAR_WAKEUP_FLAG))
+#define WITHOUT_WAKEUP_FLAG(zv_ptr) ((zval *) ((zend_uintptr_t) zv_ptr & ~VAR_WAKEUP_FLAG))
+#define HAS_WAKEUP_FLAG(zv_ptr) ((zend_uintptr_t) zv_ptr & VAR_WAKEUP_FLAG)
+
typedef struct {
zval *data[VAR_ENTRIES_MAX];
long used_slots;
@@ -57,12 +62,12 @@
var_hash->data[var_hash->used_slots++] = *rval;
}
-PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
+static inline zval **get_var_push_dtor_slot(php_unserialize_data_t *var_hashx)
{
var_entries *var_hash;
if (!var_hashx || !*var_hashx) {
- return;
+ return NULL;
}
var_hash = (*var_hashx)->last_dtor;
@@ -84,8 +89,14 @@
(*var_hashx)->last_dtor = var_hash;
}
+ return &var_hash->data[var_hash->used_slots++];
+}
+
+PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
+{
+ zval **slot = get_var_push_dtor_slot(var_hashx);
Z_ADDREF_PP(rval);
- var_hash->data[var_hash->used_slots++] = *rval;
+ *slot = *rval;
}
PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval)
@@ -163,6 +174,9 @@
void *next;
long i;
var_entries *var_hash = (*var_hashx)->first;
+ zend_bool wakeup_failed = 0;
+ TSRMLS_FETCH();
+
#if VAR_ENTRIES_DBG
fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L);
#endif
@@ -177,10 +191,35 @@
while (var_hash) {
for (i = 0; i < var_hash->used_slots; i++) {
+ zval *zv = var_hash->data[i];
#if VAR_ENTRIES_DBG
fprintf(stderr, "var_destroy dtor(%p, %ld)\n", var_hash->data[i], Z_REFCOUNT_P(var_hash->data[i]));
#endif
- zval_ptr_dtor(&var_hash->data[i]);
+
+ if (HAS_WAKEUP_FLAG(zv)) {
+ zv = WITHOUT_WAKEUP_FLAG(zv);
+ if (!wakeup_failed) {
+ zval *retval_ptr = NULL;
+ zval wakeup_name;
+ INIT_PZVAL(&wakeup_name);
+ ZVAL_STRINGL(&wakeup_name, "__wakeup", sizeof("__wakeup") - 1, 0);
+
+ BG(serialize_lock)++;
+ if (call_user_function_ex(CG(function_table), &zv, &wakeup_name, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC) == FAILURE || retval_ptr == NULL) {
+ wakeup_failed = 1;
+ zend_object_store_ctor_failed(zv TSRMLS_CC);
+ }
+ BG(serialize_lock)--;
+
+ if (retval_ptr) {
+ zval_ptr_dtor(&retval_ptr);
+ }
+ } else {
+ zend_object_store_ctor_failed(zv TSRMLS_CC);
+ }
+ }
+
+ zval_ptr_dtor(&zv);
}
next = var_hash->next;
efree(var_hash);
@@ -416,38 +455,31 @@
#endif
static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
{
- zval *retval_ptr = NULL;
- zval fname;
-
if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) {
- /* We've got partially constructed object on our hands here. Wipe it */
- if(Z_TYPE_PP(rval) == IS_OBJECT) {
- zend_hash_clean(Z_OBJPROP_PP(rval));
- zend_object_store_ctor_failed(*rval TSRMLS_CC);
- }
+ /* We've got partially constructed object on our hands here. Wipe it. */
+ if (Z_TYPE_PP(rval) == IS_OBJECT) {
+ zend_hash_clean(Z_OBJPROP_PP(rval));
+ zend_object_store_ctor_failed(*rval TSRMLS_CC);
+ }
ZVAL_NULL(*rval);
return 0;
}
- if (Z_TYPE_PP(rval) != IS_OBJECT) {
- return 0;
- }
+ if (Z_TYPE_PP(rval) != IS_OBJECT) {
+ return 0;
+ }
if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY &&
- zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) {
- INIT_PZVAL(&fname);
- ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0);
- BG(serialize_lock)++;
- call_user_function_ex(CG(function_table), rval, &fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC);
- BG(serialize_lock)--;
- }
-
- if (retval_ptr) {
- zval_ptr_dtor(&retval_ptr);
- }
-
- if (EG(exception)) {
- return 0;
+ zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))
+ ) {
+ /* Store object for delayed __wakeup call. Remove references. */
+ zval **slot = get_var_push_dtor_slot(var_hash);
+ zval *zv = *rval;
+ Z_ADDREF_P(zv);
+ if (PZVAL_IS_REF(zv)) {
+ SEPARATE_ZVAL(&zv);
+ }
+ *slot = WITH_WAKEUP_FLAG(zv);
}
return finish_nested_data(UNSERIALIZE_PASSTHRU);
@@ -480,40 +512,6 @@
{
YYCTYPE yych;
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- };
if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
yych = *YYCURSOR;
@@ -535,49 +533,72 @@
}
yy2:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy95;
+ switch (yych) {
+ case ':': goto yy95;
+ default: goto yy3;
+ }
yy3:
{ return 0; }
yy4:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy89;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy89;
+ default: goto yy3;
+ }
yy5:
yych = *++YYCURSOR;
- if (yych == ';') goto yy87;
- goto yy3;
+ switch (yych) {
+ case ';': goto yy87;
+ default: goto yy3;
+ }
yy6:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy83;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy83;
+ default: goto yy3;
+ }
yy7:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy77;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy77;
+ default: goto yy3;
+ }
yy8:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy53;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy53;
+ default: goto yy3;
+ }
yy9:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy46;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy46;
+ default: goto yy3;
+ }
yy10:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy39;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy39;
+ default: goto yy3;
+ }
yy11:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy32;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy32;
+ default: goto yy3;
+ }
yy12:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy25;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy25;
+ default: goto yy3;
+ }
yy13:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy17;
- goto yy3;
+ switch (yych) {
+ case ':': goto yy17;
+ default: goto yy3;
+ }
yy14:
++YYCURSOR;
{
@@ -590,29 +611,63 @@
goto yy3;
yy17:
yych = *++YYCURSOR;
- if (yybm[0+yych] & 128) {
- goto yy20;
+ switch (yych) {
+ case '+': goto yy19;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy20;
+ default: goto yy18;
}
- if (yych == '+') goto yy19;
yy18:
YYCURSOR = YYMARKER;
goto yy3;
yy19:
yych = *++YYCURSOR;
- if (yybm[0+yych] & 128) {
- goto yy20;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy20;
+ default: goto yy18;
}
- goto yy18;
yy20:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
- if (yybm[0+yych] & 128) {
- goto yy20;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy20;
+ case ':': goto yy22;
+ default: goto yy18;
}
- if (yych != ':') goto yy18;
+yy22:
yych = *++YYCURSOR;
- if (yych != '"') goto yy18;
+ switch (yych) {
+ case '"': goto yy23;
+ default: goto yy18;
+ }
+yy23:
++YYCURSOR;
{
size_t len, len2, len3, maxlen;
@@ -762,27 +817,61 @@
}
yy25:
yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych != '+') goto yy18;
- } else {
- if (yych <= '-') goto yy26;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy27;
- goto yy18;
+ switch (yych) {
+ case '+':
+ case '-': goto yy26;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy27;
+ default: goto yy18;
}
yy26:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy27;
+ default: goto yy18;
+ }
yy27:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy27;
- if (yych >= ';') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy27;
+ case ':': goto yy29;
+ default: goto yy18;
+ }
+yy29:
yych = *++YYCURSOR;
- if (yych != '"') goto yy18;
+ switch (yych) {
+ case '"': goto yy30;
+ default: goto yy18;
+ }
+yy30:
++YYCURSOR;
{
if (!var_hash) return 0;
@@ -794,23 +883,60 @@
}
yy32:
yych = *++YYCURSOR;
- if (yych == '+') goto yy33;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy34;
- goto yy18;
+ switch (yych) {
+ case '+': goto yy33;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy34;
+ default: goto yy18;
+ }
yy33:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy34;
+ default: goto yy18;
+ }
yy34:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy34;
- if (yych >= ';') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy34;
+ case ':': goto yy36;
+ default: goto yy18;
+ }
+yy36:
yych = *++YYCURSOR;
- if (yych != '{') goto yy18;
+ switch (yych) {
+ case '{': goto yy37;
+ default: goto yy18;
+ }
+yy37:
++YYCURSOR;
{
long elements = parse_iv(start + 2);
@@ -834,23 +960,60 @@
}
yy39:
yych = *++YYCURSOR;
- if (yych == '+') goto yy40;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy41;
- goto yy18;
+ switch (yych) {
+ case '+': goto yy40;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy41;
+ default: goto yy18;
+ }
yy40:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy41;
+ default: goto yy18;
+ }
yy41:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy41;
- if (yych >= ';') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy41;
+ case ':': goto yy43;
+ default: goto yy18;
+ }
+yy43:
yych = *++YYCURSOR;
- if (yych != '"') goto yy18;
+ switch (yych) {
+ case '"': goto yy44;
+ default: goto yy18;
+ }
+yy44:
++YYCURSOR;
{
size_t len, maxlen;
@@ -882,23 +1045,60 @@
}
yy46:
yych = *++YYCURSOR;
- if (yych == '+') goto yy47;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy48;
- goto yy18;
+ switch (yych) {
+ case '+': goto yy47;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy48;
+ default: goto yy18;
+ }
yy47:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy48;
+ default: goto yy18;
+ }
yy48:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy48;
- if (yych >= ';') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy48;
+ case ':': goto yy50;
+ default: goto yy18;
+ }
+yy50:
yych = *++YYCURSOR;
- if (yych != '"') goto yy18;
+ switch (yych) {
+ case '"': goto yy51;
+ default: goto yy18;
+ }
+yy51:
++YYCURSOR;
{
size_t len, maxlen;
@@ -929,88 +1129,124 @@
}
yy53:
yych = *++YYCURSOR;
- if (yych <= '/') {
- if (yych <= ',') {
- if (yych == '+') goto yy57;
- goto yy18;
- } else {
- if (yych <= '-') goto yy55;
- if (yych <= '.') goto yy60;
- goto yy18;
- }
- } else {
- if (yych <= 'I') {
- if (yych <= '9') goto yy58;
- if (yych <= 'H') goto yy18;
- goto yy56;
- } else {
- if (yych != 'N') goto yy18;
- }
+ switch (yych) {
+ case '+': goto yy57;
+ case '-': goto yy55;
+ case '.': goto yy60;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy58;
+ case 'I': goto yy56;
+ case 'N': goto yy54;
+ default: goto yy18;
}
+yy54:
yych = *++YYCURSOR;
- if (yych == 'A') goto yy76;
- goto yy18;
+ switch (yych) {
+ case 'A': goto yy76;
+ default: goto yy18;
+ }
yy55:
yych = *++YYCURSOR;
- if (yych <= '/') {
- if (yych == '.') goto yy60;
- goto yy18;
- } else {
- if (yych <= '9') goto yy58;
- if (yych != 'I') goto yy18;
+ switch (yych) {
+ case '.': goto yy60;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy58;
+ case 'I': goto yy56;
+ default: goto yy18;
}
yy56:
yych = *++YYCURSOR;
- if (yych == 'N') goto yy72;
- goto yy18;
+ switch (yych) {
+ case 'N': goto yy72;
+ default: goto yy18;
+ }
yy57:
yych = *++YYCURSOR;
- if (yych == '.') goto yy60;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '.': goto yy60;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy58;
+ default: goto yy18;
+ }
yy58:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
- if (yych <= ':') {
- if (yych <= '.') {
- if (yych <= '-') goto yy18;
- goto yy70;
- } else {
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy58;
- goto yy18;
- }
- } else {
- if (yych <= 'E') {
- if (yych <= ';') goto yy63;
- if (yych <= 'D') goto yy18;
- goto yy65;
- } else {
- if (yych == 'e') goto yy65;
- goto yy18;
- }
+ switch (yych) {
+ case '.': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy58;
+ case ';': goto yy63;
+ case 'E':
+ case 'e': goto yy65;
+ default: goto yy18;
}
yy60:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy61;
+ default: goto yy18;
+ }
yy61:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
- if (yych <= ';') {
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy61;
- if (yych <= ':') goto yy18;
- } else {
- if (yych <= 'E') {
- if (yych <= 'D') goto yy18;
- goto yy65;
- } else {
- if (yych == 'e') goto yy65;
- goto yy18;
- }
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy61;
+ case ';': goto yy63;
+ case 'E':
+ case 'e': goto yy65;
+ default: goto yy18;
}
yy63:
++YYCURSOR;
@@ -1025,61 +1261,104 @@
}
yy65:
yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych != '+') goto yy18;
- } else {
- if (yych <= '-') goto yy66;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy67;
- goto yy18;
+ switch (yych) {
+ case '+':
+ case '-': goto yy66;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy67;
+ default: goto yy18;
}
yy66:
yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych == '+') goto yy69;
- goto yy18;
- } else {
- if (yych <= '-') goto yy69;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '+':
+ case '-': goto yy69;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy67;
+ default: goto yy18;
}
yy67:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy67;
- if (yych == ';') goto yy63;
- goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy67;
+ case ';': goto yy63;
+ default: goto yy18;
+ }
yy69:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy67;
- goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy67;
+ default: goto yy18;
+ }
yy70:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
- if (yych <= ';') {
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy70;
- if (yych <= ':') goto yy18;
- goto yy63;
- } else {
- if (yych <= 'E') {
- if (yych <= 'D') goto yy18;
- goto yy65;
- } else {
- if (yych == 'e') goto yy65;
- goto yy18;
- }
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy70;
+ case ';': goto yy63;
+ case 'E':
+ case 'e': goto yy65;
+ default: goto yy18;
}
yy72:
yych = *++YYCURSOR;
- if (yych != 'F') goto yy18;
+ switch (yych) {
+ case 'F': goto yy73;
+ default: goto yy18;
+ }
yy73:
yych = *++YYCURSOR;
- if (yych != ';') goto yy18;
+ switch (yych) {
+ case ';': goto yy74;
+ default: goto yy18;
+ }
+yy74:
++YYCURSOR;
{
*p = YYCURSOR;
@@ -1097,29 +1376,61 @@
}
yy76:
yych = *++YYCURSOR;
- if (yych == 'N') goto yy73;
- goto yy18;
+ switch (yych) {
+ case 'N': goto yy73;
+ default: goto yy18;
+ }
yy77:
yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych != '+') goto yy18;
- } else {
- if (yych <= '-') goto yy78;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy79;
- goto yy18;
+ switch (yych) {
+ case '+':
+ case '-': goto yy78;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ default: goto yy18;
}
yy78:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ default: goto yy18;
+ }
yy79:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy79;
- if (yych != ';') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case ';': goto yy81;
+ default: goto yy18;
+ }
+yy81:
++YYCURSOR;
{
#if SIZEOF_LONG == 4
@@ -1149,10 +1460,18 @@
}
yy83:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= '2') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1': goto yy84;
+ default: goto yy18;
+ }
+yy84:
yych = *++YYCURSOR;
- if (yych != ';') goto yy18;
+ switch (yych) {
+ case ';': goto yy85;
+ default: goto yy18;
+ }
+yy85:
++YYCURSOR;
{
*p = YYCURSOR;
@@ -1170,25 +1489,55 @@
}
yy89:
yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych != '+') goto yy18;
- } else {
- if (yych <= '-') goto yy90;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy91;
- goto yy18;
+ switch (yych) {
+ case '+':
+ case '-': goto yy90;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy91;
+ default: goto yy18;
}
yy90:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy91;
+ default: goto yy18;
+ }
yy91:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy91;
- if (yych != ';') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy91;
+ case ';': goto yy93;
+ default: goto yy18;
+ }
+yy93:
++YYCURSOR;
{
long id;
@@ -1214,25 +1563,55 @@
}
yy95:
yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych != '+') goto yy18;
- } else {
- if (yych <= '-') goto yy96;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy97;
- goto yy18;
+ switch (yych) {
+ case '+':
+ case '-': goto yy96;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy97;
+ default: goto yy18;
}
yy96:
yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy97;
+ default: goto yy18;
+ }
yy97:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy97;
- if (yych != ';') goto yy18;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy97;
+ case ';': goto yy99;
+ default: goto yy18;
+ }
+yy99:
++YYCURSOR;
{
long id;
debian/patches/CVE-2016-10159.patch 0000664 0000000 0000000 00000002472 13047111403 013317 0 ustar From ca46d0acbce55019b970fcd4c1e8a10edfdded93 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Fri, 30 Dec 2016 15:34:46 -0800
Subject: [PATCH] Fix int overflows in phar (bug #73764)
---
ext/phar/phar.c | 4 ++--
ext/phar/tests/bug73764.phar | Bin 0 -> 138 bytes
ext/phar/tests/bug73764.phpt | 16 ++++++++++++++++
3 files changed, 18 insertions(+), 2 deletions(-)
create mode 100644 ext/phar/tests/bug73764.phar
create mode 100644 ext/phar/tests/bug73764.phpt
Index: php5-5.5.9+dfsg/ext/phar/phar.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/phar/phar.c 2017-02-09 11:04:17.711361862 -0500
+++ php5-5.5.9+dfsg/ext/phar/phar.c 2017-02-09 11:04:17.711361862 -0500
@@ -1054,7 +1054,7 @@
entry.is_persistent = mydata->is_persistent;
for (manifest_index = 0; manifest_index < manifest_count; ++manifest_index) {
- if (buffer + 4 > endbuffer) {
+ if (buffer + 24 > endbuffer) {
MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)")
}
@@ -1068,7 +1068,7 @@
entry.manifest_pos = manifest_index;
}
- if (entry.filename_len + 20 > endbuffer - buffer) {
+ if (entry.filename_len > endbuffer - buffer - 20) {
MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
}
debian/patches/CVE-2016-4539.patch 0000664 0000000 0000000 00000002516 12717366575 013274 0 ustar From dccda88f27a084bcbbb30198ace12b4e7ae961cc Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sun, 24 Apr 2016 23:50:57 -0700
Subject: [PATCH] Fix bug #72099: xml_parse_into_struct segmentation fault
---
ext/xml/tests/bug72099.phpt | 17 +++++++
ext/xml/xml.c | 106 ++++++++++++++++++++++----------------------
2 files changed, 70 insertions(+), 53 deletions(-)
create mode 100644 ext/xml/tests/bug72099.phpt
diff --git a/ext/xml/tests/bug72099.phpt b/ext/xml/tests/bug72099.phpt
new file mode 100644
index 0000000..50173a6
--- /dev/null
+++ b/ext/xml/tests/bug72099.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #72099: xml_parse_into_struct segmentation fault
+--SKIPIF--
+
+--FILE--
+level <= XML_MAXLEVEL) {
+ if (parser->level <= XML_MAXLEVEL && parser->level > 0) {
MAKE_STD_ZVAL(tag);
array_init(tag);
debian/patches/CVE-2018-14883.patch 0000664 0000000 0000000 00000002400 13347655563 013347 0 ustar From 1baeae42703f9b2ec21fff787146eeca08d45535 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Tue, 19 Jun 2018 16:26:36 -0700
Subject: [PATCH] Fix bug #76423 - Int Overflow lead to Heap OverFlow in
exif_thumbnail_extract of exif.c
---
ext/exif/exif.c | 5 ++++-
ext/exif/tests/bug76423.jpg | Bin 0 -> 1537 bytes
ext/exif/tests/bug76423.phpt | 19 +++++++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 ext/exif/tests/bug76423.jpg
create mode 100644 ext/exif/tests/bug76423.phpt
Index: php5-5.5.9+dfsg/ext/exif/exif.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/exif/exif.c 2018-09-17 03:44:49.270385024 -0400
+++ php5-5.5.9+dfsg/ext/exif/exif.c 2018-09-17 03:44:49.270385024 -0400
@@ -2566,7 +2566,10 @@ static void exif_thumbnail_extract(image
return;
}
/* Check to make sure we are not going to go past the ExifLength */
- if ((ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) {
+ if (ImageInfo->Thumbnail.size > length
+ || (ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length
+ || ImageInfo->Thumbnail.offset > length - ImageInfo->Thumbnail.size
+ ) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
return;
}
debian/patches/php-fpm-man-section-and-cleanup.patch 0000664 0000000 0000000 00000002745 12300436054 017614 0 ustar Description: Fix php-fpm's manpage section to match location of binary
(/usr/sbin,) additionally, remove some stuff that is useless or
doesn't apply to Debian.
Origin: vendor
Forwarded: http://bugs.php.net/52476
Last-Update: 2010-07-29
--- php5.orig/sapi/fpm/php-fpm.8.in
+++ php5/sapi/fpm/php-fpm.8.in
@@ -126,22 +126,8 @@ The configuration file for the php-fpm d
.TP
.B php.ini
The standard php configuration file.
-.SH EXAMPLES
-For any unix systems which use init.d for their main process manager, you should use the init script provided to start and stop the php-fpm daemon.
-.P
-.PD 1
-.RS
-sudo /etc/init.d/php-fpm start
-.RE
-.TP
-For any unix systems which use systemd for their main process manager, you should use the unit file provided to start and stop the php-fpm daemon.
-.P
-.PD 1
-.RS
-sudo systemctl start php-fpm.service
-.RE
-.TP
-If your installation has no appropriate init script, launch php-fpm with no arguments. It will launch as a daemon (background process) by default. The file @php_fpm_localstatedir@/run/php-fpm.pid determines whether php-fpm is already up and running. Once started, php-fpm then responds to several POSIX signals:
+.SH SIGNAL
+Once started, php-fpm then responds to several POSIX signals:
.P
.PD 0
.RS
@@ -155,10 +141,6 @@ If your installation has no appropriate
.RE
.PD 1
.P
-.SH TIPS
-The PHP-FPM CGI daemon will work well with most popular webservers, including Apache2, lighttpd and nginx.
-.PD 1
-.P
.SH SEE ALSO
The PHP-FPM website:
.PD 0
debian/patches/php-5.4.0-dlopen.patch 0000664 0000000 0000000 00000001447 12300436054 014353 0 ustar --- php5.orig/Zend/zend.h
+++ php5/Zend/zend.h
@@ -90,11 +90,11 @@
# endif
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
+# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
# elif defined(RTLD_DEEPBIND)
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
+# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL | RTLD_DEEPBIND)
# else
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
+# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL)
# endif
# define DL_UNLOAD dlclose
# if defined(DLSYM_NEEDS_UNDERSCORE)
debian/patches/bug71527.patch 0000664 0000000 0000000 00000004321 12704222127 013022 0 ustar From fe13566c93f118a15a96320a546c7878fd0cfc5e Mon Sep 17 00:00:00 2001
From: Anatol Belski
Date: Mon, 28 Mar 2016 00:45:19 +0200
Subject: [PATCH] Fixed bug #71527 Buffer over-write in finfo_open with
malformed magic file
The actual fix is applying the upstream patch from
https://github.com/file/file/commit/6713ca45e7757297381f4b4cdb9cf5e624a9ad36
---
ext/fileinfo/libmagic/funcs.c | 2 +-
ext/fileinfo/tests/bug71527.magic | 1 +
ext/fileinfo/tests/bug71527.phpt | 19 +++++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
create mode 100644 ext/fileinfo/tests/bug71527.magic
create mode 100644 ext/fileinfo/tests/bug71527.phpt
diff --git a/ext/fileinfo/libmagic/funcs.c b/ext/fileinfo/libmagic/funcs.c
index 011ca42..def2f7b 100644
--- a/ext/fileinfo/libmagic/funcs.c
+++ b/ext/fileinfo/libmagic/funcs.c
@@ -414,7 +414,7 @@ file_check_mem(struct magic_set *ms, unsigned int level)
size_t len;
if (level >= ms->c.len) {
- len = (ms->c.len += 20) * sizeof(*ms->c.li);
+ len = (ms->c.len += 20 + level) * sizeof(*ms->c.li);
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
emalloc(len) :
erealloc(ms->c.li, len));
diff --git a/ext/fileinfo/tests/bug71527.magic b/ext/fileinfo/tests/bug71527.magic
new file mode 100644
index 0000000..14d7781
--- /dev/null
+++ b/ext/fileinfo/tests/bug71527.magic
@@ -0,0 +1 @@
+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\ No newline at end of file
diff --git a/ext/fileinfo/tests/bug71527.phpt b/ext/fileinfo/tests/bug71527.phpt
new file mode 100644
index 0000000..f5b1d86
--- /dev/null
+++ b/ext/fileinfo/tests/bug71527.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #71527 Buffer over-write in finfo_open with malformed magic file
+--SKIPIF--
+
+--EXPECTF--
+Warning: finfo_open(): Failed to load magic database at '%sbug71527.magic'. in %sbug71527.php on line %d
+
+Warning: finfo_file() expects parameter 1 to be resource, boolean given in %sbug71527.php on line %d
+bool(false)
--
2.1.4
debian/patches/CVE-2015-8876.patch 0000664 0000000 0000000 00000005664 12746374416 013305 0 ustar From e488690d957fce0dbdabe619adbe314ada498215 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sun, 26 Jul 2015 17:09:34 -0700
Subject: [PATCH] Fix bug #70121 (unserialize() could lead to unexpected
methods execution / NULL pointer deref)
---
Zend/tests/bug70121.phpt | 9 +++++++++
Zend/zend_exceptions.c | 17 +++++++++--------
2 files changed, 18 insertions(+), 8 deletions(-)
create mode 100644 Zend/tests/bug70121.phpt
Index: php5-5.5.9+dfsg/Zend/tests/bug70121.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/Zend/tests/bug70121.phpt 2016-07-28 08:22:36.107754568 -0400
@@ -0,0 +1,9 @@
+--TEST--
+Bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
+--FILE--
+
+OK
+--EXPECT--
+OK
Index: php5-5.5.9+dfsg/Zend/zend_exceptions.c
===================================================================
--- php5-5.5.9+dfsg.orig/Zend/zend_exceptions.c 2016-07-28 08:22:36.111754616 -0400
+++ php5-5.5.9+dfsg/Zend/zend_exceptions.c 2016-07-28 08:22:36.107754568 -0400
@@ -41,7 +41,7 @@
if (exception == add_previous || !add_previous || !exception) {
return;
}
- if (Z_TYPE_P(add_previous) != IS_OBJECT && !instanceof_function(Z_OBJCE_P(add_previous), default_exception_ce TSRMLS_CC)) {
+ if (Z_TYPE_P(add_previous) != IS_OBJECT || !instanceof_function(Z_OBJCE_P(add_previous), default_exception_ce TSRMLS_CC)) {
zend_error(E_ERROR, "Cannot set non exception as previous exception");
return;
}
@@ -611,15 +611,15 @@
int len = 0;
zend_fcall_info fci;
zval fname;
-
+
DEFAULT_0_PARAMS;
-
+
str = estrndup("", 0);
exception = getThis();
ZVAL_STRINGL(&fname, "gettraceasstring", sizeof("gettraceasstring")-1, 1);
- while (exception && Z_TYPE_P(exception) == IS_OBJECT) {
+ while (exception && Z_TYPE_P(exception) == IS_OBJECT && instanceof_function(Z_OBJCE_P(exception), default_exception_ce TSRMLS_CC)) {
prev_str = str;
_default_exception_get_entry(exception, "message", sizeof("message")-1, &message TSRMLS_CC);
_default_exception_get_entry(exception, "file", sizeof("file")-1, &file TSRMLS_CC);
@@ -629,6 +629,7 @@
convert_to_string(&file);
convert_to_long(&line);
+ trace = NULL;
fci.size = sizeof(fci);
fci.function_table = &Z_OBJCE_P(exception)->function_table;
fci.function_name = &fname;
@@ -641,7 +642,7 @@
zend_call_function(&fci, NULL TSRMLS_CC);
- if (Z_TYPE_P(trace) != IS_STRING) {
+ if (trace && Z_TYPE_P(trace) != IS_STRING) {
zval_ptr_dtor(&trace);
trace = NULL;
}
debian/patches/CVE-2015-7803.patch 0000664 0000000 0000000 00000002014 12613762210 013236 0 ustar Description: fix null pointer dereference in phar_get_fp_offset()
Origin: upstream, http://git.php.net/?p=php-src.git;a=commit;h=d698f0ae51f67c9cce870b09c59df3d6ba959244
Origin: upstream, http://git.php.net/?p=php-src.git;a=commit;h=f98ab19dc0c978e3caaa2614579e4a61f2c317f5
Bug: https://bugs.php.net/bug.php?id=69720
Index: php5-5.6.11+dfsg/ext/phar/util.c
===================================================================
--- php5-5.6.11+dfsg.orig/ext/phar/util.c 2015-07-09 20:33:32.000000000 -0400
+++ php5-5.6.11+dfsg/ext/phar/util.c 2015-10-27 16:45:38.051419680 -0400
@@ -494,7 +494,12 @@
(*ret)->is_tar = entry->is_tar;
(*ret)->fp = phar_get_efp(entry, 1 TSRMLS_CC);
if (entry->link) {
- (*ret)->zero = phar_get_fp_offset(phar_get_link_source(entry TSRMLS_CC) TSRMLS_CC);
+ phar_entry_info *link = phar_get_link_source(entry TSRMLS_CC);
+ if(!link) {
+ efree(*ret);
+ return FAILURE;
+ }
+ (*ret)->zero = phar_get_fp_offset(link TSRMLS_CC);
} else {
(*ret)->zero = phar_get_fp_offset(entry TSRMLS_CC);
}
debian/patches/series 0000664 0000000 0000000 00000012017 13457376137 012055 0 ustar 001-libtool_fixes.patch
002-static_openssl.patch
006-debian_quirks.patch
libtool2.2.patch
033-we_WANT_libtool.patch
044-strtod_arm_fix.patch
052-phpinfo_no_configure.patch
053-extension_api.patch
057-no_apache_installed.patch
100-recode_is_shared.patch
112-proc_open.patch
113-php.ini_securitynotes.patch
libdb_is_-ldb
use_embedded_timezonedb.patch
force_libmysqlclient_r.patch
sybase-alias.patch
strcmp_null-OnUpdateErrorLog.patch
dont-gitclean-in-build.patch
qdbm-is-usr_include_qdbm.patch
use_embedded_timezonedb_fixes.patch
session_save_path.patch
php-fpm-man-section-and-cleanup.patch
fpm-config.patch
php-fpm-sysconfdir.patch
lp564920-fix-big-files.patch
temporary-path-fixes-for-multiarch.patch
gdIOCtx.patch
hurd-noptrace.diff
php-5.3.9-mysqlnd.patch
php-5.3.9-gnusrc.patch
php-5.3.3-macropen.patch
php-5.2.4-norpath.patch
php-fpm-listen-on-unix-socket.patch
php-5.2.4-embed.patch
php-5.4.0-dlopen.patch
php-fpm-m68k.patch
expose_all_built_and_installed_apis.patch
use_system_timezone.patch
CVE-2014-1943.patch
imageconvolution-regression.patch
CVE-2014-2270.patch
CVE-2014-0185.patch
CVE-2014-0237.patch
CVE-2014-0238.patch
CVE-2014-4049.patch
CVE-2014-0207.patch
CVE-2014-3478.patch
CVE-2014-3479.patch
CVE-2014-3480.patch
CVE-2014-3487.patch
CVE-2014-3515.patch
CVE-2014-4670.patch
CVE-2014-4698.patch
CVE-2014-4721.patch
CVE-2014-3587.patch
CVE-2014-3597.patch
CVE-2014-3668.patch
CVE-2014-3669.patch
CVE-2014-3670.patch
curl_embedded_null.patch
remove_readelf.patch
CVE-2014-8142.patch
CVE-2014-9427.patch
CVE-2014-9652.patch
CVE-2015-0231.patch
CVE-2015-0232.patch
CVE-2015-1351.patch
CVE-2015-1352.patch
CVE-2014-8117.patch
CVE-2014-9705.patch
CVE-2015-0273.patch
CVE-2015-2301.patch
CVE-2015-2305.patch
CVE-2015-2348.patch
CVE-2015-2783.patch
CVE-2015-2787.patch
bug69218.patch
bug69441.patch
CVE-2015-2783-memleak.patch
CVE-2015-3411.patch
CVE-2015-4021.patch
CVE-2015-4022.patch
CVE-2015-4024.patch
CVE-2015-4025.patch
CVE-2015-4147.patch
CVE-2015-4598.patch
CVE-2015-4599.patch
CVE-2015-4602.patch
CVE-2015-4603.patch
CVE-2015-4643.patch
CVE-2015-4644.patch
fix-68185-inconsistent-insteadof-definition.patch
CVE-2015-5589-1.patch
CVE-2015-5589-2.patch
CVE-2015-5590.patch
CVE-2015-6831-1.patch
CVE-2015-6831-2.patch
CVE-2015-6831-3.patch
CVE-2015-6832.patch
CVE-2015-6833-1.patch
CVE-2015-6834-1.patch
CVE-2015-6834-2.patch
CVE-2015-6834-3.patch
CVE-2015-6835-1.patch
CVE-2015-6835-2.patch
CVE-2015-6836.patch
CVE-2015-6837-6838.patch
CVE-2015-7803.patch
CVE-2015-7804.patch
CVE-2014-9767.patch
CVE-2015-8835.patch
CVE-2015-8838.patch
CVE-2016-1903.patch
CVE-2016-2554.patch
CVE-2016-3141.patch
CVE-2016-3142.patch
bug64938.patch
bug70014.patch
bug71527.patch
bug71704.patch
bug71798.patch
bug71860.patch
bug71906.patch
CVE-2016-4342.patch
CVE-2016-4343.patch
CVE-2016-4537.patch
CVE-2016-4539.patch
CVE-2016-4540.patch
CVE-2016-4542.patch
zlib-largefile-function-renaming.patch
CVE-2015-4116.patch
CVE-2015-8873.patch
CVE-2015-8876.patch
CVE-2015-8935.patch
CVE-2016-5093.patch
CVE-2016-5094.patch
CVE-2016-5095.patch
CVE-2016-5096.patch
CVE-2016-5114.patch
CVE-2016-5385.patch
CVE-2016-5399.patch
CVE-2016-5768.patch
CVE-2016-5769.patch
CVE-2016-5771.patch
CVE-2016-5772.patch
CVE-2016-5773.patch
CVE-2016-6288.patch
CVE-2016-6289.patch
CVE-2016-6290.patch
CVE-2016-6291.patch
CVE-2016-6292.patch
CVE-2016-6294.patch
CVE-2016-6295.patch
CVE-2016-6296.patch
CVE-2016-6297.patch
fix_exif_tests.patch
CVE-2016-7124-1.patch
CVE-2016-7124-2.patch
CVE-2016-7125.patch
CVE-2016-7125-2.patch
CVE-2016-7127.patch
CVE-2016-7128.patch
CVE-2016-7129.patch
CVE-2016-7130.patch
CVE-2016-7131.patch
CVE-2016-7411.patch
CVE-2016-7412.patch
CVE-2016-7413.patch
CVE-2016-7414.patch
CVE-2016-7416.patch
CVE-2016-7417.patch
CVE-2016-7417-2.patch
CVE-2016-7418.patch
CVE-2014-9912.patch
CVE-2014-9912-2.patch
CVE-2016-7478-pre.patch
CVE-2016-7478-pre2.patch
CVE-2016-7478.patch
CVE-2016-9137.patch
CVE-2016-9934.patch
CVE-2016-9935-1.patch
CVE-2016-9935-2.patch
CVE-2016-9935-3.patch
CVE-2016-7479-pre.patch
CVE-2016-7479.patch
CVE-2016-10158.patch
CVE-2016-10159.patch
CVE-2016-10160.patch
CVE-2016-10161.patch
CVE-2015-8994-1.patch
CVE-2015-8994-2.patch
CVE-2015-8994-3.patch
CVE-2016-10397-1.patch
CVE-2016-10397-2.patch
CVE-2017-11143-1.patch
CVE-2017-11143-2.patch
CVE-2017-11144.patch
CVE-2017-11147.patch
CVE-2017-11362.patch
CVE-2017-11628.patch
CVE-2017-9224.patch
CVE-2017-9226.patch
CVE-2017-9227.patch
CVE-2017-9228.patch
CVE-2017-9229.patch
CVE-2017-11145.patch
CVE-2017-12933.patch
CVE-2017-16642.patch
CVE-2018-5712.patch
CVE-2016-6291-regression.patch
CVE-2016-10712.patch
CVE-2016-10712-2.patch
CVE-2018-7584.patch
CVE-2018-10545.patch
CVE-2018-10546-1.patch
CVE-2018-10546-2.patch
CVE-2018-10547.patch
CVE-2018-10548.patch
CVE-2018-14851.patch
CVE-2018-14883.patch
bug76582.patch
CVE-2019-9020.patch
CVE-2019-9021.patch
CVE-2019-9023-1.patch
CVE-2019-9023-2.patch
CVE-2019-9023-3.patch
CVE-2019-9023-4.patch
CVE-2019-9024.patch
CVE-2019-9637.patch
CVE-2019-9638-and-CVE-2019-9639.patch
CVE-2019-9640.patch
CVE-2019-9641.patch
Changed-the-way-MAKERNOTE-is-handled-in-case.patch
CVE-2019-9675.patch
CVE-2019-9022.patch
debian/patches/hurd-noptrace.diff 0000664 0000000 0000000 00000000524 12300436054 014222 0 ustar --- php5.orig/sapi/fpm/config.m4
+++ php5/sapi/fpm/config.m4
@@ -147,6 +147,11 @@ AC_DEFUN([AC_FPM_TRACE],
pid_t child;
int status;
+ /* broken ptrace on Hurd, avoid hanging */
+ #ifdef __GNU__
+ return 10;
+ #endif
+
if ( (child = fork()) ) { /* parent */
int ret = 0;
debian/patches/CVE-2019-9023-3.patch 0000664 0000000 0000000 00000013140 13437472473 013416 0 ustar From 31f59e1f3074ab344b473dde6077a6844ca87264 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Wed, 2 Jan 2019 00:36:30 -0800
Subject: [PATCH] Fix more issues with encodilng length
Should fix bug #77381, bug #77382, bug #77385, bug #77394.
---
ext/mbstring/oniguruma/enc/unicode.c | 1 +
ext/mbstring/oniguruma/regcomp.c | 11 +++++------
ext/mbstring/oniguruma/regparse.c | 10 +++-------
ext/mbstring/oniguruma/regparse.h | 12 ++++++++++++
ext/mbstring/tests/bug77371.phpt | 2 +-
ext/mbstring/tests/bug77381.phpt | 16 ++++++++++++++++
6 files changed, 38 insertions(+), 14 deletions(-)
create mode 100644 ext/mbstring/tests/bug77381.phpt
Index: php5-5.5.9+dfsg/ext/mbstring/oniguruma/enc/unicode.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/mbstring/oniguruma/enc/unicode.c 2019-03-05 08:10:16.340873845 -0500
+++ php5-5.5.9+dfsg/ext/mbstring/oniguruma/enc/unicode.c 2019-03-05 08:10:16.328873815 -0500
@@ -10971,6 +10971,7 @@ onigenc_unicode_mbc_case_fold(OnigEncodi
code = ONIGENC_MBC_TO_CODE(enc, p, end);
len = enclen(enc, p);
+ if (*pp + len > end) len = end - *pp;
*pp += len;
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
Index: php5-5.5.9+dfsg/ext/mbstring/oniguruma/regcomp.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/mbstring/oniguruma/regcomp.c 2019-03-05 08:10:16.340873845 -0500
+++ php5-5.5.9+dfsg/ext/mbstring/oniguruma/regcomp.c 2019-03-05 08:10:16.328873815 -0500
@@ -469,13 +469,13 @@ compile_length_string_node(Node* node, r
ambig = NSTRING_IS_AMBIG(node);
p = prev = sn->s;
- prev_len = enclen(enc, p);
+ SAFE_ENC_LEN(enc, p, sn->end, prev_len);
p += prev_len;
slen = 1;
rlen = 0;
for (; p < sn->end; ) {
- len = enclen(enc, p);
+ SAFE_ENC_LEN(enc, p, sn->end, len);
if (len == prev_len) {
slen++;
}
@@ -518,13 +518,12 @@ compile_string_node(Node* node, regex_t*
ambig = NSTRING_IS_AMBIG(node);
p = prev = sn->s;
- prev_len = enclen(enc, p);
+ SAFE_ENC_LEN(enc, p, end, prev_len);
p += prev_len;
slen = 1;
for (; p < end; ) {
- len = enclen(enc, p);
- if (p + len > end) len = end - p;
+ SAFE_ENC_LEN(enc, p, end, len);
if (len == prev_len) {
slen++;
}
@@ -3392,7 +3391,7 @@ expand_case_fold_string(Node* node, rege
goto err;
}
- len = enclen(reg->enc, p);
+ SAFE_ENC_LEN(reg->enc, p, end, len);
if (n == 0) {
if (IS_NULL(snode)) {
Index: php5-5.5.9+dfsg/ext/mbstring/oniguruma/regparse.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/mbstring/oniguruma/regparse.c 2019-03-05 08:10:16.340873845 -0500
+++ php5-5.5.9+dfsg/ext/mbstring/oniguruma/regparse.c 2019-03-05 08:10:16.328873815 -0500
@@ -246,12 +246,6 @@ strdup_with_null(OnigEncoding enc, UChar
}
#endif
-#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
-# define UNEXPECTED(condition) __builtin_expect(condition, 0)
-#else
-# define UNEXPECTED(condition) (condition)
-#endif
-
/* scan pattern methods */
#define PEND_VALUE 0
@@ -3582,7 +3576,9 @@ fetch_token(OnigToken* tok, UChar** src,
tok->u.code = (OnigCodePoint )num;
}
else { /* string */
- p = tok->backp + enclen(enc, tok->backp);
+ int len;
+ SAFE_ENC_LEN(enc, tok->backp, end, len);
+ p = tok->backp + len;
}
break;
}
Index: php5-5.5.9+dfsg/ext/mbstring/oniguruma/regparse.h
===================================================================
--- php5-5.5.9+dfsg.orig/ext/mbstring/oniguruma/regparse.h 2019-03-05 08:10:16.340873845 -0500
+++ php5-5.5.9+dfsg/ext/mbstring/oniguruma/regparse.h 2019-03-05 08:10:16.336873834 -0500
@@ -348,4 +348,16 @@ extern int onig_print_names(FILE*, regex
#endif
#endif
+#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
+# define UNEXPECTED(condition) __builtin_expect(condition, 0)
+#else
+# define UNEXPECTED(condition) (condition)
+#endif
+
+#define SAFE_ENC_LEN(enc, p, end, res) do { \
+ int __res = enclen(enc, p); \
+ if (UNEXPECTED(p + __res > end)) __res = end - p; \
+ res = __res; \
+} while(0);
+
#endif /* REGPARSE_H */
Index: php5-5.5.9+dfsg/ext/mbstring/tests/bug77371.phpt
===================================================================
--- php5-5.5.9+dfsg.orig/ext/mbstring/tests/bug77371.phpt 2019-03-05 08:10:16.340873845 -0500
+++ php5-5.5.9+dfsg/ext/mbstring/tests/bug77371.phpt 2019-03-05 08:10:16.336873834 -0500
@@ -4,7 +4,7 @@ Bug #77371 (heap buffer overflow in mb r
--FILE--
--EXPECT--
bool(false)
\ No newline at end of file
Index: php5-5.5.9+dfsg/ext/mbstring/tests/bug77381.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/mbstring/tests/bug77381.phpt 2019-03-05 08:10:16.336873834 -0500
@@ -0,0 +1,16 @@
+--TEST--
+Bug #77381 (heap buffer overflow in multibyte match_at)
+--SKIPIF--
+
+--FILE--
+
+--EXPECT--
+int(1)
+bool(false)
+bool(false)
+bool(false)
debian/patches/CVE-2014-3668.patch 0000664 0000000 0000000 00000006417 12423726125 013261 0 ustar From 44035de79f5b9646064d9bdd0329a946b0c5372a Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sun, 28 Sep 2014 17:33:44 -0700
Subject: [PATCH] Fix bug #68027 - fix date parsing in XMLRPC lib
---
ext/xmlrpc/libxmlrpc/xmlrpc.c | 13 ++++++++-----
ext/xmlrpc/tests/bug68027.phpt | 44 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 5 deletions(-)
create mode 100644 ext/xmlrpc/tests/bug68027.phpt
diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c
index ce70c2a..b766a54 100644
--- a/ext/xmlrpc/libxmlrpc/xmlrpc.c
+++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c
@@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || tm.tm_mon > 11) {
+ return -1;
+ }
n = 10;
tm.tm_mday = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+6])
tm.tm_mday += (text[i+6]-'0')*n;
n /= 10;
}
@@ -236,7 +239,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_hour = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+9])
tm.tm_hour += (text[i+9]-'0')*n;
n /= 10;
}
@@ -244,7 +247,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_min = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+12])
tm.tm_min += (text[i+12]-'0')*n;
n /= 10;
}
@@ -252,7 +255,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_sec = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+15])
tm.tm_sec += (text[i+15]-'0')*n;
n /= 10;
}
diff --git a/ext/xmlrpc/tests/bug68027.phpt b/ext/xmlrpc/tests/bug68027.phpt
new file mode 100644
index 0000000..a5c96f1
--- /dev/null
+++ b/ext/xmlrpc/tests/bug68027.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Bug #68027 (buffer overflow in mkgmtime() function)
+--SKIPIF--
+
+--FILE--
+$datetime");
+print_r($obj);
+
+$datetime = "34770-0-08T21:46:40-0400";
+$obj = xmlrpc_decode("$datetime");
+print_r($obj);
+
+echo "Done\n";
+?>
+--EXPECTF--
+object(stdClass)#1 (3) {
+ ["scalar"]=>
+ string(16) "6-01-01 20:00:00"
+ ["xmlrpc_type"]=>
+ string(8) "datetime"
+ ["timestamp"]=>
+ int(%d)
+}
+stdClass Object
+(
+ [scalar] => 2001-0-08T21:46:40-0400
+ [xmlrpc_type] => datetime
+ [timestamp] => %s
+)
+stdClass Object
+(
+ [scalar] => 34770-0-08T21:46:40-0400
+ [xmlrpc_type] => datetime
+ [timestamp] => %d
+)
+Done
--
2.1.0
debian/patches/Changed-the-way-MAKERNOTE-is-handled-in-case.patch 0000664 0000000 0000000 00000004330 13456142245 021421 0 ustar From d5796fb298abb2a3e389818ad924589fa35e58b9 Mon Sep 17 00:00:00 2001
From: Kalle Sommer Nielsen
Date: Wed, 3 Aug 2016 17:05:31 +0200
Subject: [PATCH] Changed the way MAKERNOTE is handled in case we do not have a
matching signature (Remi).
Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a security fix for MAKERNOTE.
The new behavior is to instead of stopping to parse, to continue so we can still fetch data like thumbnail and GPS, thrus allowing yet unsupported formats to parse. If EXIF's debugging mode is enabled, a notice will display in case we do not match against a valid MAKERNOTE signature.
This should temporarily fix bug #72682 (exif_read_data() fails to read all data for some images) until I get around to debug it further.
(cherry picked from commit aabcb5481d9e717df77192dab2894468b9fc63b4)
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 8f6a3784..e602d99c 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -1733,6 +1733,10 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
if (!length)
break;
case TAG_FMT_UNDEFINED:
+ if (tag == TAG_MAKER_NOTE) {
+ length = MIN(length, strlen(value));
+ }
+
if (value) {
/* do not recompute length here */
info_value->s = estrndup(value, length);
@@ -2752,8 +2756,14 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
int data_len;
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
- if (i==sizeof(maker_note_array)/sizeof(maker_note_type))
- return FALSE;
+ if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
+#ifdef EXIF_DEBUG
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "No maker note data found. Detected maker: %s (length = %d)", ImageInfo->make, strlen(ImageInfo->make));
+#endif
+ /* unknown manufacturer, not an error, use it as a string */
+ return TRUE;
+ }
+
maker_note = maker_note_array+i;
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/
debian/patches/CVE-2019-9638-and-CVE-2019-9639.patch 0000664 0000000 0000000 00000004533 13444735563 015454 0 ustar From b82437eeddadf6a3a8c0f492acb6861682cd4d93 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sat, 2 Mar 2019 15:07:40 -0800
Subject: [PATCH] Fix bug #77563 - Uninitialized read in
exif_process_IFD_in_MAKERNOTE
Also fix for bug #77659
---
ext/exif/exif.c | 3 ++-
ext/exif/tests/bug77563.jpg | Bin 0 -> 63 bytes
ext/exif/tests/bug77563.phpt | 16 ++++++++++++++++
3 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 ext/exif/tests/bug77563.jpg
create mode 100644 ext/exif/tests/bug77563.phpt
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 7fd53888..029d04ed 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -2766,7 +2766,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
break;
}
- if (maker_note->offset >= value_len) {
+ if (value_len < 2 || maker_note->offset >= value_len - 1) {
/* Do not go past the value end */
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X offset 0x%04X", value_len, maker_note->offset);
return FALSE;
@@ -2819,6 +2819,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
break;
default:
case MN_OFFSET_NORMAL:
+ data_len = value_len;
break;
}
#diff --git a/ext/exif/tests/bug77563.jpg b/ext/exif/tests/bug77563.jpg
#new file mode 100644
#index 0000000000000000000000000000000000000000..d6280151f096c2bbeb25477ce88360c0096f476e
#GIT binary patch
#literal 63
#zcmex=;~|5MYei-n1B0(GgBAk=0}l{0FfcLlGcW>aRv=cJR0C#n0@>Prp5Fd`ewo?%
#Hc_1+Wd}j(#
#
#literal 0
#HcmV?d00001
#
diff --git a/ext/exif/tests/bug77563.phpt b/ext/exif/tests/bug77563.phpt
new file mode 100644
index 00000000..c1458866
--- /dev/null
+++ b/ext/exif/tests/bug77563.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug 77563 (Uninitialized read in exif_process_IFD_in_MAKERNOTE)
+--SKIPIF--
+
+--FILE--
+
+DONE
+--EXPECTF--
+Warning: exif_thumbnail(bug77563.jpg): Illegal IFD offset in %s/bug77563.php on line %d
+
+Warning: exif_thumbnail(bug77563.jpg): File structure corrupted in %s/bug77563.php on line %d
+
+Warning: exif_thumbnail(bug77563.jpg): Invalid JPEG file in %s/bug77563.php on line %d
+DONE
\ No newline at end of file
--
2.20.1
debian/patches/CVE-2015-8935.patch 0000664 0000000 0000000 00000006756 12746433545 013303 0 ustar Description: fix XSS in header() with Internet Explorer
Origin: backport, http://git.php.net/?p=php-src.git;a=commit;h=996faf964bba1aec06b153b370a7f20d3dd2bb8b
Origin: backport, http://git.php.net/?p=php-src.git;a=commit;h=9ba4db5e5d6aae8b1df934fbe26ea976b026576d
Bug: https://bugs.php.net/bug.php?id=68978
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1594041
Index: php5-5.5.9+dfsg/ext/standard/tests/general_functions/bug60227_2.phpt
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/tests/general_functions/bug60227_2.phpt 2016-07-28 12:45:20.883908619 -0400
+++ php5-5.5.9+dfsg/ext/standard/tests/general_functions/bug60227_2.phpt 2016-07-28 12:46:55.273158831 -0400
@@ -1,14 +1,15 @@
--TEST--
Bug #60227 (header() cannot detect the multi-line header with CR), \r before \n
+--INI--
+expose_php=0
--FILE--
--EXPECTF--
+
Warning: Header may not contain more than a single header, new line detected in %s on line %d
foo
--EXPECTHEADERS--
-X-foo: e
-foo
+Content-type: text/html
Index: php5-5.5.9+dfsg/ext/standard/tests/general_functions/bug60227_3.phpt
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/tests/general_functions/bug60227_3.phpt 2016-07-28 12:45:20.883908619 -0400
+++ php5-5.5.9+dfsg/ext/standard/tests/general_functions/bug60227_3.phpt 2016-07-28 12:46:55.273158831 -0400
@@ -1,8 +1,9 @@
--TEST--
Bug #60227 (header() cannot detect the multi-line header with CR), \0 before \n
+--INI--
+expose_php=0
--FILE--
@@ -10,5 +11,4 @@
Warning: Header may not contain NUL bytes in %s on line %d
foo
--EXPECTHEADERS--
-X-foo: e
-foo
+Content-type: text/html
Index: php5-5.5.9+dfsg/ext/standard/tests/general_functions/bug60227_4.phpt
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/tests/general_functions/bug60227_4.phpt 2016-07-28 12:45:20.883908619 -0400
+++ php5-5.5.9+dfsg/ext/standard/tests/general_functions/bug60227_4.phpt 2016-07-28 12:46:55.273158831 -0400
@@ -1,8 +1,9 @@
--TEST--
Bug #60227 (header() cannot detect the multi-line header with CR), CRLF
+--INI--
+expose_php=0
--FILE--
@@ -10,5 +11,4 @@
Warning: Header may not contain more than a single header, new line detected in %s on line %d
foo
--EXPECTHEADERS--
-X-foo: e
- foo
+Content-type: text/html
Index: php5-5.5.9+dfsg/main/SAPI.c
===================================================================
--- php5-5.5.9+dfsg.orig/main/SAPI.c 2016-07-28 12:45:20.883908619 -0400
+++ php5-5.5.9+dfsg/main/SAPI.c 2016-07-28 12:45:20.883908619 -0400
@@ -743,13 +743,8 @@
/* new line/NUL character safety check */
int i;
for (i = 0; i < header_line_len; i++) {
- /* RFC 2616 allows new lines if followed by SP or HT */
- int illegal_break =
- (header_line[i+1] != ' ' && header_line[i+1] != '\t')
- && (
- header_line[i] == '\n'
- || (header_line[i] == '\r' && header_line[i+1] != '\n'));
- if (illegal_break) {
+ /* RFC 7230 ch. 3.2.4 deprecates folding support */
+ if (header_line[i] == '\n' || header_line[i] == '\r') {
efree(header_line);
sapi_module.sapi_error(E_WARNING, "Header may not contain "
"more than a single header, new line detected");
debian/patches/bug76582.patch 0000664 0000000 0000000 00000001517 13347655614 013053 0 ustar From 23b057742e3cf199612fa8050ae86cae675e214e Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sat, 28 Jul 2018 22:16:29 -0700
Subject: [PATCH] Fix for bug #76582
The brigade seems to end up in a messed up state if something fails
in shutdown, so we clean it up.
---
sapi/apache2handler/sapi_apache2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 6fa2521..0ebca9b 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -678,6 +678,7 @@ zend_first_try {
if (!parent_req) {
php_apache_request_dtor(r TSRMLS_CC);
ctx->request_processed = 1;
+ apr_brigade_cleanup(brigade);
bucket = apr_bucket_eos_create(r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(brigade, bucket);
--
2.1.4
debian/patches/CVE-2016-9137.patch 0000664 0000000 0000000 00000010215 13046611225 013243 0 ustar From 0e6fe3a4c96be2d3e88389a5776f878021b4c59f Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sun, 25 Sep 2016 19:53:59 -0700
Subject: [PATCH] Fix bug #73147: Use After Free in PHP7 unserialize()
---
Zend/zend_API.c | 24 ++++++++++++++++++++++++
Zend/zend_API.h | 1 +
ext/curl/curl_file.c | 5 ++++-
ext/curl/tests/bug73147.phpt | 20 ++++++++++++++++++++
4 files changed, 49 insertions(+), 1 deletion(-)
create mode 100644 ext/curl/tests/bug73147.phpt
Index: php5-5.5.9+dfsg/Zend/zend_API.c
===================================================================
--- php5-5.5.9+dfsg.orig/Zend/zend_API.c 2017-02-08 07:44:03.042957677 -0500
+++ php5-5.5.9+dfsg/Zend/zend_API.c 2017-02-08 07:44:03.042957677 -0500
@@ -3721,6 +3721,30 @@
}
/* }}} */
+ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, int name_length TSRMLS_DC) /* {{{ */
+{
+ zval *property;
+ zend_class_entry *old_scope = EG(scope);
+
+ EG(scope) = scope;
+
+ if (!Z_OBJ_HT_P(object)->unset_property) {
+ const char *class_name;
+ zend_uint class_name_len;
+
+ zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
+
+ zend_error(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, class_name);
+ }
+ MAKE_STD_ZVAL(property);
+ ZVAL_STRINGL(property, name, name_length, 1);
+ Z_OBJ_HT_P(object)->unset_property(object, property, 0 TSRMLS_CC);
+ zval_ptr_dtor(&property);
+
+ EG(scope) = old_scope;
+}
+/* }}} */
+
ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, int name_length TSRMLS_DC) /* {{{ */
{
zval *tmp;
Index: php5-5.5.9+dfsg/Zend/zend_API.h
===================================================================
--- php5-5.5.9+dfsg.orig/Zend/zend_API.h 2017-02-08 07:44:03.042957677 -0500
+++ php5-5.5.9+dfsg/Zend/zend_API.h 2017-02-08 07:44:03.042957677 -0500
@@ -327,6 +327,7 @@
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, int name_length, double value TSRMLS_DC);
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value TSRMLS_DC);
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value, int value_length TSRMLS_DC);
+ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, int name_length TSRMLS_DC);
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, int name_length, zval *value TSRMLS_DC);
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, int name_length TSRMLS_DC);
Index: php5-5.5.9+dfsg/ext/curl/curl_file.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/curl/curl_file.c 2017-02-08 07:44:03.042957677 -0500
+++ php5-5.5.9+dfsg/ext/curl/curl_file.c 2017-02-08 07:44:03.042957677 -0500
@@ -137,7 +137,10 @@
Unserialization handler */
ZEND_METHOD(CURLFile, __wakeup)
{
- zend_update_property_string(curl_CURLFile_class, getThis(), "name", sizeof("name")-1, "" TSRMLS_CC);
+ zval *_this = getThis();
+
+ zend_unset_property(curl_CURLFile_class, _this, "name", sizeof("name")-1 TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, _this, "name", sizeof("name")-1, "" TSRMLS_CC);
zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0 TSRMLS_CC);
}
/* }}} */
Index: php5-5.5.9+dfsg/ext/curl/tests/bug73147.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/curl/tests/bug73147.phpt 2017-02-08 07:44:03.042957677 -0500
@@ -0,0 +1,20 @@
+--TEST--
+Bug #73147: Use After Free in PHP7 unserialize()
+--SKIPIF--
+
+--FILE--
+getMessage();
+}
+?>
+--EXPECT--
+Unserialization of CURLFile instances is not allowed
debian/patches/006-debian_quirks.patch 0000664 0000000 0000000 00000013531 12300436054 014763 0 ustar Description: Changes to make php use versioned paths and other minor
cleanup changes.
Origin: vendor
Forwarded: not-needed
Last-Update: 2010-01-18
--- php5.orig/configure.in
+++ php5/configure.in
@@ -1068,7 +1068,7 @@ if test "$PHP_CLI" = "no"; then
fi
PHP_ARG_WITH(pear, [whether to install PEAR],
-[ --with-pear=DIR Install PEAR in DIR @<:@PREFIX/lib/php@:>@
+[ --with-pear=DIR Install PEAR in DIR @<:@PREFIX/lib/php5@:>@
--without-pear Do not install PEAR], DEFAULT, yes)
if test "$PHP_PEAR" != "no"; then
@@ -1098,7 +1098,7 @@ dnl
if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
case $PHP_LAYOUT in
GNU) PEAR_INSTALLDIR=$datadir/pear;;
- *) PEAR_INSTALLDIR=$libdir/php;;
+ *) PEAR_INSTALLDIR=$libdir/php5;;
esac
fi
@@ -1153,12 +1153,12 @@ test "$program_suffix" = "NONE" && progr
case $libdir in
'${exec_prefix}/lib')
- libdir=$libdir/php
+ libdir=$libdir/php5
;;
esac
case $datadir in
'${prefix}/share')
- datadir=$datadir/php
+ datadir=$datadir/php5
;;
esac
@@ -1225,7 +1225,7 @@ EXPANDED_SYSCONFDIR=`eval echo $sysconfd
EXPANDED_DATADIR=$datadir
EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
-INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR
+INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR:/usr/share/pear
exec_prefix=$old_exec_prefix
libdir=$old_libdir
--- php5.orig/ext/ext_skel
+++ php5/ext/ext_skel
@@ -70,7 +70,7 @@ if test -d "$extname" ; then
fi
if test -z "$skel_dir"; then
- skel_dir="skeleton"
+ skel_dir="/usr/lib/php5/skeleton"
fi
## convert skel_dir to full path
--- php5.orig/php.ini-development
+++ php5/php.ini-development
@@ -703,7 +703,7 @@ default_mimetype = "text/html"
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
-;include_path = ".:/php/includes"
+;include_path = ".:/usr/share/php"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
--- php5.orig/php.ini-production
+++ php5/php.ini-production
@@ -703,7 +703,7 @@ default_mimetype = "text/html"
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
-;include_path = ".:/php/includes"
+;include_path = ".:/usr/share/php"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
@@ -864,50 +864,6 @@ default_socket_timeout = 60
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;
-; Windows Extensions
-; Note that ODBC support is built in, so no dll is needed for it.
-; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
-; extension folders as well as the separate PECL DLL download (PHP 5).
-; Be sure to appropriately set the extension_dir directive.
-;
-;extension=php_bz2.dll
-;extension=php_curl.dll
-;extension=php_fileinfo.dll
-;extension=php_gd2.dll
-;extension=php_gettext.dll
-;extension=php_gmp.dll
-;extension=php_intl.dll
-;extension=php_imap.dll
-;extension=php_interbase.dll
-;extension=php_ldap.dll
-;extension=php_mbstring.dll
-;extension=php_exif.dll ; Must be after mbstring as it depends on it
-;extension=php_mysql.dll
-;extension=php_mysqli.dll
-;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
-;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
-;extension=php_openssl.dll
-;extension=php_pdo_firebird.dll
-;extension=php_pdo_mysql.dll
-;extension=php_pdo_oci.dll
-;extension=php_pdo_odbc.dll
-;extension=php_pdo_pgsql.dll
-;extension=php_pdo_sqlite.dll
-;extension=php_pgsql.dll
-;extension=php_pspell.dll
-;extension=php_shmop.dll
-
-; The MIBS data available in the PHP distribution must be installed.
-; See http://www.php.net/manual/en/snmp.installation.php
-;extension=php_snmp.dll
-
-;extension=php_soap.dll
-;extension=php_sockets.dll
-;extension=php_sqlite3.dll
-;extension=php_sybase_ct.dll
-;extension=php_tidy.dll
-;extension=php_xmlrpc.dll
-;extension=php_xsl.dll
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
--- php5.orig/sapi/cli/php.1.in
+++ php5/sapi/cli/php.1.in
@@ -374,13 +374,14 @@ Shows configuration for extension
Show configuration file names
.SH FILES
.TP 15
-.B php\-cli.ini
+.B /etc/php5/cli/php.ini
The configuration file for the CLI version of PHP.
.TP
-.B php.ini
-The standard configuration file will only be used when
-.B php\-cli.ini
-cannot be found.
+.B /etc/php5/cgi/php.ini
+The configuration file for the CGI version of PHP.
+.TP
+.B /etc/php5/apache2/php.ini
+The configuration file for the version of PHP that apache2 uses.
.SH EXAMPLES
.TP 5
\fIphp \-r 'echo "Hello World\\n";'\fP
--- php5.orig/scripts/Makefile.frag
+++ php5/scripts/Makefile.frag
@@ -3,8 +3,8 @@
# Build environment install
#
-phpincludedir = $(includedir)/php
-phpbuilddir = $(libdir)/build
+phpincludedir = $(includedir)/php5
+phpbuilddir = $(prefix)/lib/php5/build
BUILD_FILES = \
scripts/phpize.m4 \
--- php5.orig/scripts/php-config.in
+++ php5/scripts/php-config.in
@@ -6,9 +6,9 @@ datarootdir="@datarootdir@"
exec_prefix="@exec_prefix@"
version="@PHP_VERSION@"
vernum="@PHP_VERSION_ID@"
-include_dir="@includedir@/php"
-includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib"
-ldflags="@PHP_LDFLAGS@"
+include_dir="@includedir@/php5"
+includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib $(getconf LFS_CFLAGS)"
+ldflags="-L$prefix/lib/php5 @PHP_LDFLAGS@"
libs="@EXTRA_LIBS@"
extension_dir='@EXTENSION_DIR@'
man_dir=`eval echo @mandir@`
--- php5.orig/scripts/phpize.in
+++ php5/scripts/phpize.in
@@ -4,8 +4,8 @@
prefix='@prefix@'
datarootdir='@datarootdir@'
exec_prefix="`eval echo @exec_prefix@`"
-phpdir="`eval echo @libdir@`/build"
-includedir="`eval echo @includedir@`/php"
+phpdir="$prefix/lib/php5/build"
+includedir="$prefix/include/php5"
builddir="`pwd`"
SED="@SED@"
debian/patches/CVE-2018-10545.patch 0000664 0000000 0000000 00000007741 13275032404 013332 0 ustar From d20bebfe1340986f795769e2ad6810f36eadf2ca Mon Sep 17 00:00:00 2001
From: Jakub Zelenka
Date: Wed, 7 Mar 2018 18:12:56 +0000
Subject: [PATCH] Do not set PR_SET_DUMPABLE by default
---
sapi/fpm/fpm/fpm_conf.c | 3 +++
sapi/fpm/fpm/fpm_conf.h | 1 +
sapi/fpm/fpm/fpm_unix.c | 2 +-
sapi/fpm/php-fpm.conf.in | 6 ++++++
4 files changed, 11 insertions(+), 1 deletion(-)
Index: php5-5.5.9+dfsg/sapi/fpm/fpm/fpm_conf.c
===================================================================
--- php5-5.5.9+dfsg.orig/sapi/fpm/fpm/fpm_conf.c 2018-05-10 08:02:33.455380891 -0400
+++ php5-5.5.9+dfsg/sapi/fpm/fpm/fpm_conf.c 2018-05-10 08:03:03.591377029 -0400
@@ -128,6 +128,7 @@ static struct ini_value_parser_s ini_fpm
{ "listen.mode", &fpm_conf_set_string, WPO(listen_mode) },
{ "listen.allowed_clients", &fpm_conf_set_string, WPO(listen_allowed_clients) },
{ "process.priority", &fpm_conf_set_integer, WPO(process_priority) },
+ { "process.dumpable", &fpm_conf_set_boolean, WPO(process_dumpable) },
{ "pm", &fpm_conf_set_pm, WPO(pm) },
{ "pm.max_children", &fpm_conf_set_integer, WPO(pm_max_children) },
{ "pm.start_servers", &fpm_conf_set_integer, WPO(pm_start_servers) },
@@ -603,6 +604,7 @@ static void *fpm_worker_pool_config_allo
wp->config->listen_backlog = FPM_BACKLOG_DEFAULT;
wp->config->pm_process_idle_timeout = 10; /* 10s by default */
wp->config->process_priority = 64; /* 64 means unset */
+ wp->config->process_dumpable = 0;
if (!fpm_worker_all_pools) {
fpm_worker_all_pools = wp;
@@ -1580,6 +1582,7 @@ static void fpm_conf_dump() /* {{{ */
} else {
zlog(ZLOG_NOTICE, "\tprocess.priority = %d", wp->config->process_priority);
}
+ zlog(ZLOG_NOTICE, "\tprocess.dumpable = %s", BOOL2STR(wp->config->process_dumpable));
zlog(ZLOG_NOTICE, "\tpm = %s", PM2STR(wp->config->pm));
zlog(ZLOG_NOTICE, "\tpm.max_children = %d", wp->config->pm_max_children);
zlog(ZLOG_NOTICE, "\tpm.start_servers = %d", wp->config->pm_start_servers);
Index: php5-5.5.9+dfsg/sapi/fpm/fpm/fpm_conf.h
===================================================================
--- php5-5.5.9+dfsg.orig/sapi/fpm/fpm/fpm_conf.h 2018-05-10 08:02:33.455380891 -0400
+++ php5-5.5.9+dfsg/sapi/fpm/fpm/fpm_conf.h 2018-05-10 08:02:33.455380891 -0400
@@ -63,6 +63,7 @@ struct fpm_worker_pool_config_s {
char *listen_mode;
char *listen_allowed_clients;
int process_priority;
+ int process_dumpable;
int pm;
int pm_max_children;
int pm_start_servers;
Index: php5-5.5.9+dfsg/sapi/fpm/fpm/fpm_unix.c
===================================================================
--- php5-5.5.9+dfsg.orig/sapi/fpm/fpm/fpm_unix.c 2018-05-10 08:02:33.455380891 -0400
+++ php5-5.5.9+dfsg/sapi/fpm/fpm/fpm_unix.c 2018-05-10 08:02:33.455380891 -0400
@@ -214,7 +214,7 @@ int fpm_unix_init_child(struct fpm_worke
}
#ifdef HAVE_PRCTL
- if (0 > prctl(PR_SET_DUMPABLE, 1, 0, 0, 0)) {
+ if (wp->config->process_dumpable && 0 > prctl(PR_SET_DUMPABLE, 1, 0, 0, 0)) {
zlog(ZLOG_SYSERROR, "[pool %s] failed to prctl(PR_SET_DUMPABLE)", wp->config->name);
}
#endif
Index: php5-5.5.9+dfsg/sapi/fpm/php-fpm.conf.in
===================================================================
--- php5-5.5.9+dfsg.orig/sapi/fpm/php-fpm.conf.in 2018-05-10 08:02:33.455380891 -0400
+++ php5-5.5.9+dfsg/sapi/fpm/php-fpm.conf.in 2018-05-10 08:02:33.455380891 -0400
@@ -191,6 +191,12 @@ listen = /var/run/php5-fpm.sock
; Default Value: no set
; priority = -19
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is differrent than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
debian/patches/CVE-2014-0237.patch 0000664 0000000 0000000 00000003315 12350617025 013235 0 ustar From 68ce2d0ea6da79b12a365e375e1c2ce882c77480 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Mon, 26 May 2014 17:50:14 -0700
Subject: [PATCH] Fix bug #67328 (fileinfo: numerous file_printf calls
resulting in performance degradation)
Upstream patch: https://github.com/file/file/commit/b8acc83781d5a24cc5101e525d15efe0482c280d
---
ext/fileinfo/libmagic/cdf.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c
index dd7177e..8dacd2f 100644
--- a/ext/fileinfo/libmagic/cdf.c
+++ b/ext/fileinfo/libmagic/cdf.c
@@ -942,7 +942,7 @@ int
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
{
- size_t i, maxcount;
+ size_t maxcount;
const cdf_summary_info_header_t *si =
CAST(const cdf_summary_info_header_t *, sst->sst_tab);
const cdf_section_declaration_t *sd =
@@ -957,21 +957,13 @@ cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
ssi->si_os = CDF_TOLE2(si->si_os);
ssi->si_class = si->si_class;
cdf_swap_class(&ssi->si_class);
- ssi->si_count = CDF_TOLE2(si->si_count);
+ ssi->si_count = CDF_TOLE4(si->si_count);
*count = 0;
maxcount = 0;
*info = NULL;
- for (i = 0; i < CDF_TOLE4(si->si_count); i++) {
- if (i >= CDF_LOOP_LIMIT) {
- DPRINTF(("Unpack summary info loop limit"));
- errno = EFTYPE;
- return -1;
- }
- if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset),
- info, count, &maxcount) == -1) {
+ if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
+ count, &maxcount) == -1)
return -1;
- }
- }
return 0;
}
--
1.9.2
debian/patches/CVE-2017-11143-2.patch 0000664 0000000 0000000 00000002632 13141101254 013445 0 ustar From f269cdcd4f76accbecd03884f327cffb9a7f1ca9 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Tue, 4 Jul 2017 21:10:08 -0700
Subject: [PATCH] Improve fix for #74145
---
ext/wddx/wddx.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
Index: php5-5.5.9+dfsg/ext/wddx/wddx.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/wddx/wddx.c 2017-08-04 10:20:26.218862666 -0400
+++ php5-5.5.9+dfsg/ext/wddx/wddx.c 2017-08-04 10:20:26.214862666 -0400
@@ -791,18 +791,23 @@ static void php_wddx_push_element(void *
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;
- ALLOC_ZVAL(ent.data);
- INIT_PZVAL(ent.data);
- Z_TYPE_P(ent.data) = IS_BOOL;
- ent.type = ST_BOOLEAN;
- SET_STACK_VARNAME;
if (atts) for (i = 0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VALUE) && atts[i+1] && atts[i+1][0]) {
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.type = ST_BOOLEAN;
+ SET_STACK_VARNAME;
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
php_wddx_process_data(user_data, atts[i+1], strlen(atts[i+1]));
break;
}
} else {
+ ALLOC_ZVAL(ent.data);
+ INIT_PZVAL(ent.data);
+ Z_TYPE_P(ent.data) = IS_BOOL;
+ ent.type = ST_BOOLEAN;
+ SET_STACK_VARNAME;
ZVAL_FALSE(ent.data);
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
}
debian/patches/CVE-2016-2554.patch 0000664 0000000 0000000 00000006336 12704222025 013244 0 ustar Backport of:
From 07c7df68bd68bbe706371fccc77c814ebb335d9e Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sun, 31 Jan 2016 19:37:56 -0800
Subject: [PATCH] Fixed bug #71488: Stack overflow when decompressing tar
archives
---
ext/phar/tar.c | 22 ++++++++++++++++------
ext/phar/tests/bug71488.phpt | 16 ++++++++++++++++
ext/phar/tests/bug71488.tar | Bin 0 -> 10240 bytes
3 files changed, 32 insertions(+), 6 deletions(-)
create mode 100644 ext/phar/tests/bug71488.phpt
create mode 100644 ext/phar/tests/bug71488.tar
Index: php5-5.5.9+dfsg/ext/phar/tar.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/phar/tar.c 2016-04-15 13:25:09.268858120 -0400
+++ php5-5.5.9+dfsg/ext/phar/tar.c 2016-04-15 13:25:09.264858068 -0400
@@ -192,6 +192,13 @@
}
/* }}} */
+#if !HAVE_STRNLEN
+static size_t strnlen(const char *s, size_t maxlen) {
+ char *r = (char *)memchr(s, '\0', maxlen);
+ return r ? r-s : maxlen;
+}
+#endif
+
int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error TSRMLS_DC) /* {{{ */
{
char buf[512], *actual_alias = NULL, *p;
@@ -201,6 +208,7 @@
php_uint32 sum1, sum2, size, old;
phar_archive_data *myphar, **actual;
int last_was_longlink = 0;
+ int linkname_len;
if (error) {
*error = NULL;
@@ -255,7 +263,7 @@
size = entry.uncompressed_filesize = entry.compressed_filesize =
phar_tar_number(hdr->size, sizeof(hdr->size));
- if (((!old && hdr->prefix[0] == 0) || old) && strlen(hdr->name) == sizeof(".phar/signature.bin")-1 && !strncmp(hdr->name, ".phar/signature.bin", sizeof(".phar/signature.bin")-1)) {
+ if (((!old && hdr->prefix[0] == 0) || old) && strnlen(hdr->name, 100) == sizeof(".phar/signature.bin")-1 && !strncmp(hdr->name, ".phar/signature.bin", sizeof(".phar/signature.bin")-1)) {
off_t curloc;
if (size > 511) {
@@ -465,20 +473,22 @@
}
entry.link = NULL;
-
+ /* link field is null-terminated unless it has 100 non-null chars.
+ * Thus we can not use strlen. */
+ linkname_len = strnlen(hdr->linkname, 100);
if (entry.tar_type == TAR_LINK) {
- if (!zend_hash_exists(&myphar->manifest, hdr->linkname, strlen(hdr->linkname))) {
+ if (!zend_hash_exists(&myphar->manifest, hdr->linkname, linkname_len)) {
if (error) {
- spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file - hard link to non-existent file \"%s\"", fname, hdr->linkname);
+ spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file - hard link to non-existent file \"%.*s\"", fname, linkname_len, hdr->linkname);
}
pefree(entry.filename, entry.is_persistent);
php_stream_close(fp);
phar_destroy_phar_data(myphar TSRMLS_CC);
return FAILURE;
}
- entry.link = estrdup(hdr->linkname);
+ entry.link = estrndup(hdr->linkname, linkname_len);
} else if (entry.tar_type == TAR_SYMLINK) {
- entry.link = estrdup(hdr->linkname);
+ entry.link = estrndup(hdr->linkname, linkname_len);
}
phar_set_inode(&entry TSRMLS_CC);
zend_hash_add(&myphar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info), (void **) &newentry);
debian/patches/CVE-2014-3515.patch 0000664 0000000 0000000 00000005130 12355546267 013252 0 ustar From 88223c5245e9b470e1e6362bfd96829562ffe6ab Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sat, 21 Jun 2014 19:46:16 -0700
Subject: [PATCH] Fix bug #67492: unserialize() SPL ArrayObject /
SPLObjectStorage Type Confusion
---
NEWS | 2 ++
ext/spl/spl_array.c | 2 +-
ext/spl/spl_observer.c | 2 +-
ext/spl/tests/SplObjectStorage_unserialize_bad.phpt | 5 ++++-
4 files changed, 8 insertions(+), 3 deletions(-)
Index: php5-5.5.9+dfsg/ext/spl/spl_array.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/spl/spl_array.c 2014-07-04 11:48:04.114114313 -0400
+++ php5-5.5.9+dfsg/ext/spl/spl_array.c 2014-07-04 11:48:04.110114313 -0400
@@ -1789,7 +1789,7 @@
++p;
ALLOC_INIT_ZVAL(pmembers);
- if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE_P(pmembers) != IS_ARRAY) {
zval_ptr_dtor(&pmembers);
goto outexcept;
}
Index: php5-5.5.9+dfsg/ext/spl/spl_observer.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/spl/spl_observer.c 2014-07-04 11:48:04.114114313 -0400
+++ php5-5.5.9+dfsg/ext/spl/spl_observer.c 2014-07-04 11:48:04.110114313 -0400
@@ -898,7 +898,7 @@
++p;
ALLOC_INIT_ZVAL(pmembers);
- if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE_P(pmembers) != IS_ARRAY) {
zval_ptr_dtor(&pmembers);
goto outexcept;
}
Index: php5-5.5.9+dfsg/ext/spl/tests/SplObjectStorage_unserialize_bad.phpt
===================================================================
--- php5-5.5.9+dfsg.orig/ext/spl/tests/SplObjectStorage_unserialize_bad.phpt 2014-07-04 11:48:04.114114313 -0400
+++ php5-5.5.9+dfsg/ext/spl/tests/SplObjectStorage_unserialize_bad.phpt 2014-07-04 11:48:04.110114313 -0400
@@ -7,6 +7,7 @@
'x:i:2;i:0;,i:1;;i:0;,i:2;;m:a:0:{}',
'x:i:3;O:8:"stdClass":0:{},O:8:"stdClass":0:{};R:2;,i:1;;O:8:"stdClass":0:{},r:2;;m:a:0:{}',
'x:i:3;O:8:"stdClass":0:{},O:8:"stdClass":0:{};r:2;,i:1;;O:8:"stdClass":0:{},r:2;;m:a:0:{}',
+'x:i:1;O:8:"stdClass":0:{},N;;m:s:40:"1234567890123456789012345678901234567890"',
);
foreach($badblobs as $blob) {
try {
@@ -17,6 +18,7 @@
echo $e->getMessage()."\n";
}
}
+echo "DONE\n";
--EXPECTF--
Error at offset 6 of 34 bytes
Error at offset 46 of 89 bytes
@@ -42,4 +44,5 @@
}
}
}
-
+Error at offset 79 of 78 bytes
+DONE
debian/patches/use_system_timezone.patch 0000664 0000000 0000000 00000002524 12300436341 015751 0 ustar Subject: Use system timezone
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730771
Bug-Ubuntu: https://launchpad.net/bugs/1244343
Forwarded: not-needed
Acked-By: Robie Basak
Last-Update: 2014-01-21
Upstream don't want this patch. See
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730771 for a summary.
This delta is recovered from previous versions of the system timezone patch in
Debian, and appears to have inadvertently been dropped. Author unknown.
To be used in tandem with use_embedded_timezonedb.patch and use_embedded_timezonedb_fixes.patch.
---
--- php5.orig/ext/date/php_date.c
+++ php5/ext/date/php_date.c
@@ -969,6 +969,23 @@ static char* guess_timezone(const timeli
DATEG(timezone_valid) = 1;
return DATEG(default_timezone);
}
+ /* Try to guess timezone from system information */
+ {
+ struct tm *ta, tmbuf;
+ time_t the_time;
+ char *tzid = NULL;
+
+ the_time = time(NULL);
+ ta = php_localtime_r(&the_time, &tmbuf);
+ if (ta) {
+ tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst);
+ }
+ if (! tzid) {
+ tzid = "UTC";
+ }
+
+ return tzid;
+ }
/* Fallback to UTC */
php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
return "UTC";
debian/patches/CVE-2018-10548.patch 0000664 0000000 0000000 00000005141 13275032444 013331 0 ustar From 49782c54994ecca2ef2a061063bd5a7079c43527 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sun, 22 Apr 2018 22:01:35 -0700
Subject: [PATCH] Fix bug #76248 - Malicious LDAP-Server Response causes Crash
---
ext/ldap/ldap.c | 6 +++++-
ext/ldap/tests/bug76248.phpt | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 ext/ldap/tests/bug76248.phpt
Index: php5-5.5.9+dfsg/ext/ldap/ldap.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/ldap/ldap.c 2018-05-10 08:03:44.503374475 -0400
+++ php5-5.5.9+dfsg/ext/ldap/ldap.c 2018-05-10 08:03:44.503374475 -0400
@@ -988,7 +988,11 @@ PHP_FUNCTION(ldap_get_entries)
add_assoc_long(tmp1, "count", num_attrib);
dn = ldap_get_dn(ldap, ldap_result_entry);
- add_assoc_string(tmp1, "dn", dn, 1);
+ if (dn) {
+ add_assoc_string(tmp1, "dn", dn, 1);
+ } else {
+ add_assoc_null(tmp1, "dn");
+ }
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS
ldap_memfree(dn);
#else
Index: php5-5.5.9+dfsg/ext/ldap/tests/bug76248.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/ldap/tests/bug76248.phpt 2018-05-10 08:03:44.503374475 -0400
@@ -0,0 +1,40 @@
+--TEST--
+Bug #76248 (Malicious LDAP-Server Response causes Crash)
+--SKIPIF--
+
+--FILE--
+
+--EXPECT--
+array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ array(2) {
+ ["count"]=>
+ int(0)
+ ["dn"]=>
+ NULL
+ }
+}
\ No newline at end of file
debian/patches/CVE-2016-3141.patch 0000664 0000000 0000000 00000005576 12704222045 013244 0 ustar From b1bd4119bcafab6f9a8f84d92cd65eec3afeface Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sun, 14 Feb 2016 22:34:39 -0800
Subject: [PATCH] Fixed bug #71587 - Use-After-Free / Double-Free in WDDX
Deserialize
---
ext/wddx/tests/bug71587.phpt | 43 +++++++++++++++++++++++++++++++++++++++++++
ext/wddx/wddx.c | 19 +++++++++++++++----
2 files changed, 58 insertions(+), 4 deletions(-)
create mode 100644 ext/wddx/tests/bug71587.phpt
Index: php5-5.5.9+dfsg/ext/wddx/tests/bug71587.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/wddx/tests/bug71587.phpt 2016-04-15 13:25:55.489442998 -0400
@@ -0,0 +1,43 @@
+--TEST--
+Bug #71587 (Use-After-Free / Double-Free in WDDX Deserialize)
+--SKIPIF--
+
+--FILE--
+
+
+
+
+
+ manhluat
+
+
+
+
+
+EOF;
+
+$wddx = wddx_deserialize($xml);
+var_dump($wddx);
+// Print mem leak
+foreach($wddx as $k=>$v)
+ printf("Key: %s\nValue: %s\n",bin2hex($k),bin2hex($v));
+
+?>
+DONE
+--EXPECTF--
+array(2) {
+ [0]=>
+ string(8) "manhluat"
+ [1]=>
+ bool(true)
+}
+Key: 30
+Value: 6d616e686c756174
+Key: 31
+Value: 31
+DONE
Index: php5-5.5.9+dfsg/ext/wddx/wddx.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/wddx/wddx.c 2016-04-15 13:25:55.493443048 -0400
+++ php5-5.5.9+dfsg/ext/wddx/wddx.c 2016-04-15 13:25:55.493443048 -0400
@@ -933,6 +933,16 @@
!strcmp(name, EL_DATETIME)) {
wddx_stack_top(stack, (void**)&ent1);
+ if (!ent1->data) {
+ if (stack->top > 1) {
+ stack->top--;
+ } else {
+ stack->done = 1;
+ }
+ efree(ent1);
+ return;
+ }
+
if (!strcmp(name, EL_BINARY)) {
int new_len=0;
unsigned char *new_str;
@@ -1028,6 +1038,7 @@
}
} else if (!strcmp(name, EL_VAR) && stack->varname) {
efree(stack->varname);
+ stack->varname = NULL;
} else if (!strcmp(name, EL_FIELD)) {
st_entry *ent;
wddx_stack_top(stack, (void **)&ent);
@@ -1047,7 +1058,7 @@
if (!wddx_stack_is_empty(stack) && !stack->done) {
wddx_stack_top(stack, (void**)&ent);
- switch (Z_TYPE_P(ent)) {
+ switch (ent->type) {
case ST_STRING:
if (Z_STRLEN_P(ent->data) == 0) {
STR_FREE(Z_STRVAL_P(ent->data));
@@ -1086,11 +1097,11 @@
} else if (!strcmp(s, "false")) {
Z_LVAL_P(ent->data) = 0;
} else {
- stack->top--;
zval_ptr_dtor(&ent->data);
- if (ent->varname)
+ if (ent->varname) {
efree(ent->varname);
- efree(ent);
+ }
+ ent->data = NULL;
}
break;
debian/patches/033-we_WANT_libtool.patch 0000664 0000000 0000000 00000001542 12300436054 015132 0 ustar Description:
upstream ships an out of date version of libtool. this ensures that
we build against an up-to-date version of libtool by running libtoolize
as part of our build process (this is called indirectly via ./buildconf.sh
from debian/rules)
.
note that we don't touch the libtool.m4 that they ship here, and this file
gets included in the build process as part of the phpize stuff. however,
this is solved in ./debian/rules where it's overwritten with a symlink.
Origin: vendor
Forwarded: no
Last-Update: 2010-01-18
--- php5.orig/build/build2.mk
+++ php5/build/build2.mk
@@ -46,7 +46,8 @@ $(TOUCH_FILES):
aclocal.m4: configure.in acinclude.m4
@echo rebuilding $@
- cat acinclude.m4 ./build/libtool.m4 > $@
+ libtoolize --copy --install --automake --force
+ aclocal
configure: aclocal.m4 configure.in $(config_m4_files)
@echo rebuilding $@
debian/patches/CVE-2016-6290.patch 0000664 0000000 0000000 00000004375 12746377661 013275 0 ustar From 3798eb6fd5dddb211b01d41495072fd9858d4e32 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Tue, 12 Jul 2016 23:27:45 -0700
Subject: [PATCH] Fix bug #72562 - destroy var_hash properly
---
ext/session/session.c | 3 ++-
ext/session/tests/bug72562.phpt | 44 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 1 deletion(-)
create mode 100644 ext/session/tests/bug72562.phpt
Index: php5-5.5.9+dfsg/ext/session/session.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/session/session.c 2016-07-28 08:50:54.756053264 -0400
+++ php5-5.5.9+dfsg/ext/session/session.c 2016-07-28 08:50:54.752053217 -0400
@@ -929,6 +929,7 @@
namelen = ((unsigned char)(*p)) & (~PS_BIN_UNDEF);
if (namelen < 0 || namelen > PS_BIN_MAX || (p + namelen) >= endptr) {
+ PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
return FAILURE;
}
Index: php5-5.5.9+dfsg/ext/session/tests/bug72562.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/session/tests/bug72562.phpt 2016-07-28 08:50:54.752053217 -0400
@@ -0,0 +1,44 @@
+--TEST--
+Bug #72562: Use After Free in unserialize() with Unexpected Session Deserialization
+--SKIPIF--
+
+--FILE--
+>= 8;
+ }
+ return $out;
+}
+?>
+--EXPECTF--
+Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s/bug72562.php on line %d
+
+Notice: unserialize(): Error at offset 0 of 1 bytes in %s/bug72562.php on line %d
+
+Notice: unserialize(): Error at offset 4 of 4 bytes in %s/bug72562.php on line %d
+bool(false)
debian/patches/CVE-2014-4698.patch 0000664 0000000 0000000 00000003700 12355546320 013256 0 ustar From 22882a9d89712ff2b6ebc20a689a89452bba4dcd Mon Sep 17 00:00:00 2001
From: Xinchen Hui
Date: Wed, 2 Jul 2014 17:57:42 +0800
Subject: [PATCH] Fixed bug #67539 (ArrayIterator use-after-free due to object
change during sorting)
---
NEWS | 2 ++
ext/spl/spl_array.c | 7 +++++++
ext/spl/tests/bug67539.phpt | 15 +++++++++++++++
3 files changed, 24 insertions(+)
create mode 100644 ext/spl/tests/bug67539.phpt
Index: php5-5.5.9+dfsg/ext/spl/spl_array.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/spl/spl_array.c 2014-07-04 11:48:29.554114457 -0400
+++ php5-5.5.9+dfsg/ext/spl/spl_array.c 2014-07-04 11:48:29.550114457 -0400
@@ -1726,6 +1726,7 @@
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
zval *pmembers, *pflags = NULL;
+ HashTable *aht;
long flags;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
@@ -1737,6 +1738,12 @@
return;
}
+ aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ if (aht->nApplyCount > 0) {
+ zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ return;
+ }
+
/* storage */
s = p = (const unsigned char*)buf;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
Index: php5-5.5.9+dfsg/ext/spl/tests/bug67539.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/spl/tests/bug67539.phpt 2014-07-04 11:48:29.550114457 -0400
@@ -0,0 +1,15 @@
+--TEST--
+Bug #67539 (ArrayIterator use-after-free due to object change during sorting)
+--FILE--
+unserialize($GLOBALS['it']->serialize());
+ return TRUE;
+}
+
+$it->uksort('badsort');
+--EXPECTF--
+Warning: Modification of ArrayObject during sorting is prohibited in %sbug67539.php on line %d
debian/patches/CVE-2014-3479.patch 0000664 0000000 0000000 00000002537 12355546241 013263 0 ustar From 5c9f96799961818944d43b22c241cc56c215c2e4 Mon Sep 17 00:00:00 2001
From: Remi Collet
Date: Tue, 10 Jun 2014 14:13:14 +0200
Subject: [PATCH] Fixed Bug #67411 fileinfo: cdf_check_stream_offset
insufficient boundary check
Upstream:
https://github.com/file/file/commit/36fadd29849b8087af9f4586f89dbf74ea45be67
---
ext/fileinfo/libmagic/cdf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c
index 16649f1..c9a5d50 100644
--- a/ext/fileinfo/libmagic/cdf.c
+++ b/ext/fileinfo/libmagic/cdf.c
@@ -277,13 +277,15 @@ cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h,
{
const char *b = (const char *)sst->sst_tab;
const char *e = ((const char *)p) + tail;
+ size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
+ CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
(void)&line;
- if (e >= b && (size_t)(e - b) <= CDF_SEC_SIZE(h) * sst->sst_len)
+ if (e >= b && (size_t)(e - b) <= ss * sst->sst_len)
return 0;
DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
" > %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
- CDF_SEC_SIZE(h) * sst->sst_len, CDF_SEC_SIZE(h), sst->sst_len));
+ ss * sst->sst_len, ss, sst->sst_len));
errno = EFTYPE;
return -1;
}
--
1.9.2
debian/patches/use_embedded_timezonedb_fixes.patch 0000664 0000000 0000000 00000003143 12300436054 017661 0 ustar Author: Sean Finney
Forwarded: no (upstream doesn't want it)
Description: Silence warnings about using the default system timezone info
In vanilla upstream php, this is considered an error (i.e. the user must
set the timezone explicitly), though with our use of the system timezonedb
patch, we actually feel quite comfortable using the default timezone info.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571762
--- php5.orig/ext/date/tests/date_default_timezone_set-1.phpt
+++ php5/ext/date/tests/date_default_timezone_set-1.phpt
@@ -22,9 +22,6 @@ date.timezone=
echo date(DATE_ISO8601, $date4), "\n";
?>
--EXPECTF--
-Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in %sdate_default_timezone_set-1.php on line 3
-
-Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in %sdate_default_timezone_set-1.php on line 4
America/Indiana/Knox
2005-01-12T03:00:00-0500
2005-07-12T03:00:00-0500
debian/patches/CVE-2014-4670.patch 0000664 0000000 0000000 00000003213 12355546306 013247 0 ustar From df78c48354f376cf419d7a97f88ca07d572f00fb Mon Sep 17 00:00:00 2001
From: Xinchen Hui
Date: Wed, 2 Jul 2014 17:45:09 +0800
Subject: [PATCH] Fixed Bug #67538 (SPL Iterators use-after-free)
---
NEWS | 3 +++
ext/spl/spl_dllist.c | 7 +++++--
ext/spl/tests/bug67538.phpt | 17 +++++++++++++++++
3 files changed, 25 insertions(+), 2 deletions(-)
create mode 100644 ext/spl/tests/bug67538.phpt
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 39a0733..0b44d41 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -43,12 +43,10 @@ PHPAPI zend_class_entry *spl_ce_SplStack;
#define SPL_LLIST_DELREF(elem) if(!--(elem)->rc) { \
efree(elem); \
- elem = NULL; \
}
#define SPL_LLIST_CHECK_DELREF(elem) if((elem) && !--(elem)->rc) { \
efree(elem); \
- elem = NULL; \
}
#define SPL_LLIST_ADDREF(elem) (elem)->rc++
@@ -916,6 +914,11 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
llist->dtor(element TSRMLS_CC);
}
+ if (intern->traverse_pointer == element) {
+ SPL_LLIST_DELREF(element);
+ intern->traverse_pointer = NULL;
+ }
+
zval_ptr_dtor((zval **)&element->data);
element->data = NULL;
diff --git a/ext/spl/tests/bug67538.phpt b/ext/spl/tests/bug67538.phpt
new file mode 100644
index 0000000..b6f3848
--- /dev/null
+++ b/ext/spl/tests/bug67538.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #67538 (SPL Iterators use-after-free)
+--FILE--
+push('a');
+$list->push('b');
+
+$list->rewind();
+$list->offsetUnset(0);
+$list->push('b');
+$list->offsetUnset(0);
+$list->next();
+echo "okey";
+?>
+--EXPECTF--
+okey
--
1.9.2
debian/patches/CVE-2017-12933.patch 0000664 0000000 0000000 00000007741 13237117003 013331 0 ustar Backport of:
(also includes backport of:
http://git.php.net/?p=php-src.git;a=commitdiff;h=f76a6cd02368f28f5d11858a0a9a81a0d1f9041e)
From f8c514ba6b7962a219296a837b2dbc22f749e736 Mon Sep 17 00:00:00 2001
From: Nikita Popov
Date: Sun, 25 Jun 2017 21:15:26 +0200
Subject: [PATCH] Fixed bug #74111
---
ext/standard/tests/serialize/bug25378.phpt | 2 +-
ext/standard/tests/serialize/bug74111.phpt | 10 +
ext/standard/var_unserializer.c | 1153 ++++++++++++++--------------
ext/standard/var_unserializer.re | 11 +-
4 files changed, 580 insertions(+), 596 deletions(-)
create mode 100644 ext/standard/tests/serialize/bug74111.phpt
Index: php5-5.5.9+dfsg/ext/standard/tests/serialize/bug25378.phpt
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/tests/serialize/bug25378.phpt 2018-02-08 13:57:37.288915978 -0500
+++ php5-5.5.9+dfsg/ext/standard/tests/serialize/bug25378.phpt 2018-02-08 13:57:37.288915978 -0500
@@ -42,7 +42,7 @@ bool(false)
Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d
bool(false)
-Notice: unserialize(): Error at offset 33 of 32 bytes in %sbug25378.php on line %d
+Notice: unserialize(): Error at offset 32 of 32 bytes in %sbug25378.php on line %d
bool(false)
Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d
Index: php5-5.5.9+dfsg/ext/standard/tests/serialize/bug74111.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/standard/tests/serialize/bug74111.phpt 2018-02-08 13:57:37.288915978 -0500
@@ -0,0 +1,10 @@
+--TEST--
+Bug #74111: Heap buffer overread (READ: 1) finish_nested_data from unserialize
+--FILE--
+
+--EXPECTF--
+Notice: unserialize(): Error at offset 25 of 23 bytes in %s on line %d
+bool(false)
Index: php5-5.5.9+dfsg/ext/standard/var_unserializer.re
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/var_unserializer.re 2018-02-08 13:57:37.288915978 -0500
+++ php5-5.5.9+dfsg/ext/standard/var_unserializer.re 2018-02-08 13:57:37.288915978 -0500
@@ -410,13 +410,12 @@ static inline int process_nested_data(UN
static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
{
- if (*((*p)++) == '}')
- return 1;
+ if (*p >= max || **p != '}') {
+ return 0;
+ }
-#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE
- zval_ptr_dtor(rval);
-#endif
- return 0;
+ (*p)++;
+ return 1;
}
static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
Index: php5-5.5.9+dfsg/ext/standard/var_unserializer.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/var_unserializer.c 2018-02-08 13:57:37.288915978 -0500
+++ php5-5.5.9+dfsg/ext/standard/var_unserializer.c 2018-02-08 13:57:37.288915978 -0500
@@ -404,13 +404,12 @@ static inline int process_nested_data(UN
static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
{
- if (*((*p)++) == '}')
- return 1;
+ if (*p >= max || **p != '}') {
+ return 0;
+ }
-#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE
- zval_ptr_dtor(rval);
-#endif
- return 0;
+ (*p)++;
+ return 1;
}
static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
Index: php5-5.5.9+dfsg/ext/standard/tests/strings/bug72663_3.phpt
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/tests/strings/bug72663_3.phpt 2018-02-08 13:57:36.756915483 -0500
+++ php5-5.5.9+dfsg/ext/standard/tests/strings/bug72663_3.phpt 2018-02-08 13:58:03.532940371 -0500
@@ -14,5 +14,5 @@ unserialize($poc);
?>
DONE
--EXPECTF--
-Notice: unserialize(): Error at offset 51 of 50 bytes in %sbug72663_3.php on line %d
-DONE
\ No newline at end of file
+Notice: unserialize(): Error at offset 50 of 50 bytes in %sbug72663_3.php on line %d
+DONE
debian/patches/CVE-2015-4599.patch 0000664 0000000 0000000 00000001726 12543257265 013273 0 ustar From 51856a76f87ecb24fe1385342be43610fb6c86e4 Mon Sep 17 00:00:00 2001
From: Dmitry Stogov
Date: Thu, 19 Mar 2015 11:36:01 +0300
Subject: [PATCH] Fixed bug #69152
---
ext/soap/soap.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: php5-5.5.12+dfsg/ext/soap/soap.c
===================================================================
--- php5-5.5.12+dfsg.orig/ext/soap/soap.c 2015-06-26 08:46:28.223848332 -0400
+++ php5-5.5.12+dfsg/ext/soap/soap.c 2015-06-26 08:46:28.223848332 -0400
@@ -925,6 +925,12 @@
zend_call_function(&fci, NULL TSRMLS_CC);
+ convert_to_string(faultcode);
+ convert_to_string(faultstring);
+ convert_to_string(file);
+ convert_to_long(line);
+ convert_to_string(trace);
+
len = spprintf(&str, 0, "SoapFault exception: [%s] %s in %s:%ld\nStack trace:\n%s",
Z_STRVAL_P(faultcode), Z_STRVAL_P(faultstring), Z_STRVAL_P(file), Z_LVAL_P(line),
Z_STRLEN_P(trace) ? Z_STRVAL_P(trace) : "#0 {main}\n");
debian/patches/CVE-2018-7584.patch 0000664 0000000 0000000 00000004002 13252477445 013263 0 ustar From 523f230c831d7b33353203fa34aee4e92ac12bba Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Tue, 20 Feb 2018 15:34:43 -0800
Subject: [PATCH] Fix bug #75981: prevent reading beyond buffer start
---
ext/standard/http_fopen_wrapper.c | 4 ++--
ext/standard/tests/http/bug75981.phpt | 32 ++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 2 deletions(-)
create mode 100644 ext/standard/tests/http/bug75981.phpt
Index: php5-5.5.9+dfsg/ext/standard/http_fopen_wrapper.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/standard/http_fopen_wrapper.c 2018-03-15 10:11:46.113255151 -0400
+++ php5-5.5.9+dfsg/ext/standard/http_fopen_wrapper.c 2018-03-15 10:11:46.093255126 -0400
@@ -692,9 +692,9 @@ finish:
tmp_line, response_code);
}
}
- if (tmp_line[tmp_line_len - 1] == '\n') {
+ if (tmp_line_len >= 1 && tmp_line[tmp_line_len - 1] == '\n') {
--tmp_line_len;
- if (tmp_line[tmp_line_len - 1] == '\r') {
+ if (tmp_line_len >= 1 &&tmp_line[tmp_line_len - 1] == '\r') {
--tmp_line_len;
}
}
Index: php5-5.5.9+dfsg/ext/standard/tests/http/bug75981.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/standard/tests/http/bug75981.phpt 2018-03-15 10:11:46.093255126 -0400
@@ -0,0 +1,32 @@
+--TEST--
+Bug #75981 (stack-buffer-overflow while parsing HTTP response)
+--INI--
+allow_url_fopen=1
+--SKIPIF--
+
+--FILE--
+ [
+ 'protocol_version' => '1.1',
+ 'header' => 'Connection: Close'
+ ],
+];
+
+$ctx = stream_context_create($options);
+
+$responses = [
+ "data://text/plain,000000000100\xA\xA"
+];
+$pid = http_server('tcp://127.0.0.1:12342', $responses);
+
+echo @file_get_contents('http://127.0.0.1:12342/', false, $ctx);
+
+http_server_kill($pid);
+
+?>
+DONE
+--EXPECT--
+DONE
debian/patches/CVE-2019-9023-2.patch 0000664 0000000 0000000 00000002516 13437472461 013417 0 ustar From 28362ed4fae6969b5a8878591a5a06eadf114e03 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sat, 29 Dec 2018 20:06:08 -0800
Subject: [PATCH] Fix bug #77371 (heap buffer overflow in mb regex functions -
compile_string_node)
---
ext/mbstring/oniguruma/regcomp.c | 1 +
ext/mbstring/tests/bug77371.phpt | 10 ++++++++++
2 files changed, 11 insertions(+)
create mode 100644 ext/mbstring/tests/bug77371.phpt
diff --git a/ext/mbstring/oniguruma/regcomp.c b/ext/mbstring/oniguruma/regcomp.c
index 995e1d886155..4469f33a56dd 100644
--- a/ext/mbstring/oniguruma/regcomp.c
+++ b/ext/mbstring/oniguruma/regcomp.c
@@ -524,6 +524,7 @@ compile_string_node(Node* node, regex_t* reg)
for (; p < end; ) {
len = enclen(enc, p);
+ if (p + len > end) len = end - p;
if (len == prev_len) {
slen++;
}
diff --git a/ext/mbstring/tests/bug77371.phpt b/ext/mbstring/tests/bug77371.phpt
new file mode 100644
index 000000000000..f23445bd0917
--- /dev/null
+++ b/ext/mbstring/tests/bug77371.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
+--SKIPIF--
+
+--FILE--
+
+--EXPECT--
+bool(false)
\ No newline at end of file
debian/patches/CVE-2016-7127.patch 0000664 0000000 0000000 00000003075 12773246316 013261 0 ustar From 1bd103df00f49cf4d4ade2cfe3f456ac058a4eae Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Wed, 10 Aug 2016 00:14:58 -0700
Subject: [PATCH] Fix bug #72730 - imagegammacorrect allows arbitrary write
access
---
ext/gd/gd.c | 5 +++++
ext/gd/tests/bug72730.phpt | 15 +++++++++++++++
2 files changed, 20 insertions(+)
create mode 100644 ext/gd/tests/bug72730.phpt
Index: php5-5.5.9+dfsg/ext/gd/gd.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/gd/gd.c 2016-09-29 13:18:03.869714858 -0400
+++ php5-5.5.9+dfsg/ext/gd/gd.c 2016-09-29 13:18:03.865714812 -0400
@@ -3036,6 +3036,11 @@
return;
}
+ if ( input <= 0.0 || output <= 0.0 ) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positive");
+ RETURN_FALSE;
+ }
+
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
if (gdImageTrueColor(im)) {
Index: php5-5.5.9+dfsg/ext/gd/tests/bug72730.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/gd/tests/bug72730.phpt 2016-09-29 13:18:03.865714812 -0400
@@ -0,0 +1,15 @@
+--TEST--
+Bug #72730: imagegammacorrect allows arbitrary write access
+--SKIPIF--
+
+--FILE--
+
+DONE
+--EXPECTF--
+Warning: imagegammacorrect(): Gamma values should be positive in %sbug72730.php on line %d
+DONE
\ No newline at end of file
debian/patches/CVE-2016-5769.patch 0000664 0000000 0000000 00000002761 12746377120 013272 0 ustar From 6c5211a0cef0cc2854eaa387e0eb036e012904d0 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Mon, 20 Jun 2016 21:51:42 -0700
Subject: [PATCH] Fix bug #72455: Heap Overflow due to integer overflows
---
ext/mcrypt/mcrypt.c | 92 +++++++++++++++++++++++++++++------------------------
1 file changed, 50 insertions(+), 42 deletions(-)
Index: php5-5.5.9+dfsg/ext/mcrypt/mcrypt.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/mcrypt/mcrypt.c 2016-07-28 08:45:01.419855566 -0400
+++ php5-5.5.9+dfsg/ext/mcrypt/mcrypt.c 2016-07-28 08:45:01.419855566 -0400
@@ -677,6 +677,10 @@
if (mcrypt_enc_is_block_mode(pm->td) == 1) { /* It's a block algorithm */
block_size = mcrypt_enc_get_block_size(pm->td);
data_size = (((data_len - 1) / block_size) + 1) * block_size;
+ if (data_size <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Integer overflow in data size");
+ RETURN_FALSE;
+ }
data_s = emalloc(data_size + 1);
memset(data_s, 0, data_size);
memcpy(data_s, data, data_len);
@@ -722,6 +726,10 @@
if (mcrypt_enc_is_block_mode(pm->td) == 1) { /* It's a block algorithm */
block_size = mcrypt_enc_get_block_size(pm->td);
data_size = (((data_len - 1) / block_size) + 1) * block_size;
+ if (data_size <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Integer overflow in data size");
+ RETURN_FALSE;
+ }
data_s = emalloc(data_size + 1);
memset(data_s, 0, data_size);
memcpy(data_s, data, data_len);
debian/patches/CVE-2016-6294.patch 0000664 0000000 0000000 00000005136 12746400261 013254 0 ustar From aa82e99ed8003c01f1ef4f0940e56b85c5b032d4 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Tue, 12 Jul 2016 22:37:36 -0700
Subject: [PATCH] Fix bug #72533 (locale_accept_from_http out-of-bounds access)
---
ext/intl/locale/locale_methods.c | 18 ++++++++++++++++++
ext/intl/tests/bug72533.phpt | 30 ++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+)
create mode 100644 ext/intl/tests/bug72533.phpt
Index: php5-5.5.9+dfsg/ext/intl/locale/locale_methods.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/intl/locale/locale_methods.c 2016-07-28 08:53:07.073632058 -0400
+++ php5-5.5.9+dfsg/ext/intl/locale/locale_methods.c 2016-07-28 08:55:09.395197223 -0400
@@ -1586,6 +1586,24 @@
"locale_accept_from_http: unable to parse input parameters", 0 TSRMLS_CC );
RETURN_FALSE;
}
+ if(http_accept_len > ULOC_FULLNAME_CAPACITY) {
+ /* check each fragment, if any bigger than capacity, can't do it due to bug #72533 */
+ char *start = http_accept;
+ char *end;
+ size_t len;
+ do {
+ end = strchr(start, ',');
+ len = end ? end-start : http_accept_len-(start-http_accept);
+ if(len > ULOC_FULLNAME_CAPACITY) {
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
+ "locale_accept_from_http: locale string too long", 0 TSRMLS_CC );
+ RETURN_FALSE;
+ }
+ if(end) {
+ start = end+1;
+ }
+ } while(end != NULL);
+ }
available = ures_openAvailableLocales(NULL, &status);
INTL_CHECK_STATUS(status, "locale_accept_from_http: failed to retrieve locale list");
Index: php5-5.5.9+dfsg/ext/intl/tests/bug72533.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.9+dfsg/ext/intl/tests/bug72533.phpt 2016-07-28 08:53:07.069632007 -0400
@@ -0,0 +1,30 @@
+--TEST--
+Bug #72533 (locale_accept_from_http out-of-bounds access)
+--SKIPIF--
+
+--FILE--
+
+--EXPECTF--
+false
+'locale_accept_from_http: locale string too long: U_ILLEGAL_ARGUMENT_ERROR'
+'en'
\ No newline at end of file
debian/patches/CVE-2015-8838.patch 0000664 0000000 0000000 00000004541 12704221624 013256 0 ustar Backport of:
From 97aa752fee61fccdec361279adbfb17a3c60f3f4 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Sun, 5 Jul 2015 00:00:53 -0700
Subject: [PATCH] Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM)
---
ext/mysqlnd/mysqlnd.c | 65 +++++++++++++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 25 deletions(-)
Index: php5-5.5.9+dfsg/ext/mysqlnd/mysqlnd.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/mysqlnd/mysqlnd.c 2016-04-15 13:19:15.688371594 -0400
+++ php5-5.5.9+dfsg/ext/mysqlnd/mysqlnd.c 2016-04-15 13:21:16.665909219 -0400
@@ -464,27 +464,41 @@
}
#ifdef MYSQLND_SSL_SUPPORTED
- if ((greet_packet->server_capabilities & CLIENT_SSL) && (mysql_flags & CLIENT_SSL)) {
- zend_bool verify = mysql_flags & CLIENT_SSL_VERIFY_SERVER_CERT? TRUE:FALSE;
- DBG_INF("Switching to SSL");
- if (!PACKET_WRITE(auth_packet, conn)) {
- CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
- SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
- goto end;
- }
+ if (mysql_flags & CLIENT_SSL) {
+ zend_bool server_has_ssl = (greet_packet->server_capabilities & CLIENT_SSL)? TRUE:FALSE;
+ if (server_has_ssl == FALSE) {
+ goto close_conn;
+ } else {
+ zend_bool verify = mysql_flags & CLIENT_SSL_VERIFY_SERVER_CERT? TRUE:FALSE;
+ DBG_INF("Switching to SSL");
+ if (!PACKET_WRITE(auth_packet, conn)) {
+ goto close_conn;
+ }
- conn->net->data->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify TSRMLS_CC);
+ conn->net->data->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify TSRMLS_CC);
- if (FAIL == conn->net->data->m.enable_ssl(conn->net TSRMLS_CC)) {
- goto end;
+ if (FAIL == conn->net->data->m.enable_ssl(conn->net TSRMLS_CC)) {
+ goto end;
+ }
}
}
+#else
+ auth_packet->client_flags &= ~CLIENT_SSL;
+ if (!PACKET_WRITE(auth_packet, conn)) {
+ goto close_conn;
+ }
#endif
ret = PASS;
end:
PACKET_FREE(auth_packet);
DBG_RETURN(ret);
+
+close_conn:
+ CONN_SET_STATE(conn, CONN_QUIT_SENT);
+ conn->m->send_close(conn TSRMLS_CC);
+ SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
+ PACKET_FREE(auth_packet);
+ DBG_RETURN(ret);
}
/* }}} */
debian/patches/CVE-2017-9226.patch 0000664 0000000 0000000 00000003643 13141101777 013254 0 ustar From 4e68b2c52b1f7bb899295521df15c631a37b3994 Mon Sep 17 00:00:00 2001
From: Remi Collet
Date: Tue, 30 May 2017 15:35:42 +0200
Subject: [PATCH] Patch from the upstream git
https://github.com/kkos/oniguruma/issues/55 (CVE-2017-9226)
b4bf968ad52afe14e60a2dc8a95d3555c543353a Modified for onig 5.9.6
f015fbdd95f76438cd86366467bb2b39870dd7c6 Modified for onig 5.9.6
Thanks to Mamoru TASAKA
---
ext/mbstring/oniguruma/regparse.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: php5-5.5.9+dfsg/ext/mbstring/oniguruma/regparse.c
===================================================================
--- php5-5.5.9+dfsg.orig/ext/mbstring/oniguruma/regparse.c 2017-08-04 10:26:05.530850236 -0400
+++ php5-5.5.9+dfsg/ext/mbstring/oniguruma/regparse.c 2017-08-04 10:26:05.526850237 -0400
@@ -3059,7 +3059,7 @@ fetch_token_in_cc(OnigToken* tok, UChar*
PUNFETCH;
prev = p;
num = scan_unsigned_octal_number(&p, end, 3, enc);
- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
+ if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
if (p == prev) { /* can't read nothing. */
num = 0; /* but, it's not error */
}
@@ -3431,7 +3431,7 @@ fetch_token(OnigToken* tok, UChar** src,
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
prev = p;
num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
+ if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
if (p == prev) { /* can't read nothing. */
num = 0; /* but, it's not error */
}
@@ -4081,7 +4081,11 @@ next_state_val(CClassNode* cc, OnigCodeP
switch (*state) {
case CCS_VALUE:
if (*type == CCV_SB)
+ {
+ if (*vs > 0xff)
+ return ONIGERR_INVALID_CODE_POINT_VALUE;
BITSET_SET_BIT(cc->bs, (int )(*vs));
+ }
else if (*type == CCV_CODE_POINT) {
r = add_code_range(&(cc->mbuf), env, *vs, *vs);
if (r < 0) return r;
debian/patches/044-strtod_arm_fix.patch 0000664 0000000 0000000 00000002736 12300436054 015176 0 ustar --- php5.orig/Zend/zend_strtod.c
+++ php5/Zend/zend_strtod.c
@@ -152,14 +152,25 @@ typedef unsigned long int uint32_t;
#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__
@@ -287,7 +298,7 @@ BEGIN_EXTERN_C()
* 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++)
#else
debian/patches/CVE-2014-8142.patch 0000664 0000000 0000000 00000005125 12467421325 013246 0 ustar From 630f9c33c23639de85c3fd306b209b538b73b4c9 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Thu, 11 Dec 2014 19:28:32 -0800
Subject: [PATCH] Fix bug #68594 - Use after free vulnerability in
unserialize()
---
NEWS | 2 +
ext/standard/tests/serialize/bug68594.phpt | 23 ++++++++++
ext/standard/var_unserializer.c | 68 ++++++++++++++++--------------
ext/standard/var_unserializer.re | 3 ++
4 files changed, 64 insertions(+), 32 deletions(-)
create mode 100644 ext/standard/tests/serialize/bug68594.phpt
Index: php5-5.5.12+dfsg/ext/standard/tests/serialize/bug68594.phpt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ php5-5.5.12+dfsg/ext/standard/tests/serialize/bug68594.phpt 2015-02-13 10:05:12.756213147 -0500
@@ -0,0 +1,23 @@
+--TEST--
+Bug #68545 Use after free vulnerability in unserialize()
+--FILE--
+aaa = array(1,2,&$u,4,5);
+ $m->bbb = 1;
+ $m->ccc = &$u;
+ $m->ddd = str_repeat("A", $i);
+
+ $z = serialize($m);
+ $z = str_replace("bbb", "aaa", $z);
+ $y = unserialize($z);
+ $z = serialize($y);
+}
+?>
+===DONE===
+--EXPECTF--
+===DONE===
Index: php5-5.5.12+dfsg/ext/standard/var_unserializer.c
===================================================================
--- php5-5.5.12+dfsg.orig/ext/standard/var_unserializer.c 2015-02-13 10:05:12.764213213 -0500
+++ php5-5.5.12+dfsg/ext/standard/var_unserializer.c 2015-02-13 10:05:12.756213147 -0500
@@ -334,6 +334,9 @@
} else {
/* object properties should include no integers */
convert_to_string(key);
+ if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) {
+ var_push_dtor(var_hash, old_data);
+ }
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data,
sizeof data, NULL);
}
Index: php5-5.5.12+dfsg/ext/standard/var_unserializer.re
===================================================================
--- php5-5.5.12+dfsg.orig/ext/standard/var_unserializer.re 2015-02-13 10:05:12.764213213 -0500
+++ php5-5.5.12+dfsg/ext/standard/var_unserializer.re 2015-02-13 10:05:12.756213147 -0500
@@ -340,6 +340,9 @@
} else {
/* object properties should include no integers */
convert_to_string(key);
+ if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) {
+ var_push_dtor(var_hash, old_data);
+ }
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data,
sizeof data, NULL);
}
debian/patches/CVE-2018-10547.patch 0000664 0000000 0000000 00000017452 13275032431 013334 0 ustar From 6e64aba47f4e41d97c4d010024c68320c0855f45 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev
Date: Tue, 27 Mar 2018 21:22:28 -0700
Subject: [PATCH] Fix #76129 - remove more potential unfiltered outputs for
phar
---
ext/phar/phar_object.c | 6 ++----
ext/phar/tests/cache_list/frontcontroller10.phpt | 2 +-
ext/phar/tests/cache_list/frontcontroller6.phpt | 2 +-
ext/phar/tests/cache_list/frontcontroller8.phpt | 2 +-
ext/phar/tests/frontcontroller10.phpt | 2 +-
ext/phar/tests/frontcontroller6.phpt | 2 +-
ext/phar/tests/frontcontroller8.phpt | 2 +-
ext/phar/tests/tar/frontcontroller10.phar.phpt | 2 +-
ext/phar/tests/tar/frontcontroller6.phar.phpt | 2 +-
ext/phar/tests/tar/frontcontroller8.phar.phpt | 2 +-
ext/phar/tests/zip/frontcontroller10.phar.phpt | 2 +-
ext/phar/tests/zip/frontcontroller6.phar.phpt | 2 +-
ext/phar/tests/zip/frontcontroller8.phar.phpt | 2 +-
13 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 64d7a6c76eee..a6f56ac8af29 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -340,8 +340,7 @@ static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
sapi_send_headers(TSRMLS_C);
PHPWRITE("\n \n Access Denied\n \n \n 403 - File ", sizeof("\n \n Access Denied\n \n \n 403 - File ") - 1);
- PHPWRITE(entry, entry_len);
- PHPWRITE(" Access Denied
\n \n", sizeof(" Access Denied
\n \n") - 1);
+ PHPWRITE("Access Denied\n