[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/tests/php_cli_server_006.phpt trunk/sapi/cli/tests/php_cli_server_006.phpt
laruence Thu, 22 Sep 2011 02:26:00 + Revision: http://svn.php.net/viewvc?view=revision&revision=317134 Log: Add tests for bug #55755 Bug: https://bugs.php.net/55755 (Closed) SegFault when outputting header WWW-Authenticate Changed paths: A php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_006.phpt A php/php-src/trunk/sapi/cli/tests/php_cli_server_006.phpt Added: php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_006.phpt === --- php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_006.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_006.phpt 2011-09-22 02:26:00 UTC (rev 317134) @@ -0,0 +1,45 @@ +--TEST-- +Bug #55755 (SegFault when outputting header WWW-Authenticate) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: closed +X-Powered-By: PHP/%s-dev +Content-type: text/html + +string(3) "foo" +string(3) "bar" Added: php/php-src/trunk/sapi/cli/tests/php_cli_server_006.phpt === --- php/php-src/trunk/sapi/cli/tests/php_cli_server_006.phpt (rev 0) +++ php/php-src/trunk/sapi/cli/tests/php_cli_server_006.phpt2011-09-22 02:26:00 UTC (rev 317134) @@ -0,0 +1,45 @@ +--TEST-- +Bug #55755 (SegFault when outputting header WWW-Authenticate) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: closed +X-Powered-By: PHP/%s-dev +Content-type: text/html + +string(3) "foo" +string(3) "bar" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
iliaaWed, 21 Sep 2011 19:08:30 + Revision: http://svn.php.net/viewvc?view=revision&revision=317119 Log: Removed unreachable code (stream == NULL check is done already) Changed paths: U php/php-src/branches/PHP_5_4/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_4/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_4/ext/zip/php_zip.c 2011-09-21 19:05:21 UTC (rev 317118) +++ php/php-src/branches/PHP_5_4/ext/zip/php_zip.c 2011-09-21 19:08:30 UTC (rev 317119) @@ -272,14 +272,6 @@ } n = 0; - if (stream == NULL) { - int ret = zip_fclose(zf); - efree(fullpath); - efree(file_basename); - efree(file_dirname_fullpath); - free(new_state.cwd); - return 0; - } while ((n=zip_fread(zf, b, sizeof(b))) > 0) { php_stream_write(stream, b, n); Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2011-09-21 19:05:21 UTC (rev 317118) +++ php/php-src/trunk/ext/zip/php_zip.c 2011-09-21 19:08:30 UTC (rev 317119) @@ -272,14 +272,6 @@ } n = 0; - if (stream == NULL) { - int ret = zip_fclose(zf); - efree(fullpath); - efree(file_basename); - efree(file_dirname_fullpath); - free(new_state.cwd); - return 0; - } while ((n=zip_fread(zf, b, sizeof(b))) > 0) { php_stream_write(stream, b, n); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c
laruence Wed, 21 Sep 2011 16:00:09 + Revision: http://svn.php.net/viewvc?view=revision&revision=317111 Log: Fixed bug #55755 (SegFault when outputting header WWW-Authenticate) Bug: https://bugs.php.net/55755 (Closed) SegFault when outputting header WWW-Authenticate Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c U php/php-src/trunk/sapi/cli/php_cli_server.c Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-09-21 15:14:07 UTC (rev 317110) +++ php/php-src/branches/PHP_5_4/NEWS 2011-09-21 16:00:09 UTC (rev 317111) @@ -15,6 +15,7 @@ . Fixed bug #55726 (Changing the working directory makes router script inaccessible). (Laruence) . Fixed bug #55747 (request headers missed in $_SERVER). (Laruence) + . Fixed bug #55755 (SegFault when outputting header WWW-Authenticate). (Laruence) 15 Sep 2011, PHP 5.4.0 Beta - General improvements: Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c === --- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c 2011-09-21 15:14:07 UTC (rev 317110) +++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c 2011-09-21 16:00:09 UTC (rev 317111) @@ -1583,6 +1583,7 @@ request_info->query_string = client->request.query_string; request_info->post_data = client->request.content; request_info->content_length = request_info->post_data_length = client->request.content_len; + request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL; if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) { request_info->content_type = *val; } @@ -1764,9 +1765,9 @@ { php_cli_server_client_populate_request_info(client, &SG(request_info)); { - zval **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&val)) { - php_handle_auth_data(Z_STRVAL_PP(val) TSRMLS_CC); + char **auth; + if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { + php_handle_auth_data(*auth TSRMLS_CC); } } SG(sapi_headers).http_response_code = 200; @@ -1867,9 +1868,9 @@ php_cli_server_client_populate_request_info(client, &SG(request_info)); { - zval **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&val)) { - php_handle_auth_data(Z_STRVAL_PP(val) TSRMLS_CC); + char **auth; + if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { + php_handle_auth_data(*auth TSRMLS_CC); } } SG(sapi_headers).http_response_code = 200; Modified: php/php-src/trunk/sapi/cli/php_cli_server.c === --- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-09-21 15:14:07 UTC (rev 317110) +++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-09-21 16:00:09 UTC (rev 317111) @@ -1583,6 +1583,7 @@ request_info->query_string = client->request.query_string; request_info->post_data = client->request.content; request_info->content_length = request_info->post_data_length = client->request.content_len; + request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL; if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) { request_info->content_type = *val; } @@ -1764,9 +1765,9 @@ { php_cli_server_client_populate_request_info(client, &SG(request_info)); { - zval **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&val)) { - php_handle_auth_data(Z_STRVAL_PP(val) TSRMLS_CC); + char **auth; + if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { + php_handle_auth_data(*auth TSRMLS_CC); } } SG(sapi_headers).http_response_code = 200; @@ -1867,9 +1868,9 @@ php_cli_server_client_populate_request_info(client, &SG(request_info)); { - zval **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (v
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/sapi/cli/php_cli_server.c branches/PHP_5_4/sapi/cli/tests/php_cli_server_004.phpt trunk/sapi/cli/php_cli_server.c trunk/sapi/cli
Hello, laruence, could you also take a look here: http://tools.ietf.org/html/draft-robinson-www-interface-00 (see chapter 5. Environment variables) and add them too? Thank you. 2011/9/21 Xinchen Hui : > laruence Wed, 21 Sep 2011 03:09:42 + > > Revision: http://svn.php.net/viewvc?view=revision&revision=317074 > > Log: > Fixed bug #55747 (request headers missed in $_SERVER) > > Bug: https://bugs.php.net/55747 (Open) request headers missed in $_SERVER > > Changed paths: > U php/php-src/branches/PHP_5_4/NEWS > U php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c > A php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_004.phpt > U php/php-src/trunk/sapi/cli/php_cli_server.c > U php/php-src/trunk/sapi/cli/tests/php_cli_server.inc > A php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Regards, Shein Alexey -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/mysqli/mysqli.c trunk/ext/mysqli/mysqli.c
johannes Wed, 21 Sep 2011 12:34:15 + Revision: http://svn.php.net/viewvc?view=revision&revision=317096 Log: - Use the proper variable here. Changed paths: U php/php-src/branches/PHP_5_4/ext/mysqli/mysqli.c U php/php-src/trunk/ext/mysqli/mysqli.c Modified: php/php-src/branches/PHP_5_4/ext/mysqli/mysqli.c === --- php/php-src/branches/PHP_5_4/ext/mysqli/mysqli.c2011-09-21 12:10:39 UTC (rev 317095) +++ php/php-src/branches/PHP_5_4/ext/mysqli/mysqli.c2011-09-21 12:34:15 UTC (rev 317096) @@ -539,7 +539,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name); return NULL; } - mysql = ((MY_MYSQL *)my_res->ptr)->mysql; + mysql = (MY_MYSQL *)(my_res->ptr); return mysql ? mysql->mysql : NULL; } return NULL; Modified: php/php-src/trunk/ext/mysqli/mysqli.c === --- php/php-src/trunk/ext/mysqli/mysqli.c 2011-09-21 12:10:39 UTC (rev 317095) +++ php/php-src/trunk/ext/mysqli/mysqli.c 2011-09-21 12:34:15 UTC (rev 317096) @@ -539,7 +539,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name); return NULL; } - mysql = ((MY_MYSQL *)my_res->ptr)->mysql; + mysql = (MY_MYSQL *)(my_res->ptr); return mysql ? mysql->mysql : NULL; } return NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/tests/php_cli_server_004.phpt branches/PHP_5_4/sapi/cli/tests/php_cli_server_005.phpt trunk/sapi/cli/tests/php_cli_server_004.phpt trunk/sapi/cli
laruence Wed, 21 Sep 2011 07:51:31 + Revision: http://svn.php.net/viewvc?view=revision&revision=317079 Log: change test, and added a test for post file Changed paths: U php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_004.phpt A php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_005.phpt U php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt A php/php-src/trunk/sapi/cli/tests/php_cli_server_005.phpt Modified: php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_004.phpt === --- php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_004.phpt 2011-09-21 06:59:47 UTC (rev 317078) +++ php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_004.phpt 2011-09-21 07:51:31 UTC (rev 317079) @@ -27,6 +27,7 @@ Host:{$host} User-Agent:dummy Custom:foo +Referer:http://www.php.net/ HEADER @@ -41,9 +42,10 @@ HTTP/1.1 200 OK Host: %s Connection: closed -X-Powered-By: PHP/5.5.0-dev +X-Powered-By: PHP/%s-dev Content-type: text/html string(19) "HTTP_HOST:localhost" string(21) "HTTP_USER_AGENT:dummy" string(15) "HTTP_CUSTOM:foo" +string(32) "HTTP_REFERER:http://www.php.net/"; Added: php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_005.phpt === --- php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_005.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_005.phpt 2011-09-21 07:51:31 UTC (rev 317079) @@ -0,0 +1,74 @@ +--TEST-- +Post a file +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: closed +X-Powered-By: PHP/%s-dev +Content-type: text/html + +array(1) { + ["userfile"]=> + array(5) { +["name"]=> +string(12) "laruence.txt" +["type"]=> +string(10) "text/plain" +["tmp_name"]=> +string(%d) "%s" +["error"]=> +int(0) +["size"]=> +int(26) + } +} Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt === --- php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt2011-09-21 06:59:47 UTC (rev 317078) +++ php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt2011-09-21 07:51:31 UTC (rev 317079) @@ -27,6 +27,7 @@ Host:{$host} User-Agent:dummy Custom:foo +Referer:http://www.php.net/ HEADER @@ -41,9 +42,10 @@ HTTP/1.1 200 OK Host: %s Connection: closed -X-Powered-By: PHP/5.5.0-dev +X-Powered-By: PHP/%s-dev Content-type: text/html string(19) "HTTP_HOST:localhost" string(21) "HTTP_USER_AGENT:dummy" string(15) "HTTP_CUSTOM:foo" +string(32) "HTTP_REFERER:http://www.php.net/"; Added: php/php-src/trunk/sapi/cli/tests/php_cli_server_005.phpt === --- php/php-src/trunk/sapi/cli/tests/php_cli_server_005.phpt (rev 0) +++ php/php-src/trunk/sapi/cli/tests/php_cli_server_005.phpt2011-09-21 07:51:31 UTC (rev 317079) @@ -0,0 +1,74 @@ +--TEST-- +Post a file +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: closed +X-Powered-By: PHP/%s-dev +Content-type: text/html + +array(1) { + ["userfile"]=> + array(5) { +["name"]=> +string(12) "laruence.txt" +["type"]=> +string(10) "text/plain" +["tmp_name"]=> +string(%d) "%s" +["error"]=> +int(0) +["size"]=> +int(26) + } +} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c
Hi: okey, in this case , I will remove it . thanks 2011/9/21 Pierre Joye : > VCWD_GETCWD is sufficient. > > On Wed, Sep 21, 2011 at 1:49 AM, Moriyoshi Koizumi wrote: >> Hi, >> >> Where does HAVE_BROKEN_GETCWD come from? Isn't simply using VCWD_GETCWD >> sufficient? >> >> Moriyoshi >> >> On 2011/09/20, at 16:06, Xinchen Hui wrote: >> >>> laruence Tue, 20 Sep 2011 07:06:55 + >>> >>> Revision: http://svn.php.net/viewvc?view=revision&revision=317040 >>> >>> Log: >>> Fix Bug #55726 (Changing the working directory makes router script >>> inaccessible) >>> >>> Bug: https://bugs.php.net/55726 (Assigned) Changing the working directory >>> makes router script inaccessible >>> >>> Changed paths: >>> U php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c >>> U php/php-src/trunk/sapi/cli/php_cli_server.c >>> >>> Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c >>> === >>> --- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c 2011-09-20 >>> 05:42:36 UTC (rev 317039) >>> +++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c 2011-09-20 >>> 07:06:55 UTC (rev 317040) >>> @@ -1877,11 +1877,24 @@ >>> } >>> { >>> zend_file_handle zfd; >>> +#if HAVE_BROKEN_GETCWD >>> + int old_cwd_fd = -1; >>> + old_cwd_fd = open(".", 0); >>> +#else >>> + char *old_cwd; >>> + ALLOCA_FLAG(use_heap) >>> +#define OLD_CWD_SIZE 4096 >>> + old_cwd = do_alloca(OLD_CWD_SIZE, use_heap); >>> + old_cwd[0] = '\0'; >>> + php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1)); >>> +#endif >>> + >>> zfd.type = ZEND_HANDLE_FILENAME; >>> zfd.filename = server->router; >>> zfd.handle.fp = NULL; >>> zfd.free_filename = 0; >>> zfd.opened_path = NULL; >>> + >>> zend_try { >>> zval *retval = NULL; >>> if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE >>> TSRMLS_CC, &retval, 1, &zfd)) { >>> @@ -1893,6 +1906,18 @@ >>> decline = 1; >>> } >>> } zend_end_try(); >>> + >>> +#if HAVE_BROKEN_GETCWD >>> + if (old_cwd_fd != -1) { >>> + fchdir(old_cwd_fd); >>> + close(old_cwd_fd); >>> + } >>> +#else >>> + if (old_cwd[0] != '\0') { >>> + php_ignore_value(VCWD_CHDIR(old_cwd)); >>> + } >>> + free_alloca(old_cwd, use_heap); >>> +#endif >>> } >>> >>> if (decline) { >>> >>> Modified: php/php-src/trunk/sapi/cli/php_cli_server.c >>> === >>> --- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-09-20 05:42:36 >>> UTC (rev 317039) >>> +++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-09-20 07:06:55 >>> UTC (rev 317040) >>> @@ -1877,11 +1877,24 @@ >>> } >>> { >>> zend_file_handle zfd; >>> +#if HAVE_BROKEN_GETCWD >>> + int old_cwd_fd = -1; >>> + old_cwd_fd = open(".", 0); >>> +#else >>> + char *old_cwd; >>> + ALLOCA_FLAG(use_heap) >>> +#define OLD_CWD_SIZE 4096 >>> + old_cwd = do_alloca(OLD_CWD_SIZE, use_heap); >>> + old_cwd[0] = '\0'; >>> + php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1)); >>> +#endif >>> + >>> zfd.type = ZEND_HANDLE_FILENAME; >>> zfd.filename = server->router; >>> zfd.handle.fp = NULL; >>> zfd.free_filename = 0; >>> zfd.opened_path = NULL; >>> + >>> zend_try { >>> zval *retval = NULL; >>> if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE >>> TSRMLS_CC, &retval, 1, &zfd)) { >>> @@ -1893,6 +1906,18 @@ >>> decline = 1; >>> } >>> } zend_end_try(); >>> + >>> +#if HAVE_BROKEN_GETCWD >>> + if (old_cwd_fd != -1) { >>> + fchdir(old_cwd_fd); >>> + close(old_cwd_fd); >>> + } >>> +#else >>> + if (old_cwd[0] != '\0') { >>> + php_ignore_value(VCWD_CHDIR(old_cwd)); >>> + } >>> + free_alloca(old_cwd, use_heap); >>> +#endif >>> } >>> >>> if (decline) { >>> >>> -- >>> PHP CVS Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >> >> -- >> Moriyoshi Koizumi >> m...@mozo.jp >> >> >> >> >> -- >> PHP CVS Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > -- Laruence Xinchen Hui http://www.laruence.com/
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c
laruence Wed, 21 Sep 2011 06:59:47 + Revision: http://svn.php.net/viewvc?view=revision&revision=317078 Log: Remove double checking, and use MAXPATHLEN instead of a fixed length Changed paths: U php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c U php/php-src/trunk/sapi/cli/php_cli_server.c Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c === --- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c 2011-09-21 05:20:12 UTC (rev 317077) +++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c 2011-09-21 06:59:47 UTC (rev 317078) @@ -1880,17 +1880,12 @@ } { zend_file_handle zfd; -#if HAVE_BROKEN_GETCWD - int old_cwd_fd = -1; - old_cwd_fd = open(".", 0); -#else char *old_cwd; + ALLOCA_FLAG(use_heap) -#define OLD_CWD_SIZE 4096 - old_cwd = do_alloca(OLD_CWD_SIZE, use_heap); + old_cwd = do_alloca(MAXPATHLEN, use_heap); old_cwd[0] = '\0'; - php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1)); -#endif + php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1)); zfd.type = ZEND_HANDLE_FILENAME; zfd.filename = server->router; @@ -1910,17 +1905,11 @@ } } zend_end_try(); -#if HAVE_BROKEN_GETCWD - if (old_cwd_fd != -1) { - fchdir(old_cwd_fd); - close(old_cwd_fd); - } -#else if (old_cwd[0] != '\0') { php_ignore_value(VCWD_CHDIR(old_cwd)); } + free_alloca(old_cwd, use_heap); -#endif } if (decline) { Modified: php/php-src/trunk/sapi/cli/php_cli_server.c === --- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-09-21 05:20:12 UTC (rev 317077) +++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-09-21 06:59:47 UTC (rev 317078) @@ -1880,17 +1880,12 @@ } { zend_file_handle zfd; -#if HAVE_BROKEN_GETCWD - int old_cwd_fd = -1; - old_cwd_fd = open(".", 0); -#else char *old_cwd; + ALLOCA_FLAG(use_heap) -#define OLD_CWD_SIZE 4096 - old_cwd = do_alloca(OLD_CWD_SIZE, use_heap); + old_cwd = do_alloca(MAXPATHLEN, use_heap); old_cwd[0] = '\0'; - php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1)); -#endif + php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1)); zfd.type = ZEND_HANDLE_FILENAME; zfd.filename = server->router; @@ -1910,17 +1905,11 @@ } } zend_end_try(); -#if HAVE_BROKEN_GETCWD - if (old_cwd_fd != -1) { - fchdir(old_cwd_fd); - close(old_cwd_fd); - } -#else if (old_cwd[0] != '\0') { php_ignore_value(VCWD_CHDIR(old_cwd)); } + free_alloca(old_cwd, use_heap); -#endif } if (decline) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php