From: Jani Taskinen Date: Thu, 11 Oct 2007 08:28:02 +0000 (+0000) Subject: MF53 X-Git-Tag: php-5.2.5RC1~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3c9eb61d04001fef317f098972c591ae65712b36;p=php MF53 --- diff --git a/main/safe_mode.c b/main/safe_mode.c index f5e7f9e7e8..90bc0babe7 100644 --- a/main/safe_mode.c +++ b/main/safe_mode.c @@ -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) {