#40326 [Fbk->Opn]: Can't open file from cwd if parent folder not readable
| From: | sborrill at precedence dot co dot uk | Date: | Sat, 10 Feb 2007 19:25:29 +0000 |
| Subject: | #40326 [Fbk->Opn]: Can't open file from cwd if parent folder not readable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108678@lists.php.net to get a copy of this message | ||
ID: 40326
User updated by: sborrill at precedence dot co dot uk
Reported By: sborrill at precedence dot co dot uk
-Status: Feedback
+Status: Open
Bug Type: Streams related
Operating System: NetBSD 3.1_STABLE
PHP Version: 5.2.0
New Comment:
Yes, as per my original bug report, it is not fixed in the daily
snapshots. I've confirmed it today's too.
I can recreate it with the cli php binary too (i.e. I don't have to
test it from Apache).
Previous Comments:
------------------------------------------------------------------------
[2007-02-05 13:51:27] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2007-02-05 13:45:38] sborrill at precedence dot co dot uk
OK, permissions are nearly the same (except in our case, it's the
parent of the www directory that is -r not the www itself, but that's
probably unimportant).
The getcwd() line shows a difference though. On NetBSD and other Unix
OSes (all except for Linux?) getcwd() returns FALSE as noted in
http://bugs.php.net/bug.php?id=24185
Perhaps the reason it's working for you on Linux is because your
getcwd() _isn't_ returning FALSE and there's now an extra getcwd() call
in the fopen codepath. N.B. as in my original report, with PHP 5.1.6,
getcwd() returned FALSE, but fopen worked nonetheless.
Also, the patches to PHP in the NetBSD package are the same between
5.1.6 and 5.2.0 (or if they differ it's in an unrelated section). The
patches related to php.ini, configure, curl and imap/c-client only.
Everything else is stock:
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/php5/patches/
------------------------------------------------------------------------
[2007-02-05 09:40:56] tony2001@php.net
>What OS?
Linux
>Are you sure you've checked file ownership?
#ls -ld /www
d--x--x--x 15 tony users 2864 Feb 5 12:36 /www
#ls -l /www/index.php
-rw-r--r-- 1 tony users 110 Feb 5 12:36 /www/index.php
Apache runs as user "wwwrun".
>What do you get on the getcwd() lines?
string(4) "/www"
Please try the latest snapshot from http://snaps.php.net if
you're
using some patches/adopted version.
------------------------------------------------------------------------
[2007-02-03 09:32:00] sborrill at precedence dot co dot uk
What OS? Are you sure you've checked file ownership? What do you get on
the getcwd() lines?
We are finding this is 100% reproducible on all our customers' servers
when they are using php in a UserDir.
I've checked the package definition and patches at:
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/php5/
Nothing relevant has been altered betweeen 5.1.6 and 5.2.0 in the
NetBSD pkg.
php.ini file remains the same throughout. We aren't using safe mode or
open_basedir. I looked at the CVS log for fopen_wrapper.c but didn't
spot anything relevant. I'm not familiar enough with PHP internals to
know where to add much debugging, but I'm happy to follow any
suggestions.
------------------------------------------------------------------------
[2007-02-02 18:44:36] tony2001@php.net
Cannot reproduce.
Both PHP 5.2-CVS and PHP 6-CVS work just fine with Apache 1.x.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/40326
--
Edit this bug report at http://bugs.php.net/?id=40326&edit=1