Hi!

In 6.0.30 to fix BZ 49657 we changed the way how cgi command is built
in CGI Servlet:
http://svn.apache.org/viewvc?view=revision&revision=1004424

Earlier implementation used to build the command as a single string,
wrapping parts of it in double quotes. The new implementation uses
Runtime.exec(String[]) and passes all arguments separate from each
other as an array.

This causes regression for people using empty value for "executable"
init-param, as reported in
https://issues.apache.org/bugzilla/show_bug.cgi?id=50606

I closed BZ 50606 as INVALID but now I am changing my mind. Looking around

1) there are sites that recommend using an empty string for "executable"
http://stackoverflow.com/questions/499456/cgi-and-tomcat/500527#500527

Apparently it is to run programs that themselves are executables, as
*.exe on Windows.

2) some put in arguments for the executable, as "cmd /q /c"
http://webcache.googleusercontent.com/search?q=cache:njmdNKdXzNMJ:www.tek-tips.com/faqs.cfm%3Ffid%3D6467
(Should be http://www.tek-tips.com/faqs.cfm?fid=6467 but the original
site is inaccessible now).

I do not like to revert r1004424 and bother with quotes, nor I want to
parse "executable" into separate strings.
So I think of the following:
1. Allow empty value of "executable" init-param
2. Introduce additional init-params to explicitly specify additional arguments:
"executable-arg-1"
"executable-arg-2"
etc. starting with "1"

So cmd /q /c will be written as

<init-param>
  <param-name>executable</param-name>
  <param-value>cmd.exe</param-value>
</init-param>
<init-param>
  <param-name>executable-arg-1</param-name>
  <param-value>/q</param-value>
</init-param>
<init-param>
  <param-name>executable-arg-2</param-name>
  <param-value>/c</param-value>
</init-param>

What do you think?

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to