Bug #72575 [PATCH]: Using --allow-to-run-as-root should ignore missing user directive
| From: | gooh@php.net | Date: | Mon, 11 Jul 2016 11:54:19 +0000 |
| Subject: | Bug #72575 [PATCH]: Using --allow-to-run-as-root should ignore missing user directive | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202192@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72575&edit=1
ID: 72575
Patch added by: gooh@php.net
Reported by: gooh@php.net
Summary: Using --allow-to-run-as-root should ignore missing
user directive
Status: Assigned
Type: Bug
Package: FPM related
PHP Version: 7.1.0alpha1
Assigned To: gooh
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: 72575
Revision: 1468238058
URL: https://bugs.php.net/patch-display.php?bug=72575&patch=72575&revision=1468238058
Previous Comments:
------------------------------------------------------------------------
[2016-07-11 10:53:11] gooh@php.net
Description:
------------
Trying to start PHP-FPM with the --allow-to-run-as-root flag will not work when the user directive
is not given in the FPM worker pool configuration. Parsing the config will fail. Consequently, FPM
cannot start.
The offending code is in /master/sapi/fpm/fpm/fpm_conf.c:
766 /* alert if user is not set only if we are not root*/
767 if (!wp->config->user && !geteuid()) {
768 zlog(ZLOG_ALERT, "[pool %s] user has not been defined", wp->config->name);
769 return -1;
770 }
On a side note: the comment is wrong (should be "if we are root").
Related https://bugs.php.net/bug.php?id=61295
Test script:
---------------
Comment the user directive in a worker pool confing. Then try to start php-fpm as root.
Actual result:
--------------
root@4d9ea34ff691:/var/www/html# php-fpm -D
[11-Jul-2016 08:27:46] ALERT: [pool www] user has not been defined
[11-Jul-2016 08:27:46] ERROR: failed to post process the configuration
[11-Jul-2016 08:27:46] ERROR: FPM initialization failed
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72575&edit=1