mirror of
https://github.com/php/php-src.git
synced 2024-09-29 13:56:09 +00:00
- revert fix for #43327, it breaks system&co functions
This commit is contained in:
parent
52d37429c6
commit
e9e5eba74b
@ -313,6 +313,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
HANDLE in, out;
|
||||
DWORD dwCreateFlags = 0;
|
||||
process_pair *proc;
|
||||
char *cmd;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
@ -349,9 +350,13 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
dwCreateFlags |= CREATE_NO_WINDOW;
|
||||
}
|
||||
|
||||
if (!CreateProcess(NULL, command, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
|
||||
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)) {
|
||||
return NULL;
|
||||
}
|
||||
free(cmd);
|
||||
|
||||
CloseHandle(process.hThread);
|
||||
proc = process_get(NULL TSRMLS_CC);
|
||||
|
Loading…
Reference in New Issue
Block a user