mirror of
https://github.com/php/php-src.git
synced 2024-12-04 15:23:44 +08:00
pcntl_exec() should inherit environment in case it's not provided as an argument
This commit is contained in:
parent
a4cbecd20c
commit
7a535b807c
@ -727,16 +727,19 @@ PHP_FUNCTION(pcntl_exec)
|
|||||||
if (return_val == HASH_KEY_IS_LONG) efree(key);
|
if (return_val == HASH_KEY_IS_LONG) efree(key);
|
||||||
}
|
}
|
||||||
*(pair) = NULL;
|
*(pair) = NULL;
|
||||||
}
|
|
||||||
|
if (execve(path, argv, envp) == -1) {
|
||||||
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
if (execve(path, argv, envp) == -1) {
|
/* Cleanup */
|
||||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Cleanup */
|
|
||||||
if (envp != NULL) {
|
|
||||||
for (pair = envp; *pair != NULL; pair++) efree(*pair);
|
for (pair = envp; *pair != NULL; pair++) efree(*pair);
|
||||||
efree(envp);
|
efree(envp);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (execv(path, argv) == -1) {
|
||||||
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
efree(argv);
|
efree(argv);
|
||||||
|
Loading…
Reference in New Issue
Block a user