]> granicus.if.org Git - php/commitdiff
*** empty log message ***
authorIlia Alshanetsky <iliaa@php.net>
Sun, 9 Apr 2006 17:57:27 +0000 (17:57 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 9 Apr 2006 17:57:27 +0000 (17:57 +0000)
NEWS
ext/standard/filestat.c

diff --git a/NEWS b/NEWS
index 4b8bd2a30e8b907d60ed4f3938e15d3474437940..5481c52a66ba0d12bab64dd16d81c35c3a8fbe4f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ PHP                                                                        NEWS
 - 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 
index dde2998383b92cf2ba54b002eea88d348406264a..93945e00b424894948dd87c19b4e268395e93a42 100644 (file)
@@ -607,15 +607,22 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
        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 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
        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;