Bug #80351 [PATCH]: Incorrect detection of zip_*_method_supported() availability in libzip

From: Date: Thu, 12 Nov 2020 08:47:27 +0000
Subject: Bug #80351 [PATCH]: Incorrect detection of zip_*_method_supported() availability in libzip
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230288@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80351&edit=1 ID: 80351 Patch added by: nvizovitin@plesk.com Reported by: nvizovitin at plesk dot com Summary: Incorrect detection of zip_*_method_supported() availability in libzip Status: Open Type: Bug Package: Zip Related Operating System: Any with older libzip PHP Version: 8.0.0RC3 Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: libzip-fix-have-method-supported-detection.diff Revision: 1605170847 URL: https://bugs.php.net/patch-display.php?bug=80351&patch=libzip-fix-have-method-supported-detection.diff&revision=1605170847 Previous Comments: ------------------------------------------------------------------------ [2020-11-12 08:46:51] nvizovitin at plesk dot com Description: ------------ HAVE_METHOD_SUPPORTED AC_DEFINE is set incorrectly during zip extension configuration for some libzip versions < 1.7.0, such as 1.3.2. Detection of zip_compression_method_supported() and zip_encryption_method_supported() functions availability in libzip is incorrect. They are publicly available since libzip 1.7.0, however the first one was privately available before (at least in 1.3.2), so its detection via AC_CHECK_LIB was successful where it should not have been. This results in runtime errors which happen on attempts to use ZipArchive::isEncryptionMethodSupported() or phpinfo(). See also: * https://libzip.org/documentation/zip_compression_method_supported.html * https://libzip.org/documentation/zip_encryption_method_supported.html The issue was also reproduced on PHP 8.0.0RC4 (https://downloads.php.net/~carusogabriel/php-8.0.0RC4.tar.xz). We encountered this issue on CentOS 7 with non-system libzip build. Test script: --------------- php -r '$zip = new ZipArchive(); print($zip->isEncryptionMethodSupported(ZipArchive::EM_AES_256));' OR php -r 'phpinfo();' Expected result: ---------------- Provided PHP was built against libzip < 1.7.0: PHP Fatal error: Uncaught Error: Call to undefined method ZipArchive::isEncryptionMethodSupported() in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 AND phpinfo() doesn't result in error Actual result: -------------- /opt/plesk/php/8.0/bin/php: symbol lookup error: /opt/plesk/php/8.0/lib64/php/modules/zip.so: undefined symbol: zip_encryption_method_supported (in both cases) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80351&edit=1

« previous php.bugs (#230288) next »