Browse Source

fix #39575 (move_uploaded_file() no longer working (safe mode related))

experimental/5.2-WITH_DRCP
Antony Dovgal 19 years ago
parent
commit
a7ce772222
  1. 2
      main/fopen_wrappers.c
  2. 4
      main/safe_mode.c

2
main/fopen_wrappers.c

@ -531,7 +531,7 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC)
new_state.cwd = strdup(cwd);
new_state.cwd_length = strlen(cwd);
if(virtual_file_ex(&new_state, filepath, NULL, 1)) {
if(virtual_file_ex(&new_state, filepath, NULL, CWD_FILEPATH)) {
free(new_state.cwd);
return NULL;
}

4
main/safe_mode.c

@ -55,6 +55,8 @@ PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mod
php_stream_wrapper *wrapper = NULL;
TSRMLS_FETCH();
path[0] = '\0';
if (!filename) {
return 0; /* path must be provided */
}
@ -84,7 +86,7 @@ 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) {
VCWD_REALPATH(filename, path);
expand_filepath(filename, path TSRMLS_CC);
ret = VCWD_STAT(path, &sb);
if (ret < 0) {
if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) {

Loading…
Cancel
Save