Re: [PHP-DEV] include bug in 5.3

2008-08-12 Thread Hannes Magnusson
On Mon, Aug 11, 2008 at 23:41, Greg Beaver [EMAIL PROTECTED] wrote: Dmitry Stogov wrote: This behavior is already implemented in improved patch that I sent on Saturday. Thanks. Dmitry. [snip] What I mean is: fopen(this_is_not_a_dir_but_a_file/../../../../../../../../etc/passwd, r);

Re: [PHP-DEV] include bug in 5.3

2008-08-12 Thread Rasmus Lerdorf
Does this change affect code like: include ../file.php; That will work fine. I was thinking along the same line. I bet some people have been lazy and used __FILE__. /../../foobar.php. That will not work. And that is moronic code anyway. Why wouldn't they use __DIR__ there? -Rasmus --

Re: [PHP-DEV] include bug in 5.3

2008-08-12 Thread Dmitry Stogov
__FILE__. /../../foobar.php probably could work on Windows/BSD only, but won't work anymore. The patch is committed. Thanks. Dmitry. Rasmus Lerdorf wrote: Does this change affect code like: include ../file.php; That will work fine. I was thinking along the same line. I bet some people

Re: [PHP-DEV] include bug in 5.3

2008-08-12 Thread Stefan Esser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Dmitry, __FILE__. /../../foobar.php probably could work on Windows/BSD only, but won't work anymore. this works on Linux and everywhere where GLIBC is used, because GLIBC realpath() supports this nonsense. Stefan -BEGIN PGP SIGNATURE-

Re: [PHP-DEV] include bug in 5.3

2008-08-12 Thread Dmitry Stogov
realpath(__FILE__ . /..) doesn't work (returns false) on php-5.2 Linux, however include(__FILE__ . /../some.php) worked with 5.2. Thanks. Dmitry. Stefan Esser wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Dmitry, __FILE__. /../../foobar.php probably could work on Windows/BSD

Re: [PHP-DEV] include bug in 5.3

2008-08-12 Thread Hannes Magnusson
On Tue, Aug 12, 2008 at 09:56, Rasmus Lerdorf [EMAIL PROTECTED] wrote: I was thinking along the same line. I bet some people have been lazy and used __FILE__. /../../foobar.php. That will not work. And that is moronic code anyway. Why wouldn't they use __DIR__ there? Because it didn't

Re: [PHP-DEV] include bug in 5.3

2008-08-11 Thread Dmitry Stogov
This test failure is expected, but only this one. Thanks. Dmitry. Antony Dovgal wrote: On 09.08.2008 19:28, Dmitry Stogov wrote: The improved patch fixes all the issues I found during testing. However I wasn't able to test it on NETWARE and on Solaris with relative paths. Please test it as

Re: [PHP-DEV] include bug in 5.3

2008-08-11 Thread Dmitry Stogov
This behavior is already implemented in improved patch that I sent on Saturday. Thanks. Dmitry. Rasmus Lerdorf wrote: Stefan Esser wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Dmitry, while you are at fixing realpath() it might be a good idea to fix the ../ nonsense. What I

Re: [PHP-DEV] include bug in 5.3

2008-08-11 Thread Dmitry Stogov
Hi Pierre, Thank you for feedback. You are definitely right about FindClose(). The failure of realpath_basic-win32.phpt is expected, as behavior of realpath() became the same as on Linux (slashes after regular file name are not allowed). I wasn't able to reproduce realpath_basic2.phpt failure

Re: [PHP-DEV] include bug in 5.3

2008-08-11 Thread Lukas Kahwe Smith
On 11.08.2008, at 09:31, Dmitry Stogov wrote: The failure of realpath_basic-win32.phpt is expected, as behavior of realpath() became the same as on Linux (slashes after regular file name are not allowed). Lets make extra sure that when you commit these kinds of platform unifications,

Re: [PHP-DEV] include bug in 5.3

2008-08-11 Thread Greg Beaver
Dmitry Stogov wrote: This behavior is already implemented in improved patch that I sent on Saturday. Thanks. Dmitry. [snip] What I mean is: fopen(this_is_not_a_dir_but_a_file/../../../../../../../../etc/passwd, r); works because of realpath() and PHP's wrapper. [snip] Does this change

Re: [PHP-DEV] include bug in 5.3

2008-08-10 Thread Arnaud Le Blanc
On Saturday 09 August 2008 23:16:30 Antony Dovgal wrote: On 09.08.2008 19:28, Dmitry Stogov wrote: The improved patch fixes all the issues I found during testing. However I wasn't able to test it on NETWARE and on Solaris with relative paths. Please test it as much as possible. I'm

Re: [PHP-DEV] include bug in 5.3

2008-08-10 Thread Nicolas Chaillan
Pierre Joye [EMAIL PROTECTED] a écrit dans le message de groupe de discussion : [EMAIL PROTECTED] hi all! Hello all, On Sat, Aug 9, 2008 at 12:41 PM, Hannes Magnusson [EMAIL PROTECTED] wrote: On Sat, Aug 9, 2008 at 12:31, Dmitry Stogov [EMAIL PROTECTED] wrote: Where is it documented?

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Christian Stocker
Hi Dmitry On 8.8.2008 17:52 Uhr, Dmitry Stogov wrote: Hi, The attached patch is going to fix the problem. Works also on my OS X 10.4 box now. Thanks a lot for the effort (and if it brings a performance boost, even better :) ) chregu It implements its own realpath() function, so we

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Hannes Magnusson
On Fri, Aug 8, 2008 at 17:52, Dmitry Stogov [EMAIL PROTECTED] wrote: Hi, The attached patch is going to fix the problem. It implements its own realpath() function, so we won't depend on system anymore. It also improve realpath cache usage by caching intermediate results. I tested it on

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Dmitry Stogov
Where is it documented? The realpath() implementation conforming to 4.4BSD and POSIX.1-2001 requires file existence. With the patch it'll work in the same standard way on all systems. Thanks. Dmitry. Hannes Magnusson wrote: On Fri, Aug 8, 2008 at 17:52, Dmitry Stogov [EMAIL PROTECTED]

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Hannes Magnusson
On Sat, Aug 9, 2008 at 12:31, Dmitry Stogov [EMAIL PROTECTED] wrote: Where is it documented? http://php.net/realpath http://www.ipnom.com/FreeBSD-Man-Pages/realpath.3.html -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Pierre Joye
hi all! On Sat, Aug 9, 2008 at 12:41 PM, Hannes Magnusson [EMAIL PROTECTED] wrote: On Sat, Aug 9, 2008 at 12:31, Dmitry Stogov [EMAIL PROTECTED] wrote: Where is it documented? http://php.net/realpath http://www.ipnom.com/FreeBSD-Man-Pages/realpath.3.html On BSD systems realpath() doesn't

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Stefan Esser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Dmitry, while you are at fixing realpath() it might be a good idea to fix the ../ nonsense. What I mean is: fopen(this_is_not_a_dir_but_a_file/../../../../../../../../etc/passwd, r); works because of realpath() and PHP's wrapper. Same for

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Dmitry Stogov
The improved patch fixes all the issues I found during testing. However I wasn't able to test it on NETWARE and on Solaris with relative paths. Please test it as much as possible. I'm going to commit it on Tuesday in case of no objections. Thanks. Dmitry. Rasmus Lerdorf wrote: Rasmus

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Pierre Joye
hi Dmitry, On Sat, Aug 9, 2008 at 5:28 PM, Dmitry Stogov [EMAIL PROTECTED] wrote: The improved patch fixes all the issues I found during testing. However I wasn't able to test it on NETWARE and on Solaris with relative paths. Please test it as much as possible. I run the test suite and the

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Antony Dovgal
On 09.08.2008 19:28, Dmitry Stogov wrote: The improved patch fixes all the issues I found during testing. However I wasn't able to test it on NETWARE and on Solaris with relative paths. Please test it as much as possible. I'm going to commit it on Tuesday in case of no objections.

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Antony Dovgal
On 09.08.2008 19:28, Dmitry Stogov wrote: The improved patch fixes all the issues I found during testing. However I wasn't able to test it on NETWARE and on Solaris with relative paths. Please test it as much as possible. I'm going to commit it on Tuesday in case of no objections. These

Re: [PHP-DEV] include bug in 5.3

2008-08-09 Thread Rasmus Lerdorf
Stefan Esser wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Dmitry, while you are at fixing realpath() it might be a good idea to fix the ../ nonsense. What I mean is: fopen(this_is_not_a_dir_but_a_file/../../../../../../../../etc/passwd, r); works because of realpath() and

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Hannes Magnusson
On Thu, Aug 7, 2008 at 22:37, Arnaud Le Blanc [EMAIL PROTECTED] wrote: virtual_file_ex() assumes that realpath() returns NULL when the file does not exists. But BSD's realpath() will not return NULL if all components *but the last* exist. So realpath(/foo/bar) will return /foo/bar even if bar

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Dmitry Stogov
Hi, The attached patch is going to fix the problem. It implements its own realpath() function, so we won't depend on system anymore. It also improve realpath cache usage by caching intermediate results. I tested it on Linux and Windows only and it seems to work without problems. It breaks one

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Pierre Joye
Hi Dmitry, On Fri, Aug 8, 2008 at 5:52 PM, Dmitry Stogov [EMAIL PROTECTED] wrote: Hi, The attached patch is going to fix the problem. It implements its own realpath() function, so we won't depend on system anymore. It also improve realpath cache usage by caching intermediate results. I

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Dmitry Stogov
Hi Pierre, Thank you for feedback. I already noticed the missing FindClose() and several other issues. I'll send updated patch on weekend, but the sooner I get info if bug is fixed on FreeBSD the better. Thanks. Dmitry. Pierre Joye wrote: Hi Dmitry, On Fri, Aug 8, 2008 at 5:52 PM, Dmitry

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Arnaud Le Blanc
Hi, On Friday 08 August 2008 17:52:26 Dmitry Stogov wrote: Hi, The attached patch is going to fix the problem. It implements its own realpath() function, so we won't depend on system anymore. It also improve realpath cache usage by caching intermediate results. I tested it on Linux and

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Dmitry Stogov
Great! :) It's mean I'm on the right way. The patch still needs additional work and testing, but I hope it'll be ready before alpha 2. Thanks. Dmitry. Arnaud Le Blanc wrote: Hi, On Friday 08 August 2008 17:52:26 Dmitry Stogov wrote: Hi, The attached patch is going to fix the problem. It

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Jani Taskinen
Just semantics but I'd name the function 'tsrm_realpath[_r]' to be absolutely clear what it does. --Jani Dmitry Stogov kirjoitti: Hi, The attached patch is going to fix the problem. It implements its own realpath() function, so we won't depend on system anymore. It also improve realpath

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Rasmus Lerdorf
Dmitry Stogov wrote: Hi, The attached patch is going to fix the problem. It implements its own realpath() function, so we won't depend on system anymore. It also improve realpath cache usage by caching intermediate results. Very nice. The intermediate caching is going to drastically reduce

Re: [PHP-DEV] include bug in 5.3

2008-08-08 Thread Rasmus Lerdorf
Rasmus Lerdorf wrote: Dmitry Stogov wrote: Hi, The attached patch is going to fix the problem. It implements its own realpath() function, so we won't depend on system anymore. It also improve realpath cache usage by caching intermediate results. Very nice. The intermediate caching is going

Re: [PHP-DEV] include bug in 5.3

2008-08-07 Thread Hannes Magnusson
On Thu, Aug 7, 2008 at 03:18, Christian Stocker [EMAIL PROTECTED] wrote: According to http://bugs.php.net/bug.php?id=45044 I'm not the only one with that problem and it really introduces a lot of issues. You are not the onlyone. I'm pretty sure I mailed about this to internals@ few weeks ago

Re: [PHP-DEV] include bug in 5.3

2008-08-07 Thread Rasmus Lerdorf
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 In short, when I have foo/alpha (empty)

Re: [PHP-DEV] include bug in 5.3

2008-08-07 Thread Hannes Magnusson
On Thu, Aug 7, 2008 at 20:20, Rasmus Lerdorf [EMAIL PROTECTED] wrote: 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:

Re: [PHP-DEV] include bug in 5.3

2008-08-07 Thread Felipe Pena
Em Qui, 2008-08-07 às 20:55 +0200, Hannes Magnusson escreveu: On Thu, Aug 7, 2008 at 20:20, Rasmus Lerdorf [EMAIL PROTECTED] wrote: 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

Re: [PHP-DEV] include bug in 5.3

2008-08-07 Thread Rasmus Lerdorf
Felipe Pena wrote: Em Qui, 2008-08-07 às 20:55 +0200, Hannes Magnusson escreveu: On Thu, Aug 7, 2008 at 20:20, Rasmus Lerdorf[EMAIL PROTECTED] wrote: 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

Re: [PHP-DEV] include bug in 5.3

2008-08-07 Thread Arnaud Le Blanc
On Thursday 07 August 2008 21:52:37 Rasmus Lerdorf wrote: Felipe Pena wrote: Em Qui, 2008-08-07 às 20:55 +0200, Hannes Magnusson escreveu: On Thu, Aug 7, 2008 at 20:20, Rasmus Lerdorf[EMAIL PROTECTED] wrote: Christian Stocker wrote: Hi Since quite some time (weeks), I have this very

[PHP-DEV] include bug in 5.3

2008-08-06 Thread Christian Stocker
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 In short, when I have foo/alpha (empty) bar/alpha/bar.php and set the

Re: [PHP-DEV] include bug in 5.3

2008-08-06 Thread Stanislav Malyshev
Hi! and set the include path to foo/:bar/ and then do include(alpha/bar.php); it throws an not-found error. Tried that, worked just fine for me - includes bar/alpha/bar.php. I notice your script on the link does something different, but works for me too with 5.3 CVS. -- Stanislav Malyshev,

Re: [PHP-DEV] include bug in 5.3

2008-08-06 Thread Christian Stocker
On 7.8.2008 3:03 Uhr, Stanislav Malyshev wrote: Hi! and set the include path to foo/:bar/ and then do include(alpha/bar.php); it throws an not-found error. Tried that, worked just fine for me - includes bar/alpha/bar.php. I notice your script on the link does something different, but