Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22317 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95840 invoked by uid 1010); 10 Mar 2006 05:13:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95825 invoked from network); 10 Mar 2006 05:13:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Mar 2006 05:13:47 -0000 X-Host-Fingerprint: 204.11.219.142 unknown Received: from ([204.11.219.142:54706] helo=lt4.firehawksystems.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id C3/C7-27106-90B01144 for ; Fri, 10 Mar 2006 00:13:46 -0500 Received: from [10.0.0.2] ([69.219.226.176]) (authenticated bits=0) by lt4.firehawksystems.com (8.13.5/8.13.3) with ESMTP id k29MOt6K073697 for ; Thu, 9 Mar 2006 22:24:55 GMT Mime-Version: 1.0 (Apple Message framework v746.2) Content-Transfer-Encoding: 7bit Message-ID: <0FF5C589-6436-45E0-8626-F0B9944046ED@firehawksystems.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: internals@lists.php.net Date: Fri, 10 Mar 2006 00:13:56 -0500 X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on lt4.firehawksystems.com X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on lt4.firehawksystems.com Subject: primary file realpath change From: list@firehawksystems.com ("Brian J. France") Does anybody see a problem with this patch (which is currently against the 5.1.2 release)? expand_filepath will eventual do a realpath, but it also uses the realpath cache before calling realpath. VCWD_REALPATH just maps directly to realpath and doesn't use the realpath cache so for every request you get a realpath call (and all the syscalls that go with it) on the primary file. I think I need to pass TSRMLS_CC, but I am not sure. Any problems committing it to PHP_5_1 and HEAD? Brian --- ../php-5.1.2.orig/main/main.c Sun Jan 1 04:50:17 2006 +++ main/main.c Thu Mar 9 20:00:47 2006 @@ -1684,7 +1684,7 @@ char realfile[MAXPATHLEN]; int realfile_len; int dummy = 1; - if (VCWD_REALPATH(primary_file->filename, realfile)) { + if (expand_filepath(primary_file->filename, realfile TSRMLS_CC)) { realfile_len = strlen(realfile); zend_hash_add(&EG(included_files), realfile, realfile_len+1, (void *)&dummy, sizeof(int), NULL); if (strncmp(realfile, primary_file- >filename, realfile_len)) {