Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/TSRM/tsrm_win32.c trunk/TSRM/tsrm_win32.c

2009-08-19 Thread Stanislav Malyshev

Hi!


-   cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof( /c 
)+2);
-   sprintf(cmd, %s /c \%s\, TWG(comspec), command);
-   if (!CreateProcess(NULL, cmd, security, security, security.bInheritHandle, 
dwCreateFlags, env, cwd, startup, process)) {
+   if (!CreateProcess(NULL, command, security, security, 
security.bInheritHandle, dwCreateFlags, env, cwd, startup, process)) {
return NULL;


Could you explain this change? It seems to change the semantics of popen 
 in a significant way...

--
Stanislav Malyshev, Zend Software Architect
s...@zend.com   http://www.zend.com/
(408)253-8829   MSN: s...@zend.com

--
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_3/NEWS branches/PHP_5_3/TSRM/tsrm_win32.c trunk/TSRM/tsrm_win32.c

2009-08-19 Thread Garrett Serack
Howdy,

There are a couple of issues with making all child processes go thru cmd.exe.

Initially, this prevents popen_ex from failing when the actual executable 
doesn't exist, since cmd.exe /c c:\foo\bar\xxx.exe will *always* successfully 
start a process. This can be seen in bug #43327.

Second, is that by having the intermediate process, I'm pretty sure there's 
some extra-buffering of the input/output streams going on (once for the child 
proc, and once for the cmd.exe). This (probably along with a too-small pipe 
buffer) contributes to the behavior found in #44994.

Finally, I can't for the life of me see what benefit this brings to the table.  
Other languages don't need to put cmd.exe in the middle of their children. The 
only case may be where someone wants to use built-in cmd.exe commands like 
'dir' on popen_ex() , which would not be right anyway, and they should 
explicitly include the command processor in their command line.

If fixing this causes a problem elsewhere, we're better off fixing that 
appropriately, rather than dragging around a redundant copy of the command 
processor for every child process.

Hi!

- cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof( /c )+2);
- sprintf(cmd, %s /c \%s\, TWG(comspec), command);
- if (!CreateProcess(NULL, cmd, security, security, security.bInheritHandle, 
dwCreateFlags, env, cwd, startup, process)) {
+ if (!CreateProcess(NULL, command, security, security, 
security.bInheritHandle, dwCreateFlags, env, cwd, startup, process)) { return 
NULL;


Could you explain this change? It seems to change the semantics of popen in a 
significant way...
--


Garrett Serack | Open Source Software Developer | Microsoft Corporation
Office:(425)706-7939
email/messenger: garre...@microsoft.com
blog: http://fearthecowboy.com


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