]> granicus.if.org Git - php/commitdiff
- Add open_basedir check for all functions using php_stat() (filesize, stat,
authorMarkus Fischer <mfischer@php.net>
Mon, 20 May 2002 17:18:18 +0000 (17:18 +0000)
committerMarkus Fischer <mfischer@php.net>
Mon, 20 May 2002 17:18:18 +0000 (17:18 +0000)
  etc), closes #11563.

ext/standard/filestat.c

index deb6605db95c7904db8a0f2bfc24a7cc3e7a76dc..5ddb64a173240cb2bc861cb4e2be9a2e1b0e54c3 100644 (file)
@@ -553,6 +553,10 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
        char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid", "rdev",
                              "size", "atime", "mtime", "ctime", "blksize", "blocks"};
 
+       if (php_check_open_basedir(filename)) {
+               RETURN_FALSE;
+       }
+
        stat_sb = &BG(sb);
 
        if (!BG(CurrentStatFile) || strcmp(filename, BG(CurrentStatFile))) {