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
414414static 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-
540538static void register_hooks (apr_pool_t * p )
541539{
542540 APR_REGISTER_OPTIONAL_FN (ap_cgi_build_command );
0 commit comments