Repository: activemq-artemis Updated Branches: refs/heads/master 7f3c9dc1f -> ea3fef4e5
Minor refactor of OpenWireProtocolManager In addDestination() put the security check right before actual queue creation. That'll also fix BasicSecurityTest regression. Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/638674bc Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/638674bc Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/638674bc Branch: refs/heads/master Commit: 638674bce0a5f3e722aa2e8c1b7bd95c35f346b1 Parents: 7f3c9dc Author: Howard Gao <[email protected]> Authored: Mon Aug 31 10:37:28 2015 +0800 Committer: Howard Gao <[email protected]> Committed: Mon Aug 31 10:37:28 2015 +0800 ---------------------------------------------------------------------- .../protocol/openwire/OpenWireProtocolManager.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/638674bc/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java index c410b77..04be7aa 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java @@ -572,16 +572,15 @@ public class OpenWireProtocolManager implements ProtocolManager<Interceptor>, No ActiveMQDestination dest = info.getDestination(); if (dest.isQueue()) { SimpleString qName = OpenWireUtil.toCoreAddress(dest); - if (connection.getState().getInfo() != null) { - - CheckType checkType = dest.isTemporary() ? CheckType.CREATE_NON_DURABLE_QUEUE : CheckType.CREATE_DURABLE_QUEUE; - server.getSecurityStore().check(qName, checkType, connection); - - server.checkQueueCreationLimit(connection.getUsername()); - } - QueueBinding binding = (QueueBinding) server.getPostOffice().getBinding(qName); if (binding == null) { + if (connection.getState().getInfo() != null) { + + CheckType checkType = dest.isTemporary() ? CheckType.CREATE_NON_DURABLE_QUEUE : CheckType.CREATE_DURABLE_QUEUE; + server.getSecurityStore().check(qName, checkType, connection); + + server.checkQueueCreationLimit(connection.getUsername()); + } ConnectionInfo connInfo = connection.getState().getInfo(); this.server.createQueue(qName, qName, null, connInfo == null ? null : SimpleString.toSimpleString(connInfo.getUserName()), false, dest.isTemporary()); }
