[qpid-cpp] Resolves: BZ#1186308

Darryl L. Pierce mcpierce at fedoraproject.org
Mon Feb 2 12:59:48 UTC 2015


commit 3f38effc3cc5fe7ed88c0a738c7c01b54d185f8f
Author: Darryl L. Pierce <mcpierce at gmail.com>
Date:   Mon Feb 2 07:58:34 2015 -0500

    Resolves: BZ#1186308

 ...JIRA-qpidd.service-file-for-use-on-Fedora.patch |    2 +-
 0002-NO-JIRA-Remove-dead-unused-code.patch         |    2 +-
 ...D-6128-Fix-compiling-SocketAddress-on-ARM.patch |    2 +-
 ...dd-__init__.py-to-setup.py-for-linear-sto.patch |    2 +-
 ...nge-python.i-to-qpid_messaging.i-in-extra.patch |    2 +-
 ...dds-build-support-for-aarch64-and-ppc64le.patch |    2 +-
 ...nsure-session-is-attached-even-for-unsupp.patch |    2 +-
 ...andle-case-where-content-bearing-method-i.patch |    2 +-
 ...heck-validity-of-ranges-when-decoding-seq.patch |    2 +-
 0010-txshift-switch-to-uint-for-workers.patch      |    2 +-
 ...25-improve-0-10-connection-handling-logic.patch |  105 ++++++++++++++++++++
 ...urther-improve-0-10-connection-handling-l.patch |   64 ++++++++++++
 qpid-cpp.spec                                      |   10 ++-
 13 files changed, 188 insertions(+), 11 deletions(-)
---
diff --git a/0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch b/0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch
index 3f6ef1d..1078fe0 100644
--- a/0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch
+++ b/0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch
@@ -1,7 +1,7 @@
 From d377a75fc454bd329f9dc340dd13aaab080fcf3a Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <mcpierce at gmail.com>
 Date: Wed, 3 Apr 2013 10:07:37 -0400
-Subject: [PATCH 01/10] NO-JIRA: qpidd.service file for use on Fedora
+Subject: [PATCH 01/12] NO-JIRA: qpidd.service file for use on Fedora
 
 This patch provides the needed systemd file for running the Qpid broker
 as a service.
diff --git a/0002-NO-JIRA-Remove-dead-unused-code.patch b/0002-NO-JIRA-Remove-dead-unused-code.patch
index 69e9a5f..758b6b9 100644
--- a/0002-NO-JIRA-Remove-dead-unused-code.patch
+++ b/0002-NO-JIRA-Remove-dead-unused-code.patch
@@ -1,7 +1,7 @@
 From 49e0b769ce4a2f4bfc4a499adaedbf43a4cf7ffd Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <dpierce at redhat.com>
 Date: Tue, 30 Sep 2014 10:27:54 -0400
-Subject: [PATCH 02/10] NO-JIRA: Remove dead/unused code
+Subject: [PATCH 02/12] NO-JIRA: Remove dead/unused code
 
 ---
  qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp   | 7 -------
diff --git a/0003-QPID-6128-Fix-compiling-SocketAddress-on-ARM.patch b/0003-QPID-6128-Fix-compiling-SocketAddress-on-ARM.patch
index b30b63d..3527c5c 100644
--- a/0003-QPID-6128-Fix-compiling-SocketAddress-on-ARM.patch
+++ b/0003-QPID-6128-Fix-compiling-SocketAddress-on-ARM.patch
@@ -1,7 +1,7 @@
 From 3e22a83f7247cd0c2b0da1e3a55de78952d99391 Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <dpierce at redhat.com>
 Date: Wed, 1 Oct 2014 11:12:49 -0400
-Subject: [PATCH 03/10] QPID-6128: Fix compiling SocketAddress on ARM
+Subject: [PATCH 03/12] QPID-6128: Fix compiling SocketAddress on ARM
 
 ---
  qpid/cpp/src/qpid/sys/posix/SocketAddress.cpp | 16 ++++++++++++----
diff --git a/0004-QPID-6150-Add-__init__.py-to-setup.py-for-linear-sto.patch b/0004-QPID-6150-Add-__init__.py-to-setup.py-for-linear-sto.patch
index dc57b66..45089cd 100644
--- a/0004-QPID-6150-Add-__init__.py-to-setup.py-for-linear-sto.patch
+++ b/0004-QPID-6150-Add-__init__.py-to-setup.py-for-linear-sto.patch
@@ -1,7 +1,7 @@
 From 6a980bbf9648e3529d2722de4aa6efd58e0f6206 Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <mcpierce at apache.org>
 Date: Tue, 14 Oct 2014 17:08:53 +0000
-Subject: [PATCH 04/10] QPID-6150: Add __init__.py to setup.py for linear
+Subject: [PATCH 04/12] QPID-6150: Add __init__.py to setup.py for linear
  store.
 
 The file was not being included in the source tarball.
diff --git a/0005-NO-JIRA-Change-python.i-to-qpid_messaging.i-in-extra.patch b/0005-NO-JIRA-Change-python.i-to-qpid_messaging.i-in-extra.patch
index bf80992..b77b255 100644
--- a/0005-NO-JIRA-Change-python.i-to-qpid_messaging.i-in-extra.patch
+++ b/0005-NO-JIRA-Change-python.i-to-qpid_messaging.i-in-extra.patch
@@ -1,7 +1,7 @@
 From 6c77d9085b00b265264a1bb6f508d0658c091c40 Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <dpierce at redhat.com>
 Date: Mon, 6 Oct 2014 08:12:38 -0400
-Subject: [PATCH 05/10] NO-JIRA: Change python.i to qpid_messaging.i in extra
+Subject: [PATCH 05/12] NO-JIRA: Change python.i to qpid_messaging.i in extra
  build
 
 ---
diff --git a/0006-QPID-6170-Adds-build-support-for-aarch64-and-ppc64le.patch b/0006-QPID-6170-Adds-build-support-for-aarch64-and-ppc64le.patch
index a76a438..c4cd87a 100644
--- a/0006-QPID-6170-Adds-build-support-for-aarch64-and-ppc64le.patch
+++ b/0006-QPID-6170-Adds-build-support-for-aarch64-and-ppc64le.patch
@@ -1,7 +1,7 @@
 From d74c6441a1e4cb364337f338287b4790ca9c98fd Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <dpierce at redhat.com>
 Date: Wed, 29 Oct 2014 11:13:04 -0400
-Subject: [PATCH 06/10] QPID-6170: Adds build support for aarch64 and ppc64le
+Subject: [PATCH 06/12] QPID-6170: Adds build support for aarch64 and ppc64le
  architectures.
 
 Contributed by Marcin Juszkiewicz <mjuszkiewicz at redhat.com>
diff --git a/0007-QPID-6310-ensure-session-is-attached-even-for-unsupp.patch b/0007-QPID-6310-ensure-session-is-attached-even-for-unsupp.patch
index ce482ce..c11a36c 100644
--- a/0007-QPID-6310-ensure-session-is-attached-even-for-unsupp.patch
+++ b/0007-QPID-6310-ensure-session-is-attached-even-for-unsupp.patch
@@ -1,7 +1,7 @@
 From 1d3f332d59c7571003ea4fe48b8cde0236f7f778 Mon Sep 17 00:00:00 2001
 From: Gordon Sim <gsim at apache.org>
 Date: Tue, 13 Jan 2015 10:25:02 +0000
-Subject: [PATCH 07/10] QPID-6310 ensure session is attached even for
+Subject: [PATCH 07/12] QPID-6310 ensure session is attached even for
  unsupported controls
 
 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1651319 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/0008-QPID-6310-handle-case-where-content-bearing-method-i.patch b/0008-QPID-6310-handle-case-where-content-bearing-method-i.patch
index 91aaae0..b3dcb12 100644
--- a/0008-QPID-6310-handle-case-where-content-bearing-method-i.patch
+++ b/0008-QPID-6310-handle-case-where-content-bearing-method-i.patch
@@ -1,7 +1,7 @@
 From 6e4a35b4de81556e768dc7a5b1a2c3a8983ef155 Mon Sep 17 00:00:00 2001
 From: Gordon Sim <gsim at apache.org>
 Date: Tue, 13 Jan 2015 10:25:08 +0000
-Subject: [PATCH 08/10] QPID-6310: handle case where content bearing method is
+Subject: [PATCH 08/12] QPID-6310: handle case where content bearing method is
  not in fact a message-transfer, which is the only one currently supported by
  qpidd
 
diff --git a/0009-QPID-6310-check-validity-of-ranges-when-decoding-seq.patch b/0009-QPID-6310-check-validity-of-ranges-when-decoding-seq.patch
index 24f7232..709fd31 100644
--- a/0009-QPID-6310-check-validity-of-ranges-when-decoding-seq.patch
+++ b/0009-QPID-6310-check-validity-of-ranges-when-decoding-seq.patch
@@ -1,7 +1,7 @@
 From aa2a9247305b4363f2f1bebec9dd6cc0a518496e Mon Sep 17 00:00:00 2001
 From: Gordon Sim <gsim at apache.org>
 Date: Tue, 13 Jan 2015 10:25:15 +0000
-Subject: [PATCH 09/10] QPID-6310: check validity of ranges when decoding
+Subject: [PATCH 09/12] QPID-6310: check validity of ranges when decoding
  sequence set
 
 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1651321 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/0010-txshift-switch-to-uint-for-workers.patch b/0010-txshift-switch-to-uint-for-workers.patch
index 9b14da6..43bfbdb 100644
--- a/0010-txshift-switch-to-uint-for-workers.patch
+++ b/0010-txshift-switch-to-uint-for-workers.patch
@@ -1,7 +1,7 @@
 From eaf900f854def9f33d6a1b1670443ed96a51c10c Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <dpierce at redhat.com>
 Date: Wed, 21 Jan 2015 10:45:06 -0500
-Subject: [PATCH 10/10] txshift: switch to uint for workers
+Subject: [PATCH 10/12] txshift: switch to uint for workers
 
 workaround missing size_t implementation of
 po::value_semantic* create_value(T& val, const std::string& arg)
diff --git a/0011-QPID-6325-improve-0-10-connection-handling-logic.patch b/0011-QPID-6325-improve-0-10-connection-handling-logic.patch
new file mode 100644
index 0000000..7396795
--- /dev/null
+++ b/0011-QPID-6325-improve-0-10-connection-handling-logic.patch
@@ -0,0 +1,105 @@
+From 48137ff5bb743ceb6d504d912e4a73d461c21f6d Mon Sep 17 00:00:00 2001
+From: Gordon Sim <gsim at apache.org>
+Date: Tue, 20 Jan 2015 10:00:17 +0000
+Subject: [PATCH 11/12] QPID-6325: improve 0-10 connection handling logic
+
+git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1653216 13f79535-47bb-0310-9956-ffa450edef68
+---
+ qpid/cpp/src/qpid/amqp_0_10/Connection.cpp     |  2 +-
+ qpid/cpp/src/qpid/broker/ConnectionHandler.cpp | 27 +++++++++++++++++++++++---
+ 2 files changed, 25 insertions(+), 4 deletions(-)
+
+diff --git a/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp b/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp
+index 87085b6..866f980 100644
+--- a/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp
++++ b/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp
+@@ -54,7 +54,7 @@ size_t  Connection::decode(const char* buffer, size_t size) {
+         }
+     }
+     framing::AMQFrame frame;
+-    while(frame.decode(in)) {
++    while(!pushClosed && frame.decode(in)) {
+         QPID_LOG(trace, "RECV [" << identifier << "]: " << frame);
+          connection->received(frame);
+     }
+diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
+index 2afdc5a..eece59d 100644
+--- a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
++++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
+@@ -93,14 +93,14 @@ void ConnectionHandler::handle(framing::AMQFrame& frame)
+         } else if (isOpen()) {
+             handler->connection.getChannel(frame.getChannel()).in(frame);
+         } else {
+-            handler->proxy.close(
++            handler->connection.close(
+                 connection::CLOSE_CODE_FRAMING_ERROR,
+                 "Connection not yet open, invalid frame received.");
+         }
+     }catch(ConnectionException& e){
+-        handler->proxy.close(e.code, e.what());
++        handler->connection.close(e.code, e.what());
+     }catch(std::exception& e){
+-        handler->proxy.close(541/*internal error*/, e.what());
++        handler->connection.close(connection::CLOSE_CODE_CONNECTION_FORCED, e.what());
+     }
+ }
+ 
+@@ -234,6 +234,10 @@ void ConnectionHandler::Handler::tuneOk(uint16_t /*channelmax*/,
+ void ConnectionHandler::Handler::open(const string& /*virtualHost*/,
+                                       const framing::Array& /*capabilities*/, bool /*insist*/)
+ {
++    if (connection.getUserId().empty()) {
++        throw ConnectionForcedException("Not authenticated!");
++    }
++
+     if (connection.isFederationLink()) {
+         AclModule* acl =  connection.getBroker().getAcl();
+         if (acl && acl->userAclRules()) {
+@@ -302,6 +306,11 @@ void ConnectionHandler::Handler::start(const FieldTable& serverProperties,
+                                        const framing::Array& supportedMechanisms,
+                                        const framing::Array& /*locales*/)
+ {
++    if (serverMode) {
++        throw ConnectionForcedException("Invalid protocol sequence.");
++    }
++
++
+     string requestedMechanism = connection.getAuthMechanism();
+ 
+     std::string username = connection.getUsername();
+@@ -388,6 +397,10 @@ void ConnectionHandler::Handler::start(const FieldTable& serverProperties,
+ 
+ void ConnectionHandler::Handler::secure(const string& challenge )
+ {
++    if (serverMode) {
++        throw ConnectionForcedException("Invalid protocol sequence.");
++    }
++
+     if (sasl.get()) {
+         string response = sasl->step(challenge);
+         proxy.secureOk(response);
+@@ -402,6 +415,10 @@ void ConnectionHandler::Handler::tune(uint16_t channelMax,
+                                       uint16_t /*heartbeatMin*/,
+                                       uint16_t heartbeatMax)
+ {
++    if (serverMode) {
++        throw ConnectionForcedException("Invalid protocol sequence.");
++    }
++
+     maxFrameSize = std::min(maxFrameSize, maxFrameSizeProposed);
+     connection.setFrameMax(maxFrameSize);
+ 
+@@ -420,6 +437,10 @@ void ConnectionHandler::Handler::tune(uint16_t channelMax,
+ 
+ void ConnectionHandler::Handler::openOk(const framing::Array& knownHosts)
+ {
++    if (serverMode) {
++        throw ConnectionForcedException("Invalid protocol sequence.");
++    }
++
+     for (Array::ValueVector::const_iterator i = knownHosts.begin(); i != knownHosts.end(); ++i) {
+         Url url((*i)->get<std::string>());
+         connection.getKnownHosts().push_back(url);
+-- 
+2.1.0
+
diff --git a/0012-QPID-6325-further-improve-0-10-connection-handling-l.patch b/0012-QPID-6325-further-improve-0-10-connection-handling-l.patch
new file mode 100644
index 0000000..3f75d33
--- /dev/null
+++ b/0012-QPID-6325-further-improve-0-10-connection-handling-l.patch
@@ -0,0 +1,64 @@
+From 9ef192201bb786345da15d05d15cd2b7b7deb647 Mon Sep 17 00:00:00 2001
+From: Gordon Sim <gsim at apache.org>
+Date: Wed, 21 Jan 2015 14:50:52 +0000
+Subject: [PATCH 12/12] QPID-6325: further improve 0-10 connection handling
+ logic
+
+git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1653547 13f79535-47bb-0310-9956-ffa450edef68
+---
+ qpid/cpp/src/qpid/broker/ConnectionHandler.cpp | 14 +++++++-------
+ qpid/cpp/src/qpid/broker/ConnectionHandler.h   |  3 ++-
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
+index eece59d..8972040 100644
+--- a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
++++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
+@@ -242,17 +242,17 @@ void ConnectionHandler::Handler::open(const string& /*virtualHost*/,
+         AclModule* acl =  connection.getBroker().getAcl();
+         if (acl && acl->userAclRules()) {
+             if (!acl->authorise(connection.getUserId(),acl::ACT_CREATE,acl::OBJ_LINK,"")){
+-                proxy.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED,
+-                            QPID_MSG("ACL denied " << connection.getUserId()
+-                                        << " creating a federation link"));
++                connection.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED,
++                                 QPID_MSG("ACL denied " << connection.getUserId()
++                                          << " creating a federation link"));
+                 return;
+             }
+         } else {
+             if (connection.getBroker().isAuthenticating()) {
+-                proxy.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED,
+-                            QPID_MSG("User " << connection.getUserId()
+-                                << " federation connection denied. Systems with authentication "
+-                                   "enabled must specify ACL create link rules."));
++                connection.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED,
++                                 QPID_MSG("User " << connection.getUserId()
++                                          << " federation connection denied. Systems with authentication "
++                                          "enabled must specify ACL create link rules."));
+                 return;
+             }
+         }
+diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.h b/qpid/cpp/src/qpid/broker/ConnectionHandler.h
+index 7af2fe3..30155fb 100644
+--- a/qpid/cpp/src/qpid/broker/ConnectionHandler.h
++++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.h
+@@ -100,13 +100,14 @@ class ConnectionHandler : public framing::FrameHandler
+     std::auto_ptr<Handler> handler;
+ 
+     bool handle(const qpid::framing::AMQMethodBody& method);
++    void close(framing::connection::CloseCode code, const std::string& text);
+   public:
+     ConnectionHandler(amqp_0_10::Connection& connection, bool isClient );
+-    void close(framing::connection::CloseCode code, const std::string& text);
+     void heartbeat();
+     void handle(framing::AMQFrame& frame);
+     void setSecureConnection(SecureConnection* secured);
+     bool isOpen() { return handler->isOpen; }
++  friend class amqp_0_10::Connection;
+ };
+ 
+ 
+-- 
+2.1.0
+
diff --git a/qpid-cpp.spec b/qpid-cpp.spec
index 33a5c7a..9f8b1e5 100644
--- a/qpid-cpp.spec
+++ b/qpid-cpp.spec
@@ -3,7 +3,7 @@
 
 Name:          qpid-cpp
 Version:       0.30
-Release:       8%{?dist}
+Release:       9%{?dist}
 Summary:       Libraries for Qpid C++ client applications
 License:       ASL 2.0
 URL:           http://qpid.apache.org
@@ -22,6 +22,9 @@ Patch0008:     0008-QPID-6310-handle-case-where-content-bearing-method-i.patch
 Patch0009:     0009-QPID-6310-check-validity-of-ranges-when-decoding-seq.patch
 # BZ#1184488
 Patch0010:     0010-txshift-switch-to-uint-for-workers.patch
+# BZ#1186308
+Patch0011:     0011-QPID-6325-improve-0-10-connection-handling-logic.patch
+Patch0012:     0012-QPID-6325-further-improve-0-10-connection-handling-l.patch
 
 BuildRequires: gcc-c++
 BuildRequires: cmake
@@ -428,6 +431,8 @@ storage using a libaio-based asynchronous journal.
 %patch0008 -p3
 %patch0009 -p3
 %patch0010 -p3
+%patch0011 -p3
+%patch0012 -p3
 
 pushd qpid-tools-%{version}
 %patch0004 -p3
@@ -513,6 +518,9 @@ rm -rf %{buildroot}/usr/local/%{_lib}/ruby/site_ruby
 
 
 %changelog
+* Mon Fed  2 2015 Darryl L. Pierce <dpierce at redhat.com> - 0.30-9
+- Resolves: BZ#1186308
+
 * Tue Jan 27 2015 Petr Machata <pmachata at redhat.com> - 0.30-8
 - Rebuild for boost 1.57.0
 


More information about the scm-commits mailing list