#32501 [Opn->Fbk]: acinclude.m4 should set HAVE_BROKEN_GETCWD for AIX, too
| From: | tony2001@php.net | Date: | Mon, 04 Apr 2005 11:48:50 +0000 |
| Subject: | #32501 [Opn->Fbk]: acinclude.m4 should set HAVE_BROKEN_GETCWD for AIX, too | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76294@lists.php.net to get a copy of this message | ||
ID: 32501
Updated by: tony2001@php.net
Reported By: Bjorn dot Wiberg at its dot uu dot se
-Status: Open
+Status: Feedback
Bug Type: Directory function related
Operating System: IBM AIX 5.2.0.0 ML5
PHP Version: 5CVS-2005-03-31
New Comment:
I can't reproduce it on AIX 5.3 & 5.1.
Please, make sure that you're editing the right php.ini and provide
more info about it.
Previous Comments:
------------------------------------------------------------------------
[2005-04-01 16:34:06] Bjorn dot Wiberg at its dot uu dot se
Tried php5-200503310630 (5.1.0-dev), but the problem is still present:
Warning: fopen(): open_basedir restriction in effect. File(a.txt) is
not within the allowed path(s):
(.:/apache/php/lib/php/:/apache/htdocs/bwiberg/) in
/apache/htdocs/bwiberg/test/safemode/testopen.php on line 3 Warning:
fopen(a.txt): failed to open stream: Not owner in
/apache/htdocs/bwiberg/test/safemode/testopen.php on line 3
(It appears that acinclude.m4 hasn't changed at all in this regard, so
this was probably expected?)
Best regards,
Björn
------------------------------------------------------------------------
[2005-03-30 17:19:05] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-03-30 14:11:41] Bjorn dot Wiberg at its dot uu dot se
Description:
------------
As noted in other bug reports (PHP bug #24185), and the documentation
(http://www.php.net/manual/en/function.getcwd.php), getcwd() may fail
if some directory along a path doesn't have list (r) permissions, but
only access (x) permissions.
In acinclude.m4, the check for broken getcwd() checks the OS string to
determine whether HAVE_BROKEN_GETCWD should be set or not.
Currently, this check only detects (and sets HAVE_BROKEN_GETCWD) if the
OS is "SunOS". This should probably be changed to include "AIX", too:
root@spinus:/# uname -sr
AIX 2
...as the problem seems to be present on AIX.
Reproduce code:
---------------
<?php
$handle = fopen("./a.txt", "w", false);
if ( $handle ) {
fputs($handle, "testtext");
fclose($handle);
}
?>
Expected result:
----------------
No error message, file gets created.
Actual result:
--------------
Because fopen() + open_basedir seems to rely on getcwd() to check the
path to the file, we get the following error:
Warning: fopen(): open_basedir restriction in effect. File(./a.txt) is
not within the allowed path(s):
(.:/apache/php/lib/php/:/apache/htdocs/bwiberg/) in
/apache/htdocs/bwiberg/test/safemode/write.php on line 3 Warning:
fopen(./a.txt): failed to open stream: Not owner in
/apache/htdocs/bwiberg/test/safemode/write.php on line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32501&edit=1