oops, split the path on the final path to the binary itself

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@938 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.11
Jan Kneschke 18 years ago
parent 45b98c63a3
commit ebb0efb457

@ -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);

Loading…
Cancel
Save