Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359031 - The CGI servlet should support serving scripts from customisable paths within the context
Summary: The CGI servlet should support serving scripts from customisable paths within...
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: other (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 7.5.x   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-27 05:40 EDT by Florian Hackenberger CLA
Modified: 2011-11-04 15:32 EDT (History)
1 user (show)

See Also:


Attachments
Implements the enhancement request (1.23 KB, patch)
2011-09-27 05:43 EDT, Florian Hackenberger CLA
no flags Details | Diff
proposed patch (24.00 KB, application/x-tar)
2011-10-12 10:57 EDT, Thomas Becker CLA
no flags Details
proposed patch (2.04 KB, patch)
2011-11-04 14:49 EDT, Thomas Becker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Hackenberger CLA 2011-09-27 05:40:22 EDT
Build Identifier: 

When setting the cgibinResourceBase init-param, the jetty CGI servlet expects that path to be an absolute or relative path to the current working directory. It would be nice if specifying WEB-INF/cgi for example would work. Tomcat supports that BTW.

Reproducible: Always
Comment 1 Florian Hackenberger CLA 2011-09-27 05:43:50 EDT
Created attachment 204061 [details]
Implements the enhancement request

Setting the following init parameters exposes everthing in WEB-INF/cgi as cgi servlets, accessible using CONTEXTROOT/cgi-bin/CGIFILE.cgi

	<servlet>
		<servlet-name>cgi</servlet-name>
		<servlet-class>org.eclipse.jetty.servlets.CGI</servlet-class>
		<init-param>
			<param-name>cgibinResourceBase</param-name>
			<param-value>WEB-INF/cgi</param-value>
		</init-param>
		<init-param>
			<param-name>cgibinResourceBaseRelative</param-name>
			<param-value>true</param-value>
		</init-param>
	</servlet>
	<servlet-mapping>
		<servlet-name>cgi</servlet-name>
		<url-pattern>/cgi-bin/*</url-pattern>
	</servlet-mapping>
Comment 2 Thomas Becker CLA 2011-10-12 10:57:38 EDT
Created attachment 205042 [details]
proposed patch

I've applied and tested the suggested changes and don't see any side effects. So attached is the git patches.

Thx a lot for the contribution!
Comment 3 Simone Bordet CLA 2011-11-04 11:00:18 EDT
Patch applied.
Comment 4 Florian Hackenberger CLA 2011-11-04 11:18:30 EDT
Thanks for accepting the patch!
Comment 5 Thomas Becker CLA 2011-11-04 14:49:42 EDT
Created attachment 206478 [details]
proposed patch

Javadoc update.

Please not that this will only work on extracted war files as "jar cf" will not presume the execute permissions needed on the cgi files.
Comment 6 Simone Bordet CLA 2011-11-04 15:32:23 EDT
Javadoc patch applied.