cvs: php4 /main php_open_temporary_file.c
| From: | Wez Furlong | Date: | Fri, 11 Apr 2003 11:08:44 +0000 |
| Subject: | cvs: php4 /main php_open_temporary_file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20233@lists.php.net to get a copy of this message | ||
wez Fri Apr 11 07:08:44 2003 EDT
Modified files:
/php4/main php_open_temporary_file.c
Log:
Fix for #23069 (Windows sets readonly mode for temporary files in tempnam)
Index: php4/main/php_open_temporary_file.c
diff -u php4/main/php_open_temporary_file.c:1.25 php4/main/php_open_temporary_file.c:1.26
--- php4/main/php_open_temporary_file.c:1.25 Tue Mar 18 11:40:29 2003
+++ php4/main/php_open_temporary_file.c Fri Apr 11 07:08:44 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_open_temporary_file.c,v 1.25 2003/03/18 16:40:29 wez Exp $ */
+/* $Id: php_open_temporary_file.c,v 1.26 2003/04/11 11:08:44 wez Exp $ */
#include "php.h"
@@ -132,7 +132,10 @@
#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 */