diff options
author | Jan Kneschke <jan@kneschke.de> | 2006-01-11 23:04:04 +0000 |
---|---|---|
committer | Jan Kneschke <jan@kneschke.de> | 2006-01-11 23:04:04 +0000 |
commit | d21f27d37486cc2bab4fa0ae3dbc9bb30991215c (patch) | |
tree | 274c5aed23bc5b0d17b191d38d4033ecf0543105 | |
parent | f68cecf5e431905d1eb54670aa1d7a19d65a4b3e (diff) | |
download | lighttpd-git-d21f27d37486cc2bab4fa0ae3dbc9bb30991215c.tar.gz |
oops, split the path on the final path to the binary itself
git-svn-id: svn+ssh://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@938 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r-- | src/mod_fastcgi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c index d9be4ff2..35efd06e 100644 --- a/src/mod_fastcgi.c +++ b/src/mod_fastcgi.c @@ -967,20 +967,22 @@ static int fcgi_spawn_connection(server *srv, env.ptr[env.used] = NULL; + parse_binpath(&arg, host->bin_path); + /* chdir into the base of the bin-path, * search for the last / */ - if (NULL != (c = strrchr(host->bin_path->ptr, '/'))) { + if (NULL != (c = strrchr(arg.ptr[0], '/'))) { *c = '\0'; /* change to the physical directory */ - if (-1 == chdir(host->bin_path->ptr)) { - log_error_write(srv, __FILE__, __LINE__, "ssb", "chdir failed:", strerror(errno), host->bin_path); + if (-1 == chdir(arg.ptr[0])) { + *c = '/'; + log_error_write(srv, __FILE__, __LINE__, "sss", "chdir failed:", strerror(errno), arg.ptr[0]); } *c = '/'; } - parse_binpath(&arg, host->bin_path); - + /* exec the cgi */ execve(arg.ptr[0], arg.ptr, env.ptr); |