From: Ryan Bloom Date: Wed, 27 Dec 2000 23:30:07 +0000 (+0000) Subject: On Unix, we do not want to use an absolute path for CGI scripts. SuEXEC X-Git-Tag: APACHE_2_0_BETA_CANDIDATE_1~313 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7808798c4871d06e9656991ef10ec991fd4014a4;p=apache On Unix, we do not want to use an absolute path for CGI scripts. SuEXEC will not let us use one, and when not using SuEXEC, we chdir() into the correct directory. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87537 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index b161ff61d5..7ca07259e5 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -492,7 +492,7 @@ static apr_status_t build_command_line(const char **cmd, request_rec *r, *cmd = apr_pstrcat(p, quoted_filename, NULL); } #else - *cmd = apr_pstrcat(p, r->filename, NULL); + *cmd = argv0; #endif return APR_SUCCESS; } @@ -579,15 +579,15 @@ static int cgi_handler(request_rec *r) /* build the command line */ if (build_command_line(&command, r, p) != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, - "couldn't spawn child process: %s", r->filename); - return HTTP_INTERNAL_SERVER_ERROR; + ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, + "couldn't spawn child process: %s", r->filename); + return HTTP_INTERNAL_SERVER_ERROR; } /* build the argument list */ else if (build_argv_list(&argv, r, p) != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, - "couldn't spawn child process: %s", r->filename); - return HTTP_INTERNAL_SERVER_ERROR; + ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, + "couldn't spawn child process: %s", r->filename); + return HTTP_INTERNAL_SERVER_ERROR; } argv[0] = apr_pstrdup(p, command);