geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1145150 - /geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/credentialstore/RunAsLoginModule.java
Date Mon, 11 Jul 2011 12:40:38 GMT
Author: genspring
Date: Mon Jul 11 12:40:38 2011
New Revision: 1145150

URL: http://svn.apache.org/viewvc?rev=1145150&view=rev
Log:
GERONIMO-6060 ClassCastException thrown in RunAsLoginModule, Thanks Shenghao Fang for the
patch !

Modified:
    geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/credentialstore/RunAsLoginModule.java

Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/credentialstore/RunAsLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/credentialstore/RunAsLoginModule.java?rev=1145150&r1=1145149&r2=1145150&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/credentialstore/RunAsLoginModule.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/credentialstore/RunAsLoginModule.java
Mon Jul 11 12:40:38 2011
@@ -38,6 +38,7 @@ import javax.security.auth.callback.Call
 import javax.security.auth.callback.UnsupportedCallbackException;
 
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
+import org.osgi.framework.Bundle;
 
 /**
  * Simple login module that may help create subjects for run-as roles.  List the desired
class as the principalClass and the
@@ -56,10 +57,10 @@ public class RunAsLoginModule implements
     public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,
?> sharedState, Map<String, ?> options) {
         this.subject = subject;
         this.callbackHandler = callbackHandler;
-        ClassLoader classLoader = (ClassLoader) options.get(JaasLoginModuleUse.CLASSLOADER_LM_OPTION);
+        Bundle bundle = (Bundle) options.get(JaasLoginModuleUse.CLASSLOADER_LM_OPTION);
         String principalClassName = (String) options.get("principalClass");
         try {
-            principalClass = (Class<Principal>) classLoader.loadClass(principalClassName);
+            principalClass = (Class<Principal>) bundle.loadClass(principalClassName);
         } catch (ClassNotFoundException e) {
             throw new IllegalArgumentException(principalClassName + " not found", e);
         }



Mime
View raw message