Bug in apache_config.c / merge_php_config

From: Date: Tue, 06 Jun 2006 21:01:21 +0000
Subject: Bug in apache_config.c / merge_php_config
Groups: php.internals 
Request: Send a blank email to internals+get-23971@lists.php.net to get a copy of this message
Hello, i have discussed with rasmus in january 2005(!) a potential bug in PHP4's merge_php_config function without finding a real solution / reason for what I have monitored. Now, today I had experienced the same strange things as last year, using current PHP5 implementation. The story is, that when using different <DirectoryMatch></directoryMatch> parameters in a httpd.conf file containing different php_value directives, the chances are good that those values will mix up. Reading the current mod_example.c from apache2 I can see following comments: [...] * Note that while the per-directory and per-server configuration records are * available to most of the module handlers, they should be treated as * READ-ONLY by all except the command and merge handlers. Sometimes handlers * are handed a record that applies to the current location by implication or * inheritance, and modifying it will change the rules for other locations. [...] and for x_merge_dir_config there is: [...] * The routine MUST NOT modify any of its arguments! [...] Read (as in the example): It has to return a new allocated / initialized config object. BUT if you look at sapi/apache2handler/apache_config.c (and sapi/apache2filter/apache_config.c) you can see that the third parameter is actually CHANGED with zend_hash_update and returned by the function (where this function HAS to return a new allocated config!) Who thinks that I am right that this is wrong implemented? Who is able to make a patch for this? -mike -- mike peter bretz metropolis ag / entwicklung email: m.bretz@metropolis-ag.de heinestraße 72 phone: +49-7121-348-120 d-72762 reutlingen fax: +49-7121-348-111 http://www.metropolis-ag.de/ metropolis ag. creating social internetworks.

« previous php.internals (#23971) next »