You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2016/11/23 17:43:48 UTC

[47/48] activemq-artemis git commit: Fix BasicSecurityTest

Fix BasicSecurityTest


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/21988693
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/21988693
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/21988693

Branch: refs/heads/ARTEMIS-780
Commit: 2198869312de4a6a67c1ef381a2786f5b740d3b5
Parents: fb67939
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 16:47:20 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:37 2016 -0600

----------------------------------------------------------------------
 .../core/protocol/openwire/OpenWireConnection.java     | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21988693/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index 7959801..fbd6464 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -54,6 +54,7 @@ import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQSession;
 import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQSingleConsumerBrokerExchange;
 import org.apache.activemq.artemis.core.protocol.openwire.util.OpenWireUtil;
 import org.apache.activemq.artemis.core.remoting.FailureListener;
+import org.apache.activemq.artemis.core.security.CheckType;
 import org.apache.activemq.artemis.core.security.SecurityAuth;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -711,8 +712,16 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
       if (dest.isQueue()) {
          SimpleString qName = new SimpleString(dest.getPhysicalName());
          QueueBinding binding = (QueueBinding) server.getPostOffice().getBinding(qName);
-         if (binding == null && server.getAddressSettingsRepository().getMatch(qName.toString()).isAutoCreateQueues()) {
-            internalSession.createQueue(qName, qName, null, dest.isTemporary(), true, null, null, true);
+         if (binding == null) {
+            if (dest.isTemporary()) {
+               internalSession.createQueue(qName, qName, null, dest.isTemporary(), false);
+            } else {
+               ConnectionInfo connInfo = getState().getInfo();
+               CheckType checkType = dest.isTemporary() ? CheckType.CREATE_NON_DURABLE_QUEUE : CheckType.CREATE_DURABLE_QUEUE;
+               server.getSecurityStore().check(qName, checkType, this);
+               server.checkQueueCreationLimit(getUsername());
+               server.createQueue(qName, qName, null, connInfo == null ? null : SimpleString.toSimpleString(connInfo.getUserName()), true, false);
+            }
          }
       }