Bug #72575 [Asn->Csd]: Using --allow-to-run-as-root should ignore missing user directive

From: Date: Tue, 12 Jul 2016 08:38:51 +0000
Subject: Bug #72575 [Asn->Csd]: 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-202228@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 Updated by: jpauli@php.net Reported by: gooh@php.net Summary: Using --allow-to-run-as-root should ignore missing user directive -Status: Assigned +Status: Closed Type: Bug Package: FPM related PHP Version: 7.1.0alpha1 Assigned To: gooh Block user comment: N Private report: N New Comment: Automatic comment on behalf of gooh Revision: http://git.php.net/?p=php-src.git;a=commit;h=fb49f137ecdec2c6273ee8acf6a34ce98f503eab Log: Fix #72575: using --allow-to-run-as-root should ignore missing user directive Previous Comments: ------------------------------------------------------------------------ [2016-07-11 11:54:18] gooh@php.net 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 ------------------------------------------------------------------------ [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

« previous php.bugs (#202228) next »