tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm JDBCRealm.java
Date Sat, 16 Dec 2000 20:46:51 GMT
nacho       00/12/16 12:46:51

  Modified:    catalina/src/share/org/apache/catalina/realm JDBCRealm.java
  Log:
  PR#602
  
  JDBCRealm start() method lacks DriverManager.getConnection( url, user, passwd ) connection
method,
  also digest default of "No" not correctly bypassing Digest method...
  
  Submited by David Weinrich [dweinr1@home.com]
  
  Revision  Changes    Path
  1.5       +14 -7     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JDBCRealm.java
  
  Index: JDBCRealm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JDBCRealm.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JDBCRealm.java	2000/12/10 23:35:32	1.4
  +++ JDBCRealm.java	2000/12/16 20:46:50	1.5
  @@ -72,9 +72,9 @@
   import org.apache.catalina.Realm;
   import org.apache.catalina.util.LifecycleSupport;
   import org.apache.catalina.util.StringManager;
  -import org.apache.catalina.util.xml.SaxContext;
  -import org.apache.catalina.util.xml.XmlAction;
  -import org.apache.catalina.util.xml.XmlMapper;
  +//import org.apache.catalina.util.xml.SaxContext;
  +//import org.apache.catalina.util.xml.XmlAction;
  +//import org.apache.catalina.util.xml.XmlMapper;
   import org.xml.sax.AttributeList;
   import org.apache.catalina.util.Base64;
   import org.apache.catalina.util.HexUtils;
  @@ -225,7 +225,7 @@
        *
        */
   
  -    private String digest="No";
  +    private String digest=null;
   
      // ------------------------------------------------------------- Properties
   
  @@ -468,7 +468,7 @@
   	    ResultSet rs1 = preparedAuthenticate.executeQuery();
   	    boolean found = false;
   	    if (rs1.next()) {
  -                if (digest.equals("No")){
  +                if (digest!= null && digest.equalsIgnoreCase("No")){
                       if (credentials.equals(rs1.getString(1))) {
                           if (debug >= 2)
                               log(sm.getString("jdbcRealm.authenticateSuccess",
  @@ -719,9 +719,16 @@
   	started = true;
   
           try {
  -          Class.forName(driverName);
  +            Class.forName(driverName);
  +            if ((connectionName == null || connectionName.equals("")) &&
  +                (connectionPassword == null || connectionPassword.equals(""))){
  +                        dbConnection = DriverManager.getConnection(connectionURL);
  +            } else {
  +                        dbConnection =DriverManager.getConnection(connectionURL,
  +                            connectionName,
  +                            connectionPassword);
  +            }
   
  -          dbConnection = DriverManager.getConnection(connectionURL);
           } catch( ClassNotFoundException ex ) {
   	  throw new LifecycleException("JDBCRealm.start.readXml: " + ex, ex);
           }
  
  
  

Mime
View raw message