]> granicus.if.org Git - php/commitdiff
Ensure that open(".", 0); works, otherwise bail out
authorSascha Schumann <sas@php.net>
Tue, 13 May 2003 18:48:01 +0000 (18:48 +0000)
committerSascha Schumann <sas@php.net>
Tue, 13 May 2003 18:48:01 +0000 (18:48 +0000)
main/main.c

index 5c4a5c6f7308a67c32d2a5de9d44d43fb1f48bad..ce0ce8a84719a31ed1a45f2977c5daa0ae5e88da 100644 (file)
@@ -1594,6 +1594,9 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
 #if HAVE_BROKEN_GETCWD
                        /* this looks nasty to me */
                        old_cwd_fd = open(".", 0);
+                       if (old_cwd_fd == -1) {
+                               zend_bailout();
+                       }
 #else
                        VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1);
 #endif