php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48811 Directives in PATH section do not get applied to subdirectories
Submitted: 2009-07-06 06:26 UTC Modified: 2010-01-16 21:02 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ct at swin dot edu dot au Assigned: pajoye
Status: Closed Package: PHP options/info functions
PHP Version: 5.3, 6 OS: *
Private report: No CVE-ID:
 [2009-07-06 06:26 UTC] ct at swin dot edu dot au
Description:
------------
A php.ini file with directives in a PATH section do not get applied for subdirectories in the defined path.

For example

[PATH=/vhost/www.example.com/dir1]

will work for scripts in /vhost/www.example.com/dir1, but not /vhost/www.example.com/dir1/dir2.

I have fixed this on my system using the following patch
http://pastebin.com/m7e79576f







Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-30 19:38 UTC] jani@php.net
There is no patch there. If it's simple and not very long, add it here as comment instead. 
 [2009-12-02 00:06 UTC] ct at swin dot edu dot au
That pastebin.com entry was set to expire after 1 month.

I've uploaded it again

http://pastebin.com/f45a38211
 [2009-12-14 00:24 UTC] ct at swin dot edu dot au
--- php_ini.c-orig      2009-07-06 16:04:43.000000000 +1000
+++ php_ini.c   2009-07-06 15:58:32.000000000 +1000
 -795,7 +795,7 @@
                while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
                        *ptr = 0;
                        /* Search for source array matching the path from configuration_hash */
-                       if (zend_hash_find(&configuration_hash, path, path_len, (void **) &tmp) == SUCCESS) {
+                       if (zend_hash_find(&configuration_hash, path, strlen(path) + 1, (void **) &tmp) == SUCCESS) {
                                php_ini_activate_config(Z_ARRVAL_P(tmp), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
                        }
                        *ptr = '/';
 [2009-12-20 21:51 UTC] millennium at qme dot nl
This patch works for WIN32 (build PHP 5.3.1 with this patch)
 [2010-01-16 21:01 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=293627
Log: - Fixed bug #48811 (Directives in PATH section do not get applied to subdirectories)
 [2010-01-16 21:02 UTC] jani@php.net
Fixed now, propably won't make it to 5.3.2.
 [2010-02-03 20:13 UTC] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=294449
Log: - Fixed bug #48811 (Directives in PATH section do not get applied to subdirector
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 10:02:09 2014 UTC