]> granicus.if.org Git - php/commitdiff
MF53
authorJani Taskinen <jani@php.net>
Thu, 11 Oct 2007 08:28:02 +0000 (08:28 +0000)
committerJani Taskinen <jani@php.net>
Thu, 11 Oct 2007 08:28:02 +0000 (08:28 +0000)
main/safe_mode.c

index f5e7f9e7e8b59c974adce7bebec30674cf8eae43..90bc0babe7748957edcf5551f9eb357959f060d5 100644 (file)
@@ -86,14 +86,16 @@ PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mod
         * If that fails, passthrough and check directory...
         */
        if (mode != CHECKUID_ALLOW_ONLY_DIR) {
+#if HAVE_BROKEN_GETCWD
+               char ftest[MAXPATHLEN];
 
-                char ftest[MAXPATHLEN];
-                strcpy(ftest,filename);
-                if (VCWD_GETCWD(ftest, sizeof(ftest)) == NULL) {
-                        strcpy(path,filename);
-                } else {
-                        expand_filepath(filename, path TSRMLS_CC);
-                        }
+               strcpy(ftest,filename);
+               if (VCWD_GETCWD(ftest, sizeof(ftest)) == NULL) {
+                       strcpy(path,filename);
+               } else {
+                       expand_filepath(filename, path TSRMLS_CC);
+               }
+#endif
 
                ret = VCWD_STAT(path, &sb);
                if (ret < 0) {