Author: kkolinko
Date: Tue Aug 28 00:04:29 2012
New Revision: 1377917

URL: http://svn.apache.org/viewvc?rev=1377917&view=rev
Log:
Correct fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=53047

Followup to r1377888.
The code should have been added to getRoles() method, not getPassword().

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java?rev=1377917&r1=1377916&r2=1377917&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java 
Tue Aug 28 00:04:29 2012
@@ -458,12 +458,6 @@ public class DataSourceRealm
     protected String getPassword(Connection dbConnection, 
                                                                 String 
username) {
 
-        if (allRolesMode != AllRolesMode.STRICT_MODE && !isRoleStoreDefined()) 
{
-            // Using an authentication only configuration and no role store has
-            // been defined so don't spend cycles looking
-            return null;
-        }
-
         ResultSet rs = null;
         PreparedStatement stmt = null;
         String dbCredentials = null;
@@ -548,7 +542,13 @@ public class DataSourceRealm
      */
     protected ArrayList<String> getRoles(Connection dbConnection,
                                      String username) {
-       
+
+        if (allRolesMode != AllRolesMode.STRICT_MODE && !isRoleStoreDefined()) 
{
+            // Using an authentication only configuration and no role store has
+            // been defined so don't spend cycles looking
+            return null;
+        }
+
         ResultSet rs = null;
         PreparedStatement stmt = null;
         ArrayList<String> list = null;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to