[Registry-dev] svn commit r9431 - in trunk/registry/modules/core/src/main/java/org/wso2/registry: jdbc/queries secure

svn at wso2.org svn at wso2.org
Sat Nov 3 07:24:39 PDT 2007


Author: jonathan
Date: Sat Nov  3 07:24:37 2007
New Revision: 9431

Modified:
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/queries/SQLQueryProcessor.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
Log:
Added null check to allow queries without parameters.
Added additional runtime data to access control violation error message.

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/queries/SQLQueryProcessor.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/queries/SQLQueryProcessor.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/queries/SQLQueryProcessor.java	Sat Nov  3 07:24:37 2007
@@ -43,8 +43,10 @@
 
             PreparedStatement s = conn.prepareStatement(sqlString);
 
-            for (int i = 0; i < parameters.length; i++) {
-                s.setObject(i + 1, parameters[i]);
+            if (parameters != null) {
+                for (int i = 0; i < parameters.length; i++) {
+                    s.setObject(i + 1, parameters[i]);
+                }
             }
 
             ResultSet results = s.executeQuery();

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java	Sat Nov  3 07:24:37 2007
@@ -93,7 +93,7 @@
 
         try {
             if (!realm.isUserAuthorized(userID, authorizationPath, ActionConstants.GET)) {
-                String msg = "Attempted to perform unauthorized operation.";
+                String msg = "Attempted to perform unauthorized operation (" + ActionConstants.GET + " on " + authorizationPath + " by " + userID;
                 log.info(msg);
                 throw new AuthorizationFailedException(msg);
             }



More information about the Registry-dev mailing list