geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r123495 - /geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasSecurityContext.java /geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java
Date Tue, 28 Dec 2004 11:37:34 GMT
Author: adc
Date: Tue Dec 28 03:37:31 2004
New Revision: 123495

URL: http://svn.apache.org/viewcvs?view=rev&rev=123495
Log:
Fixed problem with missing realm principals.
Modified:
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasSecurityContext.java
   geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasSecurityContext.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasSecurityContext.java?view=diff&rev=123495&p1=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasSecurityContext.java&r1=123494&p2=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasSecurityContext.java&r2=123495
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasSecurityContext.java
(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasSecurityContext.java
Tue Dec 28 03:37:31 2004
@@ -77,9 +77,12 @@
         List list = new LinkedList();
         for (Iterator it = subject.getPrincipals().iterator(); it.hasNext();) {
             Principal p = (Principal) it.next();
-            if(!(p instanceof RealmPrincipal) && !processedPrincipals.contains(p))
{
-                list.add(ContextManager.registerPrincipal(new RealmPrincipal(loginDomainName,
p, realmName)));
-                processedPrincipals.add(p);
+            if(!(p instanceof RealmPrincipal)) {
+                RealmPrincipal rp = new RealmPrincipal(loginDomainName, p, realmName);
+                if (!processedPrincipals.contains(rp)) {
+                    list.add(ContextManager.registerPrincipal(rp));
+                    processedPrincipals.add(p);
+                }
             }
         }
         subject.getPrincipals().addAll(list);

Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java?view=diff&rev=123495&p1=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java&r1=123494&p2=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java&r2=123495
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java
(original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java
Tue Dec 28 03:37:31 2004
@@ -53,7 +53,7 @@
         c.processPrincipals("D2");
         //Uncomment the following line to verify that the subject will have only 2 principals
rather than the desired 3 after both
         //login modules have tried to add the same principal to the subject.
-//        assertEquals(3, s.getPrincipals().size());
+        assertEquals(3, s.getPrincipals().size());
     }
 
     public static class MockLoginModule implements LoginModule {

Mime
View raw message