tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r762911 - in /tomcat/tc6.0.x/trunk: ./ java/org/apache/catalina/core/ java/org/apache/catalina/tribes/util/ test/org/apache/catalina/tribes/demos/ test/org/apache/catalina/tribes/test/channel/ test/org/apache/catalina/tribes/test/io/ webapp...
Date Wed, 08 Apr 2009 04:11:53 GMT
Author: markt
Date: Tue Apr  7 19:15:16 2009
New Revision: 762911

URL: http://svn.apache.org/viewvc?rev=762911&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46866
Better init of Random objects

Modified:
    tomcat/tc6.0.x/trunk/   (props changed)
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/util/UUIDGenerator.java
    tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/LoadTest.java
    tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java
    tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
    tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestRemoteProcessException.java
    tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  7 19:15:16 2009
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,718360,719119,719124,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,747834,747863,748344,750258,750291,750921,751286-751287,751295,757774
+/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,718360,719119,719124,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,747834,747863,748344,750258,750291,750921,751286-751287,751295,757774,758596

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Apr  7 19:15:16 2009
@@ -110,14 +110,6 @@
   +1: markt, rjung
   -1: 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46866
-  http://svn.apache.org/viewvc?rev=758596&view=rev
-  Better init of Random objects
-  +1: markt, rjung, billbarker
-      billbarker:  This is more like a +0.5, since Random isn't that secure in the first
place.
-                   But the patch seems harmless, so I'll support itch-scraching.
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46822
   http://svn.apache.org/viewvc?rev=758616&view=rev
   Remove unnecessary object creation in StandardContext

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java Tue Apr  7 19:15:16
2009
@@ -403,7 +403,7 @@
             int expected = 1024; // Cut off to avoid DoS attack
             while (expected < shutdown.length()) {
                 if (random == null)
-                    random = new Random(System.currentTimeMillis());
+                    random = new Random();
                 expected += (random.nextInt() % 1024);
             }
             while (expected > 0) {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/util/UUIDGenerator.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/util/UUIDGenerator.java?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/util/UUIDGenerator.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/util/UUIDGenerator.java Tue Apr 
7 19:15:16 2009
@@ -31,7 +31,7 @@
     public static final int BITS_PER_BYTE = 8;
     
     protected static SecureRandom secrand = null;
-    protected static Random rand = new Random(System.currentTimeMillis());
+    protected static Random rand = new Random();
     static {
         secrand = new SecureRandom();
         secrand.setSeed(rand.nextLong());

Modified: tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/LoadTest.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/LoadTest.java?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/LoadTest.java (original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/LoadTest.java Tue Apr  7 19:15:16
2009
@@ -255,7 +255,7 @@
     public static class LoadMessage extends ByteMessage  implements Serializable {
         
         public static byte[] outdata = new byte[size];
-        public static Random r = new Random(System.currentTimeMillis());
+        public static Random r = new Random();
         public static int getMessageSize (LoadMessage msg) {
             int messageSize = msg.getMessage().length;
             if ( ((Object)msg) instanceof ByteMessage ) return messageSize;

Modified: tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java (original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java Tue Apr  7 19:15:16
2009
@@ -356,7 +356,7 @@
             dataModel.getValueAt(-1,-1);
         }
 
-        public static Random random = new Random(System.currentTimeMillis());
+        public static Random random = new Random();
         public static String random(int count, int start, int end, boolean letters, boolean
numbers,
                                     char[] chars ) {
             if (count == 0) {

Modified: tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
(original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
Tue Apr  7 19:15:16 2009
@@ -166,7 +166,7 @@
         public int length;
         public byte[] data;
         public byte key;
-        public static Random r = new Random(System.currentTimeMillis());
+        public static Random r = new Random();
         public static Data createRandomData() {
             int i = r.nextInt();
             i = ( i % 127 );

Modified: tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestRemoteProcessException.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestRemoteProcessException.java?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestRemoteProcessException.java
(original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestRemoteProcessException.java
Tue Apr  7 19:15:16 2009
@@ -111,7 +111,7 @@
         public byte[] data;
         public byte key;
         public boolean error = false;
-        public static Random r = new Random(System.currentTimeMillis());
+        public static Random r = new Random();
         public static Data createRandomData(boolean error) {
             int i = r.nextInt();
             i = ( i % 127 );

Modified: tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java
(original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java
Tue Apr  7 19:15:16 2009
@@ -94,7 +94,7 @@
     }
     
     public static class TestMsg implements Serializable {
-        static Random r = new Random(System.currentTimeMillis());
+        static Random r = new Random();
         HashMap map = new HashMap();
         public TestMsg() {
             int size = Math.abs(r.nextInt() % 200);

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?rev=762911&r1=762910&r2=762911&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Tue Apr  7 19:15:16 2009
@@ -42,6 +42,9 @@
       <fix>
         Fix a typo in the OPTIONS response from the default servlet. (markt)
       </fix>
+      <fix>
+        <bug>46866</bug>: Better initialisation of Random objects. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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


Mime
View raw message