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:7
Avg. Score:4.0 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:2 (28.6%)
Same OS:4 (57.1%)
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-19 22:20 UTC] dominic at varspool dot com
Duplicate of #67764
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Fri Jul 20 08:01:25 2018 UTC