]> granicus.if.org Git - apache/commitdiff
On Unix, we do not want to use an absolute path for CGI scripts. SuEXEC
authorRyan Bloom <rbb@apache.org>
Wed, 27 Dec 2000 23:30:07 +0000 (23:30 +0000)
committerRyan Bloom <rbb@apache.org>
Wed, 27 Dec 2000 23:30:07 +0000 (23:30 +0000)
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

modules/generators/mod_cgi.c

index b161ff61d59e3fcb7d8b09eceec975418d305770..7ca07259e5fb0fd8820085762258a0d14870a53e 100644 (file)
@@ -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);