From b2fec850e199f73a64c42f93ce8c95f7a81d518d Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Wed, 28 Oct 2009 20:24:51 +0000 Subject: Fixed lack of checking for reserved exchange names that start with "amq." according to the AMQP spec. Added a python test for this functionality. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@830751 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SessionAdapter.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp index 65eadda68a..1a802cb2bd 100644 --- a/cpp/src/qpid/broker/SessionAdapter.cpp +++ b/cpp/src/qpid/broker/SessionAdapter.cpp @@ -85,6 +85,9 @@ void SessionAdapter::ExchangeHandlerImpl::declare(const string& exchange, const checkType(actual, type); checkAlternate(actual, alternate); }else{ + if(exchange.find("amq.") == 0) { + throw framing::NotAllowedException(QPID_MSG("Exchange names beginning with \"amq.\" are reserved. (exchange=\"" << exchange << "\")")); + } try{ std::pair response = getBroker().getExchanges().declare(exchange, type, durable, args); if (response.second) { -- cgit v1.2.1