Bug 31753 - inconsistency in #authenticate(Connection, ...) for JDBCRealm and DataSourceRealm
inconsistency in #authenticate(Connection, ...) for JDBCRealm and DataSourceR...
Status: RESOLVED FIXED
Product: Tomcat 5
Classification: Unclassified
Component: Catalina
Nightly Build
Other other
: P3 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2004-10-18 02:48 UTC by Shinobu Kawai
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.