Bug 31753

Summary: inconsistency in #authenticate(Connection, ...) for JDBCRealm and DataSourceRealm
Product: Tomcat 5 Reporter: Shinobu Kawai <shinobu>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: Nightly Build   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Shinobu Kawai 2004-10-18 02:48:42 UTC
I couldn't help noticing the inconsistency in #authenticate(Connection, String, 
String) for JDBCRealm and DataSourceRealm.

- Getting dbCredentials
JDBCRealm:
  if (rs.next()) {
    dbCredentials = rs.getString(1);
  }

DataSourceRealm:
  while (rs.next()) {
    dbCredentials = rs.getString(1);
  }

- Getting roles
JDBCRealm:
  while (rs.next()) {
    String role = rs.getString(1);
    if (null!=role) {
      roleList.add(role.trim());
    }
  }

DataSourceRealm:
  while (rs.next()) {
    list.add(rs.getString(1).trim());
  }

I think the JDBCRealm approach is better in both cases.
Comment 1 Yoav Shapira 2004-10-29 13:32:37 UTC
OK, fixed.  Thanks for pointing this out.