diff options
author | Alan Conway <aconway@apache.org> | 2010-05-27 20:02:30 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2010-05-27 20:02:30 +0000 |
commit | 9557857f8f36d2f942ee761d37234cd09e6c186a (patch) | |
tree | 28cc64b3af9df203d6d13632a8acebf9adbeb9d5 /qpid/cpp/src/qpid | |
parent | e41664eafd017f9eb9c675f573c4ae75eb476402 (diff) | |
download | qpid-python-9557857f8f36d2f942ee761d37234cd09e6c186a.tar.gz |
Fix problems with cluster_authentication_soak test in VPATH build.
- Fix SASL version testing logic in cluster_authentication_soak and SaslAuthenticator
- Generate all SASL config in the build directory in sasl_test_setup.sh
- Compile cluster_authentication_soak only if SASL is available.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@948968 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid')
-rw-r--r-- | qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp b/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp index 1683432329..6e78446334 100644 --- a/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp +++ b/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp @@ -95,21 +95,19 @@ bool SaslAuthenticator::available(void) { // Initialize the SASL mechanism; throw if it fails. void SaslAuthenticator::init(const std::string& saslName, std::string const & saslConfigPath ) { - int code; - // If we are not given a specific sasl path, do - // nothing and allow the default to be used. - // If we have a version of SASL in which SASL_PATH_TYPE_CONFIG does not yet exist, do nothing. - #if (SASL_VERSION_MAJOR >= 2) && (SASL_VERSION_MINOR >= 1) && (SASL_VERSION_STEP >= 22) + // Check if we have a version of SASL that supports sasl_set_path() +#if (SASL_VERSION_FULL >= ((2<<16)|(1<<8)|22)) + // If we are not given a sasl path, do nothing and allow the default to be used. if ( ! saslConfigPath.empty() ) { - if(SASL_OK != (code=sasl_set_path(SASL_PATH_TYPE_CONFIG, const_cast<char *>(saslConfigPath.c_str())))) { - QPID_LOG(error, "SASL: sasl_set_path: [" << code << "] " ); - return; - } + int code = sasl_set_path(SASL_PATH_TYPE_CONFIG, + const_cast<char *>(saslConfigPath.c_str())); + if(SASL_OK != code) + throw Exception(QPID_MSG("SASL: sasl_set_path failed [" << code << "] " )); QPID_LOG(info, "SASL: config path set to " << saslConfigPath ); } - #endif +#endif - code = sasl_server_init(NULL, saslName.c_str()); + int code = sasl_server_init(NULL, saslName.c_str()); if (code != SASL_OK) { // TODO: Figure out who owns the char* returned by // sasl_errstring, though it probably does not matter much |