From f19ee454d12f2b4391f579b898151d2068afdc7a Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 20 Nov 2026 14:07:31 +0100 Subject: [PATCH] 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 "" in test files. Co-Authored-By: Claude Opus 5.5 --- mod_php_install.sh | 57 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/mod_php_install.sh b/mod_php_install.sh index 2f33e4a..afb4d13 100755 --- a/mod_php_install.sh +++ b/mod_php_install.sh @@ -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 '