php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71544 Broken syslog ident(tag) on php-fpm environment
Submitted: 2016-02-07 16:18 UTC Modified: -
Votes:10
Avg. Score:4.1 ± 0.9
Reproduced:9 of 9 (100.0%)
Same Version:3 (33.3%)
Same OS:4 (44.4%)
From: sunnyone41 at gmail dot com Assigned:
Status: Open Package: *General Issues
PHP Version: 5.6.18 OS: Ubuntu 14.04
Private report: No CVE-ID: None
 [2016-02-07 16:18 UTC] sunnyone41 at gmail dot com
Description:
------------
When error_log = syslog is set at php.ini on php-fpm environment, broken ident (tag) is used like this:

Feb  7 22:02:36 phphost ool www: ERRORTEST
                        ^^^^^^^

This is caused by changing argv[0] by php-fpm. syslog() calls internally openlog() and it uses __progname as the default ident value, but the pointer __progname indicates the place of basename in old argv[0].

          v after the last slash
/usr/sbin/php5-fpm <- original argv[0]
          php5-fpm <- expected __progname
php-fpm: pool www  <- customized argv[0]
          ool www  <- actual __progname

I think "ool www" is not expected for most people. openlog() with proper ident (syslog.ident in php-fpm.conf?) argument should be called with php-fpm environment.



Test script:
---------------
<?php error_log("ERRORTEST") ?>


Expected result:
----------------
A line like below will be written:
Feb  7 22:02:36 phphost php-fpm: ERRORTEST

Actual result:
--------------
A line like below will be written:
Feb  7 22:02:36 phphost ool www: ERRORTEST

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-19 22:20 UTC] dominic at varspool dot com
Duplicate of #67764
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 19:01:28 2024 UTC