ext/standard/tests/file/bug24313.phpt fails after this patch.
See also http://bugs.php.net/bug.php?id=24313
On 09.04.2006 21:57, Ilia Alshanetsky wrote:
iliaa Sun Apr 9 17:57:27 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src NEWS
/php-src/ext/standard filestat.c
Log:
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.499&r2=1.2027.2.500&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.499 php-src/NEWS:1.2027.2.500
--- php-src/NEWS:1.2027.2.499 Fri Apr 7 14:20:56 2006
+++ php-src/NEWS Sun Apr 9 17:57:27 2006
@@ -29,6 +29,7 @@
- Fixed bug #36886 (User filters can leak buckets in some situations). (Ilia)
- Fixed bug #36878 (error messages are printed even though an exception has
been thrown). (Tony)
+- Fixed bug #36875 (is_*() functions do not account for open_basedir). (Ilia)
- Fixed bug #36869 (memory leak in output buffering when using chunked output).
(Tony)
- Fixed bug #36859 (DOMElement crashes when calling __construct when
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/filestat.c?r1=1.136.2.5&r2=1.136.2.6&diff_format=u
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.136.2.5
php-src/ext/standard/filestat.c:1.136.2.6
--- php-src/ext/standard/filestat.c:1.136.2.5 Mon Mar 6 20:21:52 2006
+++ php-src/ext/standard/filestat.c Sun Apr 9 17:57:27 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.136.2.5 2006/03/06 20:21:52 rrichards Exp $ */
+/* $Id: filestat.c,v 1.136.2.6 2006/04/09 17:57:27 iliaa Exp $ */
#include "php.h"
#include "safe_mode.h"
@@ -607,15 +607,22 @@
int flags = 0, rmask=S_IROTH, wmask=S_IWOTH, xmask=S_IXOTH; /* access
rights defaults to other */
char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid",
"rdev",
"size", "atime", "mtime", "ctime", "blksize",
"blocks"};
+ char *local;
+ php_stream_wrapper *wrapper;
if (!filename_length) {
RETURN_FALSE;
}
+ if ((wrapper = php_stream_locate_url_wrapper(filename, &local, 0 TSRMLS_CC)) == &php_plain_files_wrapper) {
+ if (php_check_open_basedir(local TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+ }
+
if (IS_ACCESS_CHECK(type)) {
- char *local;
+ if (wrapper == &php_plain_files_wrapper) {
- if (php_stream_locate_url_wrapper(filename, &local, 0 TSRMLS_CC) == &php_plain_files_wrapper) {
switch (type) {
#ifdef F_OK
case FS_EXISTS:
@@ -695,9 +702,6 @@
if (IS_ABLE_CHECK(type) && getuid() == 0) {
/* root has special perms on plain_wrapper
But we don't know about root under Netware */
- php_stream_wrapper *wrapper;
-
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0
TSRMLS_CC);
if (wrapper == &php_plain_files_wrapper) {
if (type == FS_IS_X) {
xmask = S_IXROOT;
--
Wbr,
Antony Dovgal
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php