tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 11966] - JDBCRealm.authenticate() does not validate pasword field
Date Fri, 23 Aug 2002 12:38:44 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11966>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11966

JDBCRealm.authenticate() does not validate pasword field

andrewconrad@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrewconrad@iname.com
             Status|NEW                         |ASSIGNED



------- Additional Comments From andrewconrad@iname.com  2002-08-23 12:38 -------
The problem is in JDBCRealm.java.   The problem is that the Password String is 
trimmed before testing for null.   The patch is as follows

--- C:/modules/apache.org/jakarta-tomcat-
4.0/catalina/src/share/org/apache/catalina/realm/JDBCRealm.java	9 Jun 2002 
02:19:43 -0000	1.21
+++ C:/modules/apache.org/jakarta-tomcat-
4.0/catalina/src/share/org/apache/catalina/realm/JDBCRealm.java	23 Aug 2002 
12:35:19 -0000
@@ -444,12 +444,13 @@
         PreparedStatement stmt = credentials(dbConnection, username);
         ResultSet rs = stmt.executeQuery();
         while (rs.next()) {
-            dbCredentials = rs.getString(1).trim();
+            dbCredentials = rs.getString(1);
         }
         rs.close();
         if (dbCredentials == null) {
             return (null);
         }
+        dbCredentials.trim(); //cannot trim until we test for null
 
         // Validate the user's credentials
         boolean validated = false;

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


Mime
View raw message