Re: fopen_wrappers.c DOCUMENT_ROOT .htaccess error

From: Date: Tue, 18 Aug 2009 02:41:00 +0000
Subject: Re: fopen_wrappers.c DOCUMENT_ROOT .htaccess error
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-45309@lists.php.net to get a copy of this message
Quoting daniel@zoltak.com:
Quoting daniel@zoltak.com:
Quoting Scott MacVicar <scott@macvicar.net>: Ideally both should be performed to ensure the error_log path is within the open_base.
In the function OnUpdateErrorLog in main.c is there anyway to obtain the HTTP_HOST or SERVER_NAME variable or ideally the DOCUMENT_ROOT. I have tried using getenv() and sapi_getenv() without success. Are there any other methods?
It appears there was a bug in PHP prior to 5.2.7 where PG(open_base_dir) had not been initialised in the OnUpdateErrorLog therefore the php_check_open_basedir() function was never being called if a custom error_log was specified in the .htaccess. So in fact the custom code we had should have never worked when the .htaccess had an error_log defined. I have now reworked our patch to perform some extra validation in our environment so this scenario works. Thanks to everyone that attempted to steer me in the right direction :)

« previous php.internals (#45309) next »