]> granicus.if.org Git - php/commitdiff
MFB: Fixed missing open_basedir check inside chdir() function.
authorIlia Alshanetsky <iliaa@php.net>
Wed, 4 Oct 2006 23:20:54 +0000 (23:20 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 4 Oct 2006 23:20:54 +0000 (23:20 +0000)
ext/standard/dir.c

index a8152b851c0f349c7c310bd6578bcd8105bccda9..741ff2e912b2531768d6baacb1d4f0d668f7e7eb 100644 (file)
@@ -310,7 +310,9 @@ PHP_FUNCTION(chdir)
                php_stream_path_param_encode(ppstr, &str, &str_len, REPORT_ERRORS, FG(default_context)) == FAILURE) {
                return;
        }
-
+       if (php_check_open_basedir(str TSRMLS_CC)) {
+               RETURN_FALSE;
+       }
        ret = VCWD_CHDIR(str);
        if (ret != 0) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);