activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1377687 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/ apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/
Date Mon, 27 Aug 2012 14:05:15 GMT
Author: chirino
Date: Mon Aug 27 14:05:14 2012
New Revision: 1377687

URL: http://svn.apache.org/viewvc?rev=1377687&view=rev
Log:
Fixing guest login issues /w the StompUDP protocol, identified in issue: APLO-177

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/GuestLoginModule.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/JaasAuthenticator.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.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=1377687&r1=1377686&r2=1377687&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
Mon Aug 27 14:05:14 2012
@@ -85,7 +85,9 @@ class GuestLoginModule extends LoginModu
     try {
       val callback = new PasswordCallback("Password: ", false)
       callback_handler.handle(Array(callback))
-      return false;
+      if( callback.getPassword!=null && callback.getPassword.size>=0 ) {
+        return false;
+      }
     } catch {
       case ioe: IOException =>
         throw new LoginException(ioe.getMessage())
@@ -103,11 +105,7 @@ class GuestLoginModule extends LoginModu
   }
 
   def commit: Boolean = {
-    if( subject.getPrincipals().isEmpty ) {
-      subject.getPrincipals().addAll(principals)
-    } else {
-      principals.clear
-    }
+    subject.getPrincipals().addAll(principals)
     debug("commit")
     return true
   }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/JaasAuthenticator.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/JaasAuthenticator.scala?rev=1377687&r1=1377686&r2=1377687&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/JaasAuthenticator.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/security/JaasAuthenticator.scala
Mon Aug 27 14:05:14 2012
@@ -91,7 +91,7 @@ class JaasAuthenticator(val config: Auth
             callback =>
               callback match {
                 case x: NameCallback => x.setName(security_ctx.user)
-                case x: PasswordCallback => x.setPassword(Option(security_ctx.password).getOrElse("").toCharArray)
+                case x: PasswordCallback => x.setPassword(Option(security_ctx.password).map(_.toCharArray).getOrElse(null))
                 case x: CertificateCallback => x.setCertificates(security_ctx.certificates)
                 case x: SocketAddressCallback =>
                   x.local = security_ctx.local_address

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala?rev=1377687&r1=1377686&r2=1377687&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
Mon Aug 27 14:05:14 2012
@@ -96,6 +96,7 @@ class StompUdpProtocol extends UdpProtoc
       val sc = new SecurityContext
       sc.connector_id = connection.connector.id
       sc.local_address = connection.transport.getLocalAddress
+      sc.remote_address = udp.from
       sc.session_id = session_id
       if( login.isDefined || passcode.isDefined ) {
         val sc = new SecurityContext



Mime
View raw message