diff options
| author | Gordon Sim <gsim@apache.org> | 2008-04-14 09:54:16 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-04-14 09:54:16 +0000 |
| commit | f58096364147d54676f520efc003c58fa7897d0f (patch) | |
| tree | 2e1954201b139d6cca7beae9f703a46be2cda922 /cpp/src/qpid/broker/PreviewConnection.cpp | |
| parent | 1bf367821416484ebbb14480a5b68d1e6110b4c9 (diff) | |
| download | qpid-python-f58096364147d54676f520efc003c58fa7897d0f.tar.gz | |
QPID-648: Initial support for sasl authentication for c++ broker. From patch submitted by mfarrellee@redhat.com.
Authentication is optional at compile time (based on user selection or availability of cyrus sasl libs) and at
runtime (through broker config option). Note: At present the runtime default is to not authenticate; this is a
temporary measure to give some time for any automation scripts etc to be updated and will revert shortly to be
on by default.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@647716 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/PreviewConnection.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/PreviewConnection.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/PreviewConnection.cpp b/cpp/src/qpid/broker/PreviewConnection.cpp index 8901aa9f9d..6f411c99d6 100644 --- a/cpp/src/qpid/broker/PreviewConnection.cpp +++ b/cpp/src/qpid/broker/PreviewConnection.cpp @@ -18,6 +18,9 @@ * under the License. * */ + +#include "config.h" + #include "PreviewConnection.h" #include "SessionState.h" #include "BrokerAdapter.h" @@ -36,6 +39,10 @@ #include <iostream> #include <assert.h> +#if HAVE_SASL +#include <sasl/sasl.h> +#endif + using namespace boost; using namespace qpid::sys; using namespace qpid::framing; @@ -87,6 +94,9 @@ public: PreviewConnection::PreviewConnection(ConnectionOutputHandler* out_, Broker& broker_, const std::string& mgmtId_, bool isLink) : ConnectionState(out_, broker_), +#if HAVE_SASL + sasl_conn(NULL), +#endif adapter(*this, isLink), mgmtClosing(false), mgmtId(mgmtId_) @@ -108,7 +118,14 @@ PreviewConnection::PreviewConnection(ConnectionOutputHandler* out_, Broker& brok } } -PreviewConnection::~PreviewConnection () {} +PreviewConnection::~PreviewConnection () { +#if HAVE_LIBSASL2 + if (NULL != sasl_conn) { + sasl_dispose(&sasl_conn); + sasl_conn = NULL; + } +#endif +} void PreviewConnection::received(framing::AMQFrame& frame){ if (mgmtClosing) |
