-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop statically compiling the FTP extension #1482
Conversation
According to the documentation of `ftp_ssl_connect()`, the limitation of requiring a static build was lifted with PHP 7.0. Thus stop forcibly including the FTP extension, which should be needed somewhat rarely. Example: root@2a4c93db4a86:/var/www/html# apt-get update -qqqqq root@2a4c93db4a86:/var/www/html# apt-get install -yyyyqqqq libssl-dev debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libssl-dev:amd64. (Reading database ... 13257 files and directories currently installed.) Preparing to unpack .../libssl-dev_3.0.11-1~deb12u2_amd64.deb ... Unpacking libssl-dev:amd64 (3.0.11-1~deb12u2) ... Setting up libssl-dev:amd64 (3.0.11-1~deb12u2) ... root@2a4c93db4a86:/var/www/html# docker-php-ext-configure ftp --with-openssl-dir >/dev/null root@2a4c93db4a86:/var/www/html# docker-php-ext-install ftp >/dev/null + strip --strip-all modules/ftp.so root@2a4c93db4a86:/var/www/html# php -r "var_dump(function_exists('ftp_ssl_connect'));" bool(true)
Dockerfile-linux.template
Outdated
@@ -318,8 +318,10 @@ RUN set -eux; \ | |||
# https://github.com/docker-library/php/issues/822 | |||
--with-pic \ | |||
\ | |||
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) | |||
{{ if [ "8.1", "8.2", "8.3" ] | index(env.version | rtrimstr("-rc")) then ( -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How often is the ftp
module used? I know this is extra conservative and so will only drop the module in 8.4
and above. Would it make sense to change at the next patch releases, like 8.1.28
, 8.2.15
, and 8.3.2
or would there be too much breakage? Or maybe just some of them, like 8.3.2
and above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is extra conservative. I would expect the FTP extension to be used primarily in legacy code. Personally I've not used it ever.
GitHub's code search for ftp_connect
reports 8.6k results (with some of them being the php-src stubs and some of them not being the actual ftp_connect
function of the FTP extension).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, let's still be conservative for the current versions, but slightly more aggressive on even the next patch releases (the mitigation for the subset of affected users is pretty trivial); maybe something like this:
{{ if [ "8.1", "8.2", "8.3" ] | index(env.version | rtrimstr("-rc")) then ( -}} | |
{{ if .version as $v | [ "8.1.27", "8.2.14", "8.3.1" ] | index($v) then ( -}} |
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
Thank you! |
Changes: - docker-library/php@641cf9a2: Stop statically compiling the FTP extension (docker-library/php#1482)
Changes: - docker-library/php@d25f4810: Update 8.3-rc to 8.3.2RC1 - docker-library/php@b8d8b370: Update 8.2-rc to 8.2.15RC1 - docker-library/php@641cf9a2: Stop statically compiling the FTP extension (docker-library/php#1482)
8.1.x is security-only and future releases happen on a case to case basis to fix security issues only. We likely should not break the build for those folks still on 8.1. see docker-library#1482
Changes: - docker-library/php@d25f4810: Update 8.3-rc to 8.3.2RC1 - docker-library/php@b8d8b370: Update 8.2-rc to 8.2.15RC1 - docker-library/php@641cf9a2: Stop statically compiling the FTP extension (docker-library/php#1482)
According to the documentation of
ftp_ssl_connect()
, the limitation of requiring a static build was lifted with PHP 7.0. Thus stop forcibly including the FTP extension, which should be needed somewhat rarely.Example: