fielding 97/03/07 05:42:05
Modified: src CHANGES mod_cgi.c
Log:
Allow for cgi files without the .EXE extension on them under OS/2.
Submitted by: Garey Smiley, closes PR #59
Reviewed by: Roy Fielding, Chuck Murcko
Revision Changes Path
1.186 +4 -1 apache/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache/src/CHANGES,v
retrieving revision 1.185
retrieving revision 1.186
diff -C3 -r1.185 -r1.186
*** CHANGES 1997/03/07 13:15:37 1.185
--- CHANGES 1997/03/07 13:42:04 1.186
***************
*** 1,7 ****
Changes with Apache 1.2b8
*) Fixed error message when resource is not found and URL contains
! path info. [Petr Lampa and Dean Gaudet]
*) Fixed user and server confusion over what should be a virtual host
and what is the main server, resulting in access to something
--- 1,10 ----
Changes with Apache 1.2b8
+ *) Allow for cgi files without the .EXE extension on them under OS/2.
+ [Garey Smiley] PR #59
+
*) Fixed error message when resource is not found and URL contains
! path info. [Petr Lampa and Dean Gaudet] PR #40
*) Fixed user and server confusion over what should be a virtual host
and what is the main server, resulting in access to something
1.34 +14 -0 apache/src/mod_cgi.c
Index: mod_cgi.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_cgi.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C3 -r1.33 -r1.34
*** mod_cgi.c 1997/02/17 18:11:03 1.33
--- mod_cgi.c 1997/03/07 13:42:04 1.34
***************
*** 375,383 ****
--- 375,397 ----
if (S_ISDIR(r->finfo.st_mode))
return log_scripterror(r, conf, FORBIDDEN,
"attempt to invoke directory as script");
+ #ifdef __EMX__
+ /* Allow for cgi files without the .EXE extension on them under OS/2 */
+ if (r->finfo.st_mode == 0) {
+ struct stat statbuf;
+
+ r->filename = pstrcat (r->pool, r->filename, ".EXE", NULL);
+
+ if ((stat(r->filename, &statbuf) != 0) ||
(!S_ISREG(statbuf.st_mode))) {
+ return log_scripterror(r, conf, NOT_FOUND,
+ "script not found or unable to stat");
+ }
+ }
+ #else
if (r->finfo.st_mode == 0)
return log_scripterror(r, conf, NOT_FOUND,
"script not found or unable to stat");
+ #endif
if (!suexec_enabled) {
if (!can_exec(&r->finfo))
return log_scripterror(r, conf, FORBIDDEN,