Bug #72575 [NEW]: Using --allow-to-run-as-root should ignore missing user directive
| From: | gooh@php.net | Date: | Mon, 11 Jul 2016 10:53:12 +0000 |
| Subject: | Bug #72575 [NEW]: Using --allow-to-run-as-root should ignore missing user directive | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-202189@lists.php.net to get a copy of this message | ||
From: gooh
Operating system:
PHP version: 7.1.0alpha1
Package: FPM related
Bug Type: Bug
Bug description:Using --allow-to-run-as-root should ignore missing user directive
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 bug report at https://bugs.php.net/bug.php?id=72575&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72575&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72575&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72575&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72575&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72575&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72575&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72575&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72575&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72575&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72575&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72575&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72575&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72575&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72575&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72575&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72575&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72575&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72575&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72575&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72575&r=mysqlcfg