Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001521 [Resin] minor always 12-20-06 14:48 01-01-07 11:07
Reporter mca View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.0.22
Summary 0001521: wrapper.pl, httpd.sh don't quote arguments sufficiently to allow arguments with embedded semicolons
Description When I start Resin, I need to pass in a JDBC URL as a system property. The jTDS JDBC driver's URL separates driver options with a semicolon, so I end up with a startup script that looks something like this:

rconf_jdbcURL="jdbc:jtds:sqlserver://$dbname/session;sendStringParametersAsUnicode=false" [^]
# ...
$RESIN_HOME/bin/httpd.sh -Drconf.jdbcURL="$rconf_jdbcURL" start

Httpd.sh and wrapper.pl don't completely preserve the necessary quoting around $rconf_jdbcURL, and as the arguments filter down to the point where the java process is actually launched, the embedded semicolon ends up terminating the command, and thus resin doesn't start.

The scripts can be fixed with very minor changes:

Differences ...

==== //depot/users/mca/resin/3.0/bin/httpd.sh#2 (xtext) ====

@@ -79,4 +79,4 @@

 bin=`dirname $script`

-exec $perl $bin/wrapper.pl -chdir -name "$name" -class "$class" $args $*
+exec $perl $bin/wrapper.pl -chdir -name "$name" -class "$class" $args ${1+"$@"}

==== //depot/users/mca/resin/3.0/bin/wrapper.pl#5 (xtext) ====

@@ -220,7 +220,7 @@
     }
     elsif ($ARGV[0] =~ "^-J") {
         $val = substr($ARGV[0], 2);
- $JAVA_ARGS .= " " . $val;
+ $JAVA_ARGS .= " '" . $val . "'";

         if ($val =~ "^-Xss") {
           $DEFAULT_STACK_SIZE = "";
@@ -229,7 +229,7 @@
        shift(@ARGV);
     }
     elsif ($ARGV[0] =~ "^-D") {
- $JAVA_ARGS .= " " . $ARGV[0];
+ $JAVA_ARGS .= " '" . $ARGV[0] . "'";
        shift(@ARGV);
     }
     elsif ($ARGV[0] =~ "^-javaagent"
@@ -240,7 +240,7 @@
     }
     elsif ($ARGV[0] =~ "^-X") {
         $val = $ARGV[0];
- $JAVA_ARGS .= " " . $val;
+ $JAVA_ARGS .= " '" . $val . "'";

         if ($val =~ "^-Xss") {
           $DEFAULT_STACK_SIZE = "";
Additional Information
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
12-20-06 14:48 mca New Issue
12-20-06 14:48 mca Issue Monitored: mca
01-01-07 11:07 ferg Assigned To  => ferg
01-01-07 11:07 ferg Status new => closed
01-01-07 11:07 ferg Resolution open => fixed
01-01-07 11:07 ferg Fixed in Version  => 3.0.23


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker