Doc #80580 [Ver->Csd]: listen.allowed_clients does not operate as expected with blank or "any" value

[email protected] Wed, 02 Mar 2022 22:56:28 +0000
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=80580&edit=1

 ID:                 80580
 Updated by:         [email protected]
 Reported by:        matthew at mamis dot com dot au
 Summary:            listen.allowed_clients does not operate as expected
                     with blank or "any" value
-Status:             Verified
+Status:             Closed
 Type:               Documentation Problem
 Package:            FPM related
 Operating System:   RedHat 8
 PHP Version:        7.4.13
-Assigned To:        
+Assigned To:        bukka
 Block user comment: N
 Private report:     N

 New Comment:

This has been fixed by https://github.com/php/doc-en/commit/557f8ed419f9798a76539bee44754d4288ceccad


Previous Comments:
------------------------------------------------------------------------
[2021-01-30 21:03:41] [email protected]

Yeah this is a documentation issue. It should not be specified if all connections are allowed.

------------------------------------------------------------------------
[2021-01-03 23:56:16] [email protected]

It is, however, worth noting that this may be simply a documentation issue. The phrasing "left blank" would probably be more accurately stated as "not specified" and the term "any" does not necessarily imply that the literal string "any" should mean "any value".

That said, I would at least expect the empty string to function the same as unspecified in this case.

------------------------------------------------------------------------
[2021-01-03 23:51:42] [email protected]

reproduced in 8.0.0

------------------------------------------------------------------------
[2021-01-03 22:07:58] matthew at mamis dot com dot au

Description:
------------
In PHP FPM, setting listen.allowed_clients to either of the following values will result in PHP-FPM rejecting fastcgi requests

This is unexpected behaviour, as the documentation states that...

(1) If this value is left blank, connections will be accepted from any ip address.

(2) Default Value: any

Test script:
---------------
php-fpm.conf:

[global]
pid = /run/php/php-fpm.pid
error_log = /var/log/php-fpm.log
include=/etc/php-fpm/pool.d/*.conf


pool.d/www.conf (example: 1):

[www]
user = php-fpm
group = php-fpm

listen = 9000
listen.allowed_clients = 


pool.d/www.conf (example: 2):

[www]
user = php-fpm
group = php-fpm

listen = 9000
listen.allowed_clients = any

Expected result:
----------------
Setting listen.allowed_clients to a value of "" or "any" should result in the fastcgi connection being accepted

Actual result:
--------------
PHP-FPM rejects the request, with the following error...

php-fpm_1  | ERROR: Connection disallowed: IP address '172.20.0.5' has been dropped.


Additionally, the following error messages are thrown on startup...

Example 1 (listen.allowed_clients = )

php-fpm_1  | ERROR: Wrong IP address '' in listen.allowed_clients
php-fpm_1  | ERROR: There are no allowed addresses


Example 2 (listen.allowed_clients = any)

php-fpm_1  | ERROR: Wrong IP address 'any' in listen.allowed_clients
php-fpm_1  | ERROR: There are no allowed addresses


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80580&edit=1