1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

This patch solves several specific issues:

1.3.x truncated any open/command arguments following the %1 arg.
           so this patch adds the char** arguments to several functions

     1.3.x did not expand environment strings (%userprofile% etc.)
           *) This patch may still not do so, if we are running with a
              subset of the 'normal' environment for security reasons.

     1.3.x did not parse the extension itself (eg. the .pl key itself)
           for the command, failing the 'named' type (eg. perlscript),
           so this patch first tests the 'named' key, then the .ext key

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85623 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
William A. Rowe Jr
2000-06-20 03:48:25 +00:00
parent e7a6e84486
commit fd3e806b92
3 changed files with 129 additions and 52 deletions

View File

@@ -436,15 +436,16 @@ static ap_status_t build_argv_list(char ***argv, request_rec *r, ap_pool_t *p)
return APR_SUCCESS;
}
static ap_status_t build_command_line(char **c, request_rec *r, ap_pool_t *p)
static ap_status_t build_command_line(char **cmd, request_rec *r, ap_pool_t *p)
{
#ifdef WIN32
char *quoted_filename = NULL;
char *interpreter = NULL;
char *arguments = NULL;
file_type_e fileType;
*c = NULL;
fileType = ap_get_win32_interpreter(r, &interpreter);
*cmd = NULL;
fileType = ap_get_win32_interpreter(r, &interpreter, &arguments);
if (fileType == eFileTypeUNKNOWN) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
@@ -459,13 +460,20 @@ static ap_status_t build_command_line(char **c, request_rec *r, ap_pool_t *p)
*/
quoted_filename = ap_pstrcat(p, "\"", r->filename, "\"", NULL);
if (interpreter && *interpreter) {
*c = ap_pstrcat(p, interpreter, " ", quoted_filename, " ", NULL);
if (arguments && *arguments)
*cmd = ap_pstrcat(p, interpreter, " ", quoted_filename, " ",
arguments, NULL);
else
*cmd = ap_pstrcat(p, interpreter, " ", quoted_filename, " ", NULL);
}
else if (arguments && *arguments) {
*cmd = ap_pstrcat(p, quoted_filename, " ", arguments, NULL);
}
else {
*c = ap_pstrcat(p, quoted_filename, " ", NULL);
*cmd = ap_pstrcat(p, quoted_filename, NULL);
}
#else
*c = ap_pstrcat(p, r->filename, NULL);
*cmd = ap_pstrcat(p, r->filename, NULL);
#endif
return APR_SUCCESS;
}