Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39753 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8430 invoked from network); 7 Aug 2008 20:38:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2008 20:38:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.90.177 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 66.249.90.177 ik-out-1112.google.com Received: from [66.249.90.177] ([66.249.90.177:46503] helo=ik-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/14-22851-E5D5B984 for ; Thu, 07 Aug 2008 16:38:54 -0400 Received: by ik-out-1112.google.com with SMTP id c29so577285ika.7 for ; Thu, 07 Aug 2008 13:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=GBoDWuyCZR7Q67wEnmfB52S3iS4SCGf5SAas0jfOAJ8=; b=jqGvYzWIY+EduN/cC+J1Qm+nGJWPPHMBzWx5tULkU85WEWaoa9e61nYzG+ySDcwgX1 4plccPHQzx7AnzEaofaUJORqrxHMc1JcqaMM1r9JJB/1kpK3Qghgvq33CDLGpBQcInug //lVX8OihXLE/vp/EGPD4iOM2/na/3BzA1le8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=Jqco8H6AMKfYC4KFEuLpnuzkzxc5vnZHdu/cTT0ruWv8P4itkQXee1qvUx+B+LjoLp lD7wpZkVkaJ9Kuckp3efmJ04jZKtuddWlwmEslUeAz2dSdzTLTfDvYrIRPMmc4vQoKJx FV+2t7+aq0l82iEaVcIB8oavPfQsvglti0uKw= Received: by 10.210.74.17 with SMTP id w17mr4534651eba.3.1218141526871; Thu, 07 Aug 2008 13:38:46 -0700 (PDT) Received: from 207-177-41-213.getmyip.com ( [213.41.177.207]) by mx.google.com with ESMTPS id z33sm542304ikz.0.2008.08.07.13.38.42 (version=SSLv3 cipher=RC4-MD5); Thu, 07 Aug 2008 13:38:45 -0700 (PDT) To: internals@lists.php.net Date: Thu, 7 Aug 2008 22:37:01 +0200 User-Agent: KMail/1.10.0 (Linux/2.6.26-noch; KDE/4.1.0; i686; ; ) Cc: Rasmus Lerdorf , Felipe Pena , Hannes Magnusson , Christian Stocker , Dmitry Stogov References: <4899C4B4.3060902@liip.ch> <1218138548.5346.3.camel@felipe> <489B5285.1070000@lerdorf.com> In-Reply-To: <489B5285.1070000@lerdorf.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-ID: <200808072237.01841.arnaud.lb@gmail.com> Subject: Re: [PHP-DEV] include bug in 5.3 From: arnaud.lb@gmail.com (Arnaud Le Blanc) On Thursday 07 August 2008 21:52:37 Rasmus Lerdorf wrote: > Felipe Pena wrote: > > Em Qui, 2008-08-07 =C3=A0s 20:55 +0200, Hannes Magnusson escreveu: > >> On Thu, Aug 7, 2008 at 20:20, Rasmus Lerdorf wrot= e: > >>> Christian Stocker wrote: > >>>> Hi > >>>> > >>>> Since quite some time (weeks), I have this very strange and annoying > >>>> include bug in 5.3-dev and now I think is the time to report it :) > >>>> > >>>> The reproducable script is here: > >>>> > >>>> http://trash.chregu.tv/include-bug.php.txt > > > > When trying debug it days ago, I noticed add that: > > +++ TSRM/tsrm_virtual_cwd.c 4 Jul 2008 03:05:16 -0000 > > @@ -557,9 +557,11 @@ CWD_API int virtual_file_ex(cwd_state *s > > if (use_realpath !=3D CWD_EXPAND) { > > #if !defined(TSRM_WIN32)&& !defined(NETWARE) > > char resolved_path[MAXPATHLEN]; > > + printf(">>> %s\n", path); > > if (!realpath(path, resolved_path)) { /* Note: Not > > threadsafe on older *BSD's */ > > + printf(">> 1\n"); > > if (use_realpath =3D=3D CWD_REALPATH) { > > + printf(">> 2\n"); > > > > ---------------------------------------------------------------- > > > > LINUX: > >>>> /home/felipe/php5/sapi/cli/php > >>>> /home/felipe/php5/sapi/cli/php > >>>> /home/felipe/php5/sapi/cli/php-cli.ini > >>> > >>> 1 > >>> > >>>> /usr/local/lib/php-cli.ini > >>> > >>> 1 > >>> > >>>> /home/felipe/php5/sapi/cli/php.ini > >>> > >>> 1 > >>> > >>>> /usr/local/lib/php.ini > >>>> /usr/local/lib/php.ini > >>>> /home/felipe/test/test.php > >>>> /home/felipe/./foo.php > >>> > >>> 1 > >>> 2 > >>> > >>>> /usr/local/lib/php/foo.php > >>> > >>> 1 > >>> 2 > >>> > >>>> /home/felipe/test/foo.php > > > > foo > > > > ---------------------------------- > > > > BSD: > >>>> /usr/home/felipe/php5/sapi/cli/php > >>>> /usr/home/felipe/test/test.php > >>>> /usr/home/felipe/./foo.php > > > > Warning: include(/usr/home/felipe/foo.php): failed to open stream: No > > such file or directory in /usr/home/felipe/test/test.php on line 1 > > > > Warning: include(): Failed opening 'foo.php' for inclusion > > (include_path=3D'.:/usr/local/lib/php') in /usr/home/felipe/test/test.p= hp > > on line 1 > > That's not the same thing though. Your case seems to show that it isn't > using the include_path at all. On BSD after checking ./foo.php why > doesn't it continue on to /usr/local/lib/php/foo.php? It certain does > for me here. > > -Rasmus Hi, I had searched the cause of this bug some days ago and posted what I have=20 found on http://bugs.php.net/bug.php?id=3D45044 .=20 virtual_file_ex() assumes that realpath() returns NULL when the file does n= ot=20 exists. But BSD's realpath() will not return NULL if all components *but the last* exist. So realpath(/foo/bar) will return /foo/bar= =20 even if bar does not exists. Regards, Arnaud