activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1378582 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/GuestLoginModule.scala
Date Wed, 29 Aug 2012 14:39:27 GMT
Author: chirino
Date: Wed Aug 29 14:39:27 2012
New Revision: 1378582

URL: http://svn.apache.org/viewvc?rev=1378582&view=rev
Log:
Make sure we only add guest principals if the subject does not have any others principals.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/GuestLoginModule.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/GuestLoginModule.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/GuestLoginModule.scala?rev=1378582&r1=1378581&r2=1378582&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/GuestLoginModule.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/GuestLoginModule.scala
Wed Aug 29 14:39:27 2012
@@ -105,7 +105,10 @@ class GuestLoginModule extends LoginModu
   }
 
   def commit: Boolean = {
-    subject.getPrincipals().addAll(principals)
+    val p = subject.getPrincipals()
+    if( p.isEmpty || (p.size()==1 && p.iterator().next().isInstanceOf[SourceAddressPrincipal])
) {
+      subject.getPrincipals().addAll(principals)
+    }
     debug("commit")
     return true
   }



Mime
View raw message