Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45157 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87812 invoked from network); 31 Jul 2009 00:10:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2009 00:10:24 -0000 Authentication-Results: pb1.pair.com header.from=daniel@zoltak.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=daniel@zoltak.com; spf=permerror; sender-id=softfail Received-SPF: error (pb1.pair.com: domain zoltak.com from 203.16.214.57 cause and error) X-PHP-List-Original-Sender: daniel@zoltak.com X-Host-Fingerprint: 203.16.214.57 ipmail04.adl2.internode.on.net Received: from [203.16.214.57] ([203.16.214.57:63663] helo=ipmail04.adl2.internode.on.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/49-43040-D66327A4 for ; Thu, 30 Jul 2009 20:10:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcEAKPQcUqWZZo2/2dsb2JhbACBUpdIuX2EFwWBSYZK X-IronPort-AV: E=Sophos;i="4.43,298,1246804200"; d="scan'208";a="425561267" Received: from ppp154-54.static.internode.on.net (HELO zoltak.com) ([150.101.154.54]) by ipmail04.adl2.internode.on.net with SMTP; 31 Jul 2009 09:40:17 +0930 Received: (qmail 30582 invoked from network); 31 Jul 2009 00:10:17 -0000 Received: from unknown (HELO localhost) (127.0.0.1) by 127.0.0.1 with SMTP; 31 Jul 2009 00:10:17 -0000 Received: from myob.com.au (myob.com.au [203.34.100.2]) by webmail.zoltak.com (Horde MIME library) with HTTP; Fri, 31 Jul 2009 10:10:17 +1000 Message-ID: <20090731101017.jcs6fiyk0sg4gcok@webmail.zoltak.com> Date: Fri, 31 Jul 2009 10:10:17 +1000 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.6) Subject: fopen_wrappers.c DOCUMENT_ROOT .htaccess error From: daniel@zoltak.com Greetings list, I've modified fopen_wrappers.c to add some custom security checks for =20 our environment. Part of the check requires obtaining the DocumentRoot. The modification begins at line 115 where the DocumentRoot is found: // Document root from Zend (pointer to pointer) zval **document_root =3D NULL; // Make sure DOCUMENT_ROOT is accessible from the global vars if (!PG(http_globals)[TRACK_VARS_SERVER] || =09zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, =20 "DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT"), (void **) &document_root) =3D=3D = =20 FAILURE) { =09// Unable to find DOCUMENT_ROOT =09php_error_docref(NULL TSRMLS_CC, E_WARNING, "fopen_wrapper_patch: =20 DOCUMENT_ROOT variable is not set, cannot determine document root."); =09// Can't check the document root - fail =09return -1; } The above code has been works fine in PHP 5.2.6. In PHP 5.2.10 it =20 works except when an .htaccess is defined with the following: <--BEGIN SNIP .htaccess--> php_value error_log '/home/st/stu/studio1.com.au/www/logs/php_err.log' <--END SNIP--> The above .htaccess works as expected in PHP 5.2.6 when looking up the =20 DOCUMENT_ROOT. Is there another way to obtain the DOCUMENT_ROOT at this point in the =20 code or has something been introduced into the code since 5.2.6 that =20 is causing a wider issue that needs to be fixed? Your help would be much appreciated. Thanks