svn: /php/php-src/branches/PHP_5_3_2/ main/main.c main/php.h main/streams/plain_wrapper.c tests/security/open_basedir_parse_ini_file.phpt
| From: | Pierre Joye | Date: | Thu, 04 Feb 2010 09:21:02 +0000 |
| Subject: | svn: /php/php-src/branches/PHP_5_3_2/ main/main.c main/php.h main/streams/plain_wrapper.c tests/security/open_basedir_parse_ini_file.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-61769@lists.php.net to get a copy of this message | ||
pajoye Thu, 04 Feb 2010 09:21:02 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=294507
Log:
- [doc] #45986, bad file descriptor warning when rename is used with invalid path
Bug: http://bugs.php.net/45986 (unknown)
Changed paths:
_U php/php-src/branches/PHP_5_3_2/
_U php/php-src/branches/PHP_5_3_2/ext/tidy/tests/
U php/php-src/branches/PHP_5_3_2/main/main.c
U php/php-src/branches/PHP_5_3_2/main/php.h
U php/php-src/branches/PHP_5_3_2/main/streams/plain_wrapper.c
_U php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt
Property changes on: php/php-src/branches/PHP_5_3_2
___________________________________________________________________
Modified: svn:mergeinfo
-
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292716,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293180,293216,293235,293253,293268,293341,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293974,293985,293998,294040
/php/php-src/trunk:284726
+
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292716,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293180,293216,293235,293253,293268,293341,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293974,293985,293998,294040,294053
/php/php-src/trunk:284726
Property changes on: php/php-src/branches/PHP_5_3_2/ext/tidy/tests
___________________________________________________________________
Modified: svn:mergeinfo
-
/php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292716,292719,292765,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293985,293998,294040
/php/php-src/trunk/ext/tidy/tests:284726,287798-287941
+
/php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292716,292719,292765,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293985,293998,294040,294053
/php/php-src/trunk/ext/tidy/tests:284726,287798-287941
Modified: php/php-src/branches/PHP_5_3_2/main/main.c
===================================================================
--- php/php-src/branches/PHP_5_3_2/main/main.c 2010-02-04 09:17:20 UTC (rev 294506)
+++ php/php-src/branches/PHP_5_3_2/main/main.c 2010-02-04 09:21:02 UTC (rev 294507)
@@ -848,6 +848,27 @@
}
/* }}} */
+#ifdef PHP_WIN32
+#define PHP_WIN32_ERROR_MSG_BUFFER_SIZE 512
+PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2
TSRMLS_DC) {
+ if (error == 0) {
+ php_error_docref2(NULL TSRMLS_CC, param1, param2, E_WARNING, "%s", strerror(errno));
+ } else {
+ char buf[PHP_WIN32_ERROR_MSG_BUFFER_SIZE + 1];
+ int buf_len;
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, buf, PHP_WIN32_ERROR_MSG_BUFFER_SIZE,
NULL);
+ buf_len = strlen(buf);
+ if (buf_len >= 2) {
+ buf[buf_len - 1] = '\0';
+ buf[buf_len - 2] = '\0';
+ }
+ php_error_docref2(NULL TSRMLS_CC, param1, param2, E_WARNING, "%s (code: %lu)", (char
*)buf, error);
+ }
+}
+#undef PHP_WIN32_ERROR_MSG_BUFFER_SIZE
+#endif
+
/* {{{ php_html_puts */
PHPAPI void php_html_puts(const char *str, uint size TSRMLS_DC)
{
Modified: php/php-src/branches/PHP_5_3_2/main/php.h
===================================================================
--- php/php-src/branches/PHP_5_3_2/main/php.h 2010-02-04 09:17:20 UTC (rev 294506)
+++ php/php-src/branches/PHP_5_3_2/main/php.h 2010-02-04 09:21:02 UTC (rev 294507)
@@ -309,6 +309,8 @@
PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 4, PHP_ATTR_FMT_OFFSET + 5);
PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2,
int type, const char *format, ...)
PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 5, PHP_ATTR_FMT_OFFSET + 6);
+PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2
TSRMLS_DC);
+
END_EXTERN_C()
#define php_error_docref php_error_docref0
Modified: php/php-src/branches/PHP_5_3_2/main/streams/plain_wrapper.c
===================================================================
--- php/php-src/branches/PHP_5_3_2/main/streams/plain_wrapper.c 2010-02-04 09:17:20 UTC (rev 294506)
+++ php/php-src/branches/PHP_5_3_2/main/streams/plain_wrapper.c 2010-02-04 09:21:02 UTC (rev 294507)
@@ -1080,12 +1080,13 @@
ret = VCWD_RENAME(url_from, url_to);
if (ret == -1) {
-#ifdef EXDEV
+#ifndef PHP_WIN32
+# ifdef EXDEV
if (errno == EXDEV) {
struct stat sb;
if (php_copy_file(url_from, url_to TSRMLS_CC) == SUCCESS) {
if (VCWD_STAT(url_from, &sb) == 0) {
-#if !defined(TSRM_WIN32) && !defined(NETWARE)
+# if !defined(TSRM_WIN32) && !defined(NETWARE)
if (VCWD_CHMOD(url_to, sb.st_mode)) {
if (errno == EPERM) {
php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s",
strerror(errno));
@@ -1104,7 +1105,7 @@
php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s",
strerror(errno));
return 0;
}
-#endif
+# endif
VCWD_UNLINK(url_from);
return 1;
}
@@ -1112,8 +1113,14 @@
php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno));
return 0;
}
+# endif
#endif
+
+#ifdef PHP_WIN32
+ php_win32_docref2_from_error(GetLastError(), url_from, url_to TSRMLS_CC);
+#else
php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno));
+#endif
return 0;
}
Property changes on: php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt
___________________________________________________________________
Modified: svn:mergeinfo
-
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,292716,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293985,293998,294040
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951
+
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,292716,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293985,293998,294040,294053
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951