Skip to content

Commit bdc0265

Browse files
committed
Catch up with Brad's changes, this knocks off the CGI popup windows bug git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95538 13f79535-47bb-0310-9956-ffa450edef68
1 parent 041aa54 commit bdc0265

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

CHANGES

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
Changes with Apache 2.0.37
22

3+
*) Added the "detached" attribute to the cgi_exec_info_t internals
4+
so that Win32 and Netware won't create a new window or console
5+
for each CGI invoked. PR 8387
6+
[Brad Nicholes, William Rowe]
7+
38
*) Consolidated the command line parameters and attributes that are
4-
manipulated by the optional function ap_cgi_build_command() in
5-
mod_cgi into a single structure. Also added a "detached" attribute
6-
to the structure so that in addition to building the command
7-
line, each OS can specify how the CGI binary should be launched.
9+
manipulated by the optional function ap_cgi_build_command() in
10+
mod_cgi into a single structure.
811
[Brad Nicholes]
912

1013
*) Get rid of uninitialized value errors with "apxs -q" on certain

modules/arch/win32/mod_win32.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#include "http_log.h"
7070
#include "util_script.h"
7171
#include "mod_core.h"
72-
#include "apr_optional.h"
72+
#include "mod_cgi.h"
7373
#include "apr_lib.h"
7474

7575
#ifdef WIN32
@@ -413,7 +413,7 @@ static apr_array_header_t *split_argv(apr_pool_t *p, const char *interp,
413413

414414
static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
415415
request_rec *r, apr_pool_t *p,
416-
int process_cgi, apr_cmdtype_e *type)
416+
cgi_exec_info_t *e_info)
417417
{
418418
const char *ext = NULL;
419419
const char *interpreter = NULL;
@@ -424,7 +424,7 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
424424
d = (win32_dir_conf *)ap_get_module_config(r->per_dir_config,
425425
&win32_module);
426426

427-
if (process_cgi) {
427+
if (e_info->cmd_type) {
428428
/* Handle the complete file name, we DON'T want to follow suexec, since
429429
* an unrooted command is as predictable as shooting craps in Win32.
430430
*
@@ -457,8 +457,8 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
457457
== INTERPRETER_SOURCE_REGISTRY_STRICT);
458458
interpreter = get_interpreter_from_win32_registry(r->pool, ext,
459459
strict);
460-
if (interpreter && *type != APR_SHELLCMD) {
461-
*type = APR_PROGRAM_PATH;
460+
if (interpreter && e_info->prog_type != APR_SHELLCMD) {
461+
e_info->prog_type = APR_PROGRAM_PATH;
462462
}
463463
else {
464464
ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server,
@@ -499,8 +499,8 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
499499
while (isspace(*interpreter)) {
500500
++interpreter;
501501
}
502-
if (*type != APR_SHELLCMD) {
503-
*type = APR_PROGRAM_PATH;
502+
if (e_info->prog_type != APR_SHELLCMD) {
503+
e_info->prog_type = APR_PROGRAM_PATH;
504504
}
505505
}
506506
}
@@ -529,14 +529,12 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
529529
*argv = (const char **)(split_argv(p, interpreter, *cmd,
530530
args)->elts);
531531
*cmd = (*argv)[0];
532+
533+
e_info->detached = 1;
534+
532535
return APR_SUCCESS;
533536
}
534537

535-
APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_cgi_build_command,
536-
(const char **cmd, const char ***argv,
537-
request_rec *r, apr_pool_t *p,
538-
int replace_cmd, apr_cmdtype_e *type));
539-
540538
static void register_hooks(apr_pool_t *p)
541539
{
542540
APR_REGISTER_OPTIONAL_FN(ap_cgi_build_command);

0 commit comments

Comments
 (0)