diff options
| author | sj-i <shinji.igarashi@gmail.com> | 2020-12-20 15:57:54 +0900 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-19 11:41:58 +0100 |
| commit | 5d31ee302db073d5e99cf307315d2d631eaa34a5 (patch) | |
| tree | 93324ec78f3b18b1fb9581b47854c1e6406507de /main/rfc1867.c | |
| parent | 68f5289e9e84b12b1a9ad671657702ce9a65a1e1 (diff) | |
| download | php-git-5d31ee302db073d5e99cf307315d2d631eaa34a5.tar.gz | |
Fixed bug #42560
Check open_basedir after the fallback to the system's temporary
directory in tempnam().
In order to preserve the current behavior of upload_tmp_dir
(do not check explicitly specified dir, but check fallback),
new flags are added to check open_basedir for explicit dir
and for fallback.
Closes GH-6526.
Diffstat (limited to 'main/rfc1867.c')
| -rw-r--r-- | main/rfc1867.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c index 8bdc409296..edef19c16d 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -1009,7 +1009,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ /* in non-debug mode we have no problem with 0-length files */ { #endif - fd = php_open_temporary_fd_ex(PG(upload_tmp_dir), "php", &temp_filename, 1); + fd = php_open_temporary_fd_ex(PG(upload_tmp_dir), "php", &temp_filename, PHP_TMP_FILE_OPEN_BASEDIR_CHECK_ON_FALLBACK); upload_cnt--; if (fd == -1) { sapi_module.sapi_error(E_WARNING, "File upload error - unable to create a temporary file"); |
