https://bz.apache.org/bugzilla/show_bug.cgi?id=61201
Bug ID: 61201
Summary: CGIServlet adds too much to the SCRIPT_NAME
environment variable if script followed by extra path
Product: Tomcat 9
Version: 9.0.0.M21
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
I run the following bash script as CGI (test2.sh):
-----
#!/bin/bash
echo "Content-Type: text/plain"
echo
set
-----
If I call it as
http://127.0.0.1:8086/nextcloud/test2.sh
it outputs
[...]
SCRIPT_NAME=/nextcloud/test2.sh
[...]
If I call it as
http://127.0.0.1:8086/nextcloud/test2.sh/login
it outputs
[...]
SCRIPT_NAME=/nextcloud/test2.sh/login/test2.sh
[...]
But the value of $SCRIPT_NAME should stay the same.
Excerpt from my web.xml:
<servlet>
<servlet-name>test-cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>executable</param-name>
<param-value>/bin/bash</param-value>
</init-param>
<init-param>
<param-name>passShellEnvironment</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>test-cgi</servlet-name>
<url-pattern>*.sh</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>test-cgi</servlet-name>
<url-pattern>/test2.sh/login</url-pattern>
</servlet-mapping>
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]