Skip to content

Commit

Permalink
MFH: bug#41361 (shell_exec() does not find binaries)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjori committed May 12, 2007
1 parent c5c162d commit 9098946
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main/php_ini.c
Expand Up @@ -354,12 +354,15 @@ int php_init_config(TSRMLS_D)
if (sapi_module.executable_location) {
binary_location = (char *)emalloc(PATH_MAX);
if (!strchr(sapi_module.executable_location, '/')) {
char *path;
char *envpath, *path;
int found = 0;

if ((path = getenv("PATH")) != NULL) {
if ((envpath = getenv("PATH")) != NULL) {
char *search_dir, search_path[MAXPATHLEN];
char *last;
int pathlen = strlen(envpath) + 1;
path = malloc(pathlen);
memcpy(path, envpath, pathlen);

search_dir = php_strtok_r(path, ":", &last);
while (search_dir) {
Expand Down

0 comments on commit 9098946

Please sign in to comment.