* CGI Script stuff for Win32...
*/
typedef enum { eFileTypeUNKNOWN, eFileTypeBIN, eFileTypeEXE16, eFileTypeEXE32,
- eFileTypeSCRIPT } file_type_e;
+ eFileTypeSCRIPT, eCommandShell16, eCommandShell32 } file_type_e;
typedef enum { INTERPRETER_SOURCE_UNSET, INTERPRETER_SOURCE_REGISTRY,
INTERPRETER_SOURCE_SHEBANG } interpreter_source_e;
API_EXPORT(file_type_e) ap_get_win32_interpreter(const request_rec *, char **);
{
char *p, *shellcmd = getenv("COMSPEC");
if (!shellcmd)
- shellcmd = SHELL_PATH;
+ return eFileTypeUNKNOWN;
p = strchr(shellcmd, '\0');
if ((p - shellcmd >= 11) && !strcasecmp(p - 11, "command.com"))
{
if (!strcasecmp(ext,".cmd"))
return eFileTypeUNKNOWN;
*interpreter = ap_pstrcat(r->pool, "\"", shellcmd, "\" /C %1", NULL);
+ return eCommandShell16;
}
- else
+ else {
/* Assume any other likes long paths, and knows .cmd,
* but the entire /c arg should be double quoted, e.g.
* "c:\path\cmd.exe" /c ""prog" "arg" "arg""
*/
*interpreter = ap_pstrcat(r->pool, "\"", shellcmd, "\" /C \"\"%1\" %*\"", NULL);
- return eFileTypeSCRIPT;
+ return eCommandShell32;
+ }
}
/* If the file has an extension and it is not .com and not .exe and
pEnvBlock,
ap_make_dirstr_parent(r->pool, r->filename),
&si, &pi)) {
- if (fileType == eFileTypeEXE16) {
+ if (fileType == eFileTypeEXE16 || fileType == eCommandShell16) {
/* Hack to get 16-bit CGI's working. It works for all the
* standard modules shipped with Apache. pi.dwProcessId is 0
* for 16-bit CGIs and all the Unix specific code that calls