>Number:         2962
>Category:       mod_jserv
>Synopsis:       initArgs are not parsed correctly
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Sun Sep  6 10:50:00 PDT 1998
>Last-Modified:
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        1.3.1
>Environment:
FreeBSD 2.2.6, JDK1.1.6, JSDK 2.0, Jserv snapshot of 980906.
>Description:
When initArgs has more than one parameters set, e.g.:

xxxx.xxxx.initArgs=name1=value1,\
    name2=value2,\
    name3=value3

the args will not be correctly parsed. If one puts a "\" to "join" the lines,
as above, the "name2", "name3" etc will not be parsed. Even the trace file
will not list them. For the above example, trace will give:

initArgs: '{ name1=value1 }'
>How-To-Repeat:

>Fix:
The problem is at "load" method at the "Configurations" class.
It is not able to identify "escaped" multiline configs. The following patch
is a hack but will do the job:

*** Configurations.java.orig    Fri Aug 21 21:02:30 1998
--- Configurations.java Sun Sep  6 19:31:10 1998
***************
*** 160,170 ****
       */
      public void load(InputStream input) throws IOException {
          BufferedReader reader = new BufferedReader(new 
InputStreamReader(input));
!         String line;
  
          while ((line = reader.readLine()) != null) {
              line.trim();
              if (!line.startsWith("#")) {
                  int equalSign = line.indexOf('=');
                  if (equalSign > 0) {
                      String key = line.substring(0, equalSign);
--- 160,177 ----
       */
      public void load(InputStream input) throws IOException {
          BufferedReader reader = new BufferedReader(new 
InputStreamReader(input));
!         String line, escline;
  
          while ((line = reader.readLine()) != null) {
              line.trim();
              if (!line.startsWith("#")) {
+               while(line.endsWith("\\")){
+                   if((escline = reader.readLine()) != null) {
+                       line = line.substring(0,line.length()-1) + escline;
+                   } else {
+                       break;
+                   }
+               }
                  int equalSign = line.indexOf('=');
                  if (equalSign > 0) {
                      String key = line.substring(0, equalSign);
***************
*** 799,802 ****
                  + " doesn't map to a Double object");
          }
      }
! }
\ No newline at end of file
--- 806,809 ----
                  + " doesn't map to a Double object");
          }
      }
! }
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]



Reply via email to