Bug 31753 - inconsistency in #authenticate(Connection, ...) for JDBCRealm and DataSourceRealm
Summary: inconsistency in #authenticate(Connection, ...) for JDBCRealm and DataSourceR...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: Nightly Build
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
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.