mod_php_install.sh: apply security patches for PHP 8.0.30.
Generalize the PHP 8.1.34 patch block into a per-version patch list and apply for PHP 8.0.30, in this order: cve-2026-109618-109619, sury-25, xlts-1, xlts-2, sury-25-re2c-generated (CVE before sury, otherwise hunk #4 of main/rfc1867.c fails). All apply without fuzz, also on top of PHP-8.0-OpenSSL-3.0-compatibility.patch. The generated files are marked as up to date afterwards, as for 8.1.34. The HTML page check now only looks at the first non-empty line: php-8.0.30-sury-25.patch contains "<html>" in test files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
837decf4c0
commit
f19ee454d1
1 file changed
+45
-12
+45
-12
@@ -6399,8 +6399,20 @@ else
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
# - Security patches for PHP 8.1.34 (source: omega8cc/boa, aegir/patches/php-sec)
|
||||
# - Security patches for PHP 8.0.30 and 8.1.34
|
||||
# - (source: omega8cc/boa, aegir/patches/php-sec)
|
||||
# -
|
||||
# - PHP 8.0.30:
|
||||
# - php-8.0.30-cve-2026-109618-109619.patch
|
||||
# - php-8.0.30-sury-25.patch (backports from 8.x, Debian/sury)
|
||||
# - php-8.0.30-xlts-1.patch (mysqlnd)
|
||||
# - php-8.0.30-xlts-2.patch
|
||||
# - php-8.0.30-sury-25-re2c-generated.patch
|
||||
# - (own patch: the *.re hunks of sury-25 for pdo_sql_parser and
|
||||
# - url_scanner_ex applied to the generated *.c files, so the fixes
|
||||
# - are built without re2c)
|
||||
# -
|
||||
# - PHP 8.1.34:
|
||||
# - php-8.1.34-cve-2026-109618-109619.patch
|
||||
# - php-8.1.34-sury-9.patch (backports from 8.2.x, Debian/sury)
|
||||
# - php-8.1.34-cve-2026-129291.patch (php-fpm)
|
||||
@@ -6410,27 +6422,48 @@ fi
|
||||
# - are built without re2c)
|
||||
# -
|
||||
# - Order matters: the CVE-2026-109618/109619 patch MUST be applied before
|
||||
# - 'php-8.1.34-sury-9.patch', otherwise hunk #4 of main/rfc1867.c fails.
|
||||
# - In the order below all three apply cleanly (no fuzz) to php-8.1.34.
|
||||
# - the sury patch, otherwise hunk #4 of main/rfc1867.c fails. In the order
|
||||
# - below all patches apply cleanly (no fuzz) - for 8.0.30 also on top of
|
||||
# - 'PHP-8.0-OpenSSL-3.0-compatibility.patch'.
|
||||
# -
|
||||
# - The patches are applied to the unpacked tree '${_srcdir}/php-${VERSION}'
|
||||
# - (not $_builddir), because with apache mod_php the tree is moved to
|
||||
# - $_builddir only further below.
|
||||
# -
|
||||
# - Security fixes: if one fails, abort - never build PHP 8.1.34 without them.
|
||||
# - Security fixes: if one fails, abort - never build PHP without them.
|
||||
# -
|
||||
if [[ "$VERSION" = "8.1.34" ]]; then
|
||||
for _patch_file in \
|
||||
php-8.1.34-cve-2026-109618-109619.patch \
|
||||
php-8.1.34-sury-9.patch \
|
||||
php-8.1.34-cve-2026-129291.patch \
|
||||
php-8.1.34-sury-9-re2c-generated.patch ; do
|
||||
case "$VERSION" in
|
||||
8.0.30)
|
||||
_sec_patches="
|
||||
php-8.0.30-cve-2026-109618-109619.patch
|
||||
php-8.0.30-sury-25.patch
|
||||
php-8.0.30-xlts-1.patch
|
||||
php-8.0.30-xlts-2.patch
|
||||
php-8.0.30-sury-25-re2c-generated.patch"
|
||||
;;
|
||||
8.1.34)
|
||||
_sec_patches="
|
||||
php-8.1.34-cve-2026-109618-109619.patch
|
||||
php-8.1.34-sury-9.patch
|
||||
php-8.1.34-cve-2026-129291.patch
|
||||
php-8.1.34-sury-9-re2c-generated.patch"
|
||||
;;
|
||||
*)
|
||||
_sec_patches=""
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -n "$_sec_patches" ]]; then
|
||||
for _patch_file in $_sec_patches ; do
|
||||
echononl "\tApply ${_patch_file}"
|
||||
if [[ ! -f "${_srcdir}/${_patch_file}" ]] ; then
|
||||
echo_failed
|
||||
fatal "Can't find patchfile '${_srcdir}/${_patch_file}'"
|
||||
fi
|
||||
if grep -qi '<html' "${_srcdir}/${_patch_file}" ; then
|
||||
# - Only look at the first non-empty line: a patch may contain '<html'
|
||||
# - in test files (e.g. php-8.0.30-sury-25.patch).
|
||||
# -
|
||||
if grep -m1 -v '^[[:space:]]*$' "${_srcdir}/${_patch_file}" | grep -qiE '^[[:space:]]*<(!doctype html|html)' ; then
|
||||
echo_failed
|
||||
fatal "'${_srcdir}/${_patch_file}' is an HTML page, not a patch!\n\t (Download the 'raw' file, not the GitHub page)"
|
||||
fi
|
||||
@@ -6472,7 +6505,7 @@ if [[ "$VERSION" = "8.1.34" ]]; then
|
||||
fatal "$(cat $tmp_err_msg)"
|
||||
fi
|
||||
else
|
||||
echononl "\tApply PHP 8.1.34 security patches"
|
||||
echononl "\tApply PHP security patches (omega8cc/boa)"
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user