pajoye                                   Wed, 08 Sep 2010 08:34:57 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=303163

Log:
- Fix #50524, proc_open should respect cwd as it does on other platforms

Bug: http://bugs.php.net/50524 (Assigned) proc_open is using a wrong initial 
working dir
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/standard/proc_open.c
    U   php/php-src/trunk/ext/standard/proc_open.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2010-09-08 07:52:49 UTC (rev 303162)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-09-08 08:34:57 UTC (rev 303163)
@@ -75,6 +75,8 @@
   (a_jelly_doughnut at phpbb dot com, Pierre)
 - Fixed #50953, socket will not connect to IPv4 address when the host has both
   IPv4 and IPv6 addresses, on Windows. (Gustavo, Pierre)
+- Fixed #50524, proc_open on Windows does not respect cwd as it does on other
+  platforms. (Pierre)

 22 Jul 2010, PHP 5.3.3
 - Upgraded bundled sqlite to version 3.6.23.1. (Ilia)

Modified: php/php-src/branches/PHP_5_3/ext/standard/proc_open.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/proc_open.c       2010-09-08 
07:52:49 UTC (rev 303162)
+++ php/php-src/branches/PHP_5_3/ext/standard/proc_open.c       2010-09-08 
08:34:57 UTC (rev 303163)
@@ -752,6 +752,16 @@
        }

 #ifdef PHP_WIN32
+       if (cwd == NULL) {
+               char cur_cwd[MAXPATHLEN];
+               char *getcwd_result;
+               getcwd_result = VCWD_GETCWD(cur_cwd, MAXPATHLEN);
+               if (!getcwd_result) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get 
current directory");
+                       goto exit_fail;
+               }
+       }
+
        memset(&si, 0, sizeof(si));
        si.cb = sizeof(si);
        si.dwFlags = STARTF_USESTDHANDLES;

Modified: php/php-src/trunk/ext/standard/proc_open.c
===================================================================
--- php/php-src/trunk/ext/standard/proc_open.c  2010-09-08 07:52:49 UTC (rev 
303162)
+++ php/php-src/trunk/ext/standard/proc_open.c  2010-09-08 08:34:57 UTC (rev 
303163)
@@ -677,6 +677,16 @@
        }

 #ifdef PHP_WIN32
+       if (cwd == NULL) {
+               char cur_cwd[MAXPATHLEN];
+               char *getcwd_result;
+               getcwd_result = VCWD_GETCWD(cur_cwd, MAXPATHLEN);
+               if (!getcwd_result) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get 
current directory");
+                       goto exit_fail;
+               }
+       }
+
        memset(&si, 0, sizeof(si));
        si.cb = sizeof(si);
        si.dwFlags = STARTF_USESTDHANDLES;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to