From 9197a1e626345437f00fbf401325146259980634 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 17 Feb 2010 03:27:39 +0100 Subject: Updated for new boost release & new kadm5 API Included boost patch (needed for boost < 1.42) --- boost_regex.patch | 140 +++++++++++++++++++++ src/Common/AuthManager.h | 1 + src/Core/ThreadManager.h | 1 + src/mad-server.conf | 1 + .../UserConfigBackendKrb5.cpp | 8 +- .../UserConfigBackendKrb5/UserConfigBackendKrb5.h | 2 - 6 files changed, 147 insertions(+), 6 deletions(-) create mode 100644 boost_regex.patch diff --git a/boost_regex.patch b/boost_regex.patch new file mode 100644 index 0000000..f931c9b --- /dev/null +++ b/boost_regex.patch @@ -0,0 +1,140 @@ +diff -dur boost_1_40_0.orig/boost/regex/icu.hpp boost_1_40_0/boost/regex/icu.hpp +--- boost_1_40_0.orig/boost/regex/icu.hpp 2009-11-17 16:54:09.000000000 +0100 ++++ boost_1_40_0/boost/regex/icu.hpp 2009-11-17 17:02:36.000000000 +0100 +@@ -376,7 +376,7 @@ + // + // Construction from ICU string type: + // +-inline u32regex make_u32regex(const UnicodeString& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) ++inline u32regex make_u32regex(const U_NAMESPACE_QUALIFIER UnicodeString& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) + { + return re_detail::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast const*>(0)); + } +@@ -498,7 +498,7 @@ + return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); + } + #endif +-inline bool u32regex_match(const UnicodeString& s, ++inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, + match_results& m, + const u32regex& e, + match_flag_type flags = match_default) +@@ -562,7 +562,7 @@ + return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); + } + #endif +-inline bool u32regex_match(const UnicodeString& s, ++inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, + const u32regex& e, + match_flag_type flags = match_default) + { +@@ -683,7 +683,7 @@ + return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); + } + #endif +-inline bool u32regex_search(const UnicodeString& s, ++inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, + match_results& m, + const u32regex& e, + match_flag_type flags = match_default) +@@ -744,7 +744,7 @@ + return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); + } + #endif +-inline bool u32regex_search(const UnicodeString& s, ++inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, + const u32regex& e, + match_flag_type flags = match_default) + { +@@ -921,7 +921,7 @@ + Iterator first, + Iterator last, + const u32regex& e, +- const UnicodeString& fmt, ++ const U_NAMESPACE_QUALIFIER UnicodeString& fmt, + match_flag_type flags = match_default) + { + return re_detail::extract_output_base +@@ -966,9 +966,9 @@ + + class unicode_string_out_iterator + { +- UnicodeString* out; ++ U_NAMESPACE_QUALIFIER UnicodeString* out; + public: +- unicode_string_out_iterator(UnicodeString& s) : out(&s) {} ++ unicode_string_out_iterator(U_NAMESPACE_QUALIFIER UnicodeString& s) : out(&s) {} + unicode_string_out_iterator& operator++() { return *this; } + unicode_string_out_iterator& operator++(int) { return *this; } + unicode_string_out_iterator& operator*() { return *this; } +@@ -986,23 +986,23 @@ + + } + +-inline UnicodeString u32regex_replace(const UnicodeString& s, ++inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QUALIFIER UnicodeString& s, + const u32regex& e, + const UChar* fmt, + match_flag_type flags = match_default) + { +- UnicodeString result; ++ U_NAMESPACE_QUALIFIER UnicodeString result; + re_detail::unicode_string_out_iterator i(result); + u32regex_replace(i, s.getBuffer(), s.getBuffer()+s.length(), e, fmt, flags); + return result; + } + +-inline UnicodeString u32regex_replace(const UnicodeString& s, ++inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QUALIFIER UnicodeString& s, + const u32regex& e, +- const UnicodeString& fmt, ++ const U_NAMESPACE_QUALIFIER UnicodeString& fmt, + match_flag_type flags = match_default) + { +- UnicodeString result; ++ U_NAMESPACE_QUALIFIER UnicodeString result; + re_detail::unicode_string_out_iterator i(result); + re_detail::do_regex_replace( + re_detail::make_utf32_out(i, static_cast const*>(0)), +diff -dur boost_1_40_0.orig/boost/regex/v4/u32regex_iterator.hpp boost_1_40_0/boost/regex/v4/u32regex_iterator.hpp +--- boost_1_40_0.orig/boost/regex/v4/u32regex_iterator.hpp 2009-11-17 16:54:09.000000000 +0100 ++++ boost_1_40_0/boost/regex/v4/u32regex_iterator.hpp 2009-11-17 17:04:06.000000000 +0100 +@@ -178,7 +178,7 @@ + typedef typename std::basic_string::const_iterator iter_type; + return u32regex_iterator(p.begin(), p.end(), e, m); + } +-inline u32regex_iterator make_u32regex_iterator(const UnicodeString& s, const u32regex& e, regex_constants::match_flag_type m = regex_constants::match_default) ++inline u32regex_iterator make_u32regex_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, regex_constants::match_flag_type m = regex_constants::match_default) + { + return u32regex_iterator(s.getBuffer(), s.getBuffer() + s.length(), e, m); + } +diff -dur boost_1_40_0.orig/boost/regex/v4/u32regex_token_iterator.hpp boost_1_40_0/boost/regex/v4/u32regex_token_iterator.hpp +--- boost_1_40_0.orig/boost/regex/v4/u32regex_token_iterator.hpp 2009-11-17 16:54:09.000000000 +0100 ++++ boost_1_40_0/boost/regex/v4/u32regex_token_iterator.hpp 2009-11-17 17:04:09.000000000 +0100 +@@ -294,7 +294,7 @@ + typedef typename std::basic_string::const_iterator iter_type; + return u32regex_token_iterator(p.begin(), p.end(), e, m); + } +-inline u32regex_token_iterator make_u32regex_token_iterator(const UnicodeString& s, const u32regex& e, int submatch = 0, regex_constants::match_flag_type m = regex_constants::match_default) ++inline u32regex_token_iterator make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, int submatch = 0, regex_constants::match_flag_type m = regex_constants::match_default) + { + return u32regex_token_iterator(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m); + } +@@ -327,7 +327,7 @@ + return u32regex_token_iterator(p.begin(), p.end(), e, m); + } + template +-inline u32regex_token_iterator make_u32regex_token_iterator(const UnicodeString& s, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default) ++inline u32regex_token_iterator make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default) + { + return u32regex_token_iterator(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m); + } +@@ -356,7 +356,7 @@ + typedef typename std::basic_string::const_iterator iter_type; + return u32regex_token_iterator(p.begin(), p.end(), e, m); + } +-inline u32regex_token_iterator make_u32regex_token_iterator(const UnicodeString& s, const u32regex& e, const std::vector& submatch, regex_constants::match_flag_type m = regex_constants::match_default) ++inline u32regex_token_iterator make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, const std::vector& submatch, regex_constants::match_flag_type m = regex_constants::match_default) + { + return u32regex_token_iterator(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m); + } diff --git a/src/Common/AuthManager.h b/src/Common/AuthManager.h index 0c249ad..1595495 100644 --- a/src/Common/AuthManager.h +++ b/src/Common/AuthManager.h @@ -28,6 +28,7 @@ #include #include +#include #include #include diff --git a/src/Core/ThreadManager.h b/src/Core/ThreadManager.h index 9cae13c..d03dc5d 100644 --- a/src/Core/ThreadManager.h +++ b/src/Core/ThreadManager.h @@ -27,6 +27,7 @@ #include +#include #include #include #include diff --git a/src/mad-server.conf b/src/mad-server.conf index ad2a955..02ca76c 100644 --- a/src/mad-server.conf +++ b/src/mad-server.conf @@ -79,6 +79,7 @@ UserManager { } Krb5 { + Realm "EXAMPLE.COM" Principal "root/admin" Password "test" } diff --git a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp index 72c8160..5f4e3cf 100644 --- a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp +++ b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp @@ -64,8 +64,8 @@ void UserConfigBackendKrb5::_connect() { princ += "@" + realm; if(!password.isEmpty() && keytab.isEmpty()) { - krb5_error_code err = kadm5_init_with_password(const_cast(princ.toLocale().c_str()), const_cast(password.toLocale().c_str()), - const_cast(KADM5_ADMIN_SERVICE), ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_2, 0, &handle); + krb5_error_code err = kadm5_init_with_password(context, const_cast(princ.toLocale().c_str()), const_cast(password.toLocale().c_str()), + const_cast(KADM5_ADMIN_SERVICE), ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_3, 0, &handle); if(err) { application->log(Core::Logger::LOG_USER, Core::Logger::LOG_ERROR, Core::Format("kadm5_init_with_password: %1%") % krb5_get_error_message(context, err)); @@ -80,8 +80,8 @@ void UserConfigBackendKrb5::_connect() { keytabName = const_cast(keytabStr.c_str()); } - krb5_error_code err = kadm5_init_with_skey(const_cast(princ.toLocale().c_str()), keytabName, - const_cast(KADM5_ADMIN_SERVICE), ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_2, 0, &handle); + krb5_error_code err = kadm5_init_with_skey(context, const_cast(princ.toLocale().c_str()), keytabName, + const_cast(KADM5_ADMIN_SERVICE), ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_3, 0, &handle); if(err) { application->log(Core::Logger::LOG_USER, Core::Logger::LOG_ERROR, Core::Format("kadm5_init_with_skey: %1%") % krb5_get_error_message(context, err)); diff --git a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h index c02f868..34ab14c 100644 --- a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h +++ b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h @@ -27,8 +27,6 @@ #include #include - -#define USE_KADM5_API_VERSION 2 #include namespace Mad { -- cgit v1.2.3