tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r554562 - in /tomcat/tc6.0.x/trunk: java/org/apache/catalina/manager/JMXProxyServlet.java java/org/apache/catalina/users/mbeans-descriptors.xml webapps/docs/changelog.xml
Date Mon, 09 Jul 2007 08:44:51 GMT
Author: rjung
Date: Mon Jul  9 01:44:50 2007
New Revision: 554562

URL: http://svn.apache.org/viewvc?view=rev&rev=554562
Log:
BZ 39813: Correct handling of new line characters in JMX attributes.
Patch provided by R Bramley. Ported from tc5.5.x r415029.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/users/mbeans-descriptors.xml
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java?view=diff&rev=554562&r1=554561&r2=554562
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java Mon Jul  9
01:44:50 2007
@@ -79,7 +79,6 @@
         response.setContentType("text/plain");
 
         PrintWriter writer = response.getWriter();
-        String qryString= request.getQueryString();
 
         if( mBeanServer==null ) {
             writer.println("Error - No mbean server");
@@ -113,7 +112,8 @@
         try {
             ObjectName oname = new ObjectName(onameStr);
             Object value = mBeanServer.getAttribute(oname, att);
-            writer.println("OK - Attribute get '" + onameStr + "' - " + att + "= " + value.toString()
);
+            writer.println("OK - Attribute get '" + onameStr + "' - " + att
+                    + "= " + escape(value.toString()));
         } catch (Exception ex) {
             writer.println("Error - " + ex.toString());
         }
@@ -203,7 +203,7 @@
         int prev=0;
         StringBuffer sb=new StringBuffer();
         while( idx >= 0 ) {
-            appendHead(sb, value, prev, idx-1);
+            appendHead(sb, value, prev, idx);
 
             sb.append( "\\n\n ");
             prev=idx+1;
@@ -216,6 +216,8 @@
     }
 
     private void appendHead( StringBuffer sb, String value, int start, int end) {
+        if (end < 1) return;
+
         int pos=start;
         while( end-pos > 78 ) {
             sb.append( value.substring(pos, pos+78));

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/users/mbeans-descriptors.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/users/mbeans-descriptors.xml?view=diff&rev=554562&r1=554561&r2=554562
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/users/mbeans-descriptors.xml (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/users/mbeans-descriptors.xml Mon Jul  9
01:44:50 2007
@@ -136,10 +136,6 @@
                 group="UserDatabase"
                  type="org.apache.catalina.users.MemoryUserDatabase">
 
-    <attribute   name="encoding"
-          description="Character encoding to use when writing XML file"
-                 type="java.lang.String"/>
-
     <attribute   name="groups"
           description="MBean Names of all defined groups"
                  type="[Ljava.lang.String;"

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?view=diff&rev=554562&r1=554561&r2=554562
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon Jul  9 01:44:50 2007
@@ -101,7 +101,11 @@
   <subsection name="Webapps">
     <changelog>
       <fix>
-         <bug>42459</bug>: Tomcat Web Application Manager table error (rjung)
+        <bug>39813</bug>: Correct handling of new line characters in JMX
+        attributes. Patch provided by R Bramley. Ported from tc5.5.x r415029. (markt,rjung)
+      </fix>
+      <fix>
+         <bug>42459</bug>: Fix Tomcat Web Application Manager table error. (rjung)
       </fix>
       <fix>
         Fix XSS security vulnerabilities (CVE-2007-2449) in the examples.



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


Mime
View raw message