From e1a54c8d10f33f41ffd997e579900111b6aefe13 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 11 Apr 2003 11:10:39 +0000 Subject: [PATCH] MFH: Fix for Bug #23069 --- main/php_open_temporary_file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index 84c8fc0c8d..59cde21421 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -134,7 +134,10 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, char ** #ifdef PHP_WIN32 if (GetTempFileName(path, pfx, 0, opened_path)) { - fd = VCWD_OPEN(opened_path, open_flags); + /* Some versions of windows set the temp file to be read-only, + * which means that opening it will fail... */ + VCWD_CHMOD(opened_path, 0600); + fd = VCWD_OPEN_MODE(opened_path, open_flags, 0600); } #elif defined(NETWARE) /* Using standard mktemp() implementation for NetWare */ -- 2.40.0