diff --git a/sources b/sources index cfbf649..32260d6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7317dd7889303abbbd30e39f04771f10 zcp-7.1.11.tar.gz +ded12c2363c7205889b8c68519140a4b zcp-7.1.14.tar.gz diff --git a/zarafa-7.1.10-imap-badcharset.patch b/zarafa-7.1.10-imap-badcharset.patch new file mode 100644 index 0000000..76b5a36 --- /dev/null +++ b/zarafa-7.1.10-imap-badcharset.patch @@ -0,0 +1,19 @@ +Patch by Robert Scheck for Zarafa <= 7.1.10 which fixes the RFC- +violating reply of the Zarafa IMAP gateway in response to a failed SEARCH CHARSET request. +This is documented at http://tools.ietf.org/html/rfc3501#page-64: "BADCHARSET: Optionally +followed by a parenthesized list of charsets. [...]". This patch adds missing parenthesis. + +Proposed to upstream via e-mail on Sun, 27 Jul 2014 23:58:01 +0200, patch was put into the +upstream ticket https://jira.zarafa.com/browse/ZCP-12504. + +--- zarafa-7.1.10/gateway/IMAP.cpp 2014-05-23 15:56:37.000000000 +0200 ++++ zarafa-7.1.10/gateway/IMAP.cpp.imap-badcharset 2014-07-27 23:42:30.000000000 +0200 +@@ -2409,7 +2409,7 @@ + if (lstSearchCriteria[1] != "WINDOWS-1252") { + iconv = new ECIConv("windows-1252", lstSearchCriteria[1]); + if (!iconv->canConvert()) { +- hr2 = HrResponse(RESP_TAGGED_NO, strTag, "[BADCHARSET WINDOWS-1252] "+strMode+"SEARCH charset not supported"); ++ hr2 = HrResponse(RESP_TAGGED_NO, strTag, "[BADCHARSET (WINDOWS-1252)] "+strMode+"SEARCH charset not supported"); + hr = MAPI_E_CALL_FAILED; + goto exit; + } diff --git a/zarafa-7.1.10-imap-fetch-body.patch b/zarafa-7.1.10-imap-fetch-body.patch new file mode 100644 index 0000000..da4e2fa --- /dev/null +++ b/zarafa-7.1.10-imap-fetch-body.patch @@ -0,0 +1,93 @@ +Patch by Robert Scheck for Zarafa <= 7.1.10 which fixes the RFC- +violating reply of the Zarafa IMAP gateway in response to a body fetch request. This is +documented at http://tools.ietf.org/html/rfc3501#page-55. Additionally this has been also +compared with the Dovecot IMAP server as a nearly (or even de facto) IMAP server reference +implementation. Please note that this is NOT a duplicate of ZCP-11590/ZCP-11739/ZCP-12365! + +Wrong behaviour of Zarafa <= 7.1.10rc1-44973 (without this patch): +> A4 FETCH 1 (BODY.PEEK[HEADER.FIELDS (FROM FROM)]) +< * 1 FETCH (BODY[HEADER.FIELDS (FROM FROM)] {66} +From: User1 +From: User1 + +) +< A4 OK FETCH completed + +Comparison with IMAP server Dovecot 2.2.13: +> A4 FETCH 1 (BODY.PEEK[HEADER.FIELDS (FROM FROM)]) +< * 1 FETCH (BODY[HEADER.FIELDS (FROM FROM)] {34} +From: User1 + +) +< A4 OK Fetch completed. + +Correct behaviour of Zarafa (after having this patch applied): +> A4 FETCH 1 (BODY.PEEK[HEADER.FIELDS (FROM FROM)]) +< * 1 FETCH (BODY[HEADER.FIELDS (FROM FROM)] {34} +From: User1 + +) +< A4 OK FETCH completed + +Testing: Full IMAP dialog example from the client perspective (after this patch applied): +< * OK [CAPABILITY IMAP4rev1 LITERAL+ AUTH=PLAIN] Zarafa IMAP gateway ready +> A0 LOGIN robert robert +< A0 OK [CAPABILITY IMAP4rev1 LITERAL+ CHILDREN XAOL-OPTION NAMESPACE QUOTA IDLE] LOGIN completed +> A1 LIST "" INBOX +< * LIST (\HasNoChildren) "/" "INBOX" +< A1 OK LIST completed +> A2 SELECT INBOX +< * 2 EXISTS +< * 0 RECENT +< * FLAGS (\Seen \Draft \Deleted \Flagged \Answered $Forwarded) +< * OK [PERMANENTFLAGS (\Seen \Draft \Deleted \Flagged \Answered $Forwarded)] Permanent flags +< * OK [UIDNEXT 4343] Predicted next UID +< * OK [UNSEEN 1] First unseen message +< * OK [UIDVALIDITY 9313] UIDVALIDITY value +< A2 OK [READ-WRITE] SELECT completed +> A3 SEARCH UNSEEN ALL +< * SEARCH 1 2 +< A3 OK SEARCH completed +> A4 FETCH 1 (BODY.PEEK[HEADER.FIELDS (FROM FROM)]) +< * 1 FETCH (BODY[HEADER.FIELDS (FROM FROM)] {34} +From: User1 + +) +< A4 OK FETCH completed +> A5 CLOSE +< A5 OK CLOSE completed +> A6 LOGOUT +< * BYE Zarafa server logging out +< A6 OK LOGOUT completed + +IMPORTANT: This patch has been very carefully and extensively tested but it might not be +perfect nevertheless as I am not really a C/C++ developer. There should be a code review +by an experienced C/C++ developer before merging into Zarafa core. + +Proposed to upstream via e-mail on Thu, 29 May 2014 01:55:35 +0200, patch was put into the +upstream ticket https://jira.zarafa.com/browse/ZCP-12398. + +--- zarafa-7.1.10/gateway/IMAP.cpp 2014-05-12 12:06:03.000000000 +0200 ++++ zarafa-7.1.10/gateway/IMAP.cpp.imap-fetch-body 2014-05-29 00:49:29.000000000 +0200 +@@ -5253,10 +5253,21 @@ + } else { + vector lstReqFields; + vector::iterator iterReqField; ++ vector::iterator r, w; ++ set tmpset; + + // Get fields as vector + lstReqFields = tokenize(strFields, " "); + ++ // Make elements of vector unique ++ for(r = lstReqFields.begin(), w = lstReqFields.begin(); r != lstReqFields.end(); ++r) { ++ if(tmpset.insert(*r).second) { ++ *w++ = *r; ++ } ++ } ++ ++ lstReqFields.erase(w, lstReqFields.end()); ++ + // Output headers specified, in order of field set + for(iterReqField = lstReqFields.begin(); iterReqField != lstReqFields.end(); iterReqField++) { + for(iterField = lstFields.begin(); iterField != lstFields.end(); iterField++) { diff --git a/zarafa-7.1.10-kyotocabinet.patch b/zarafa-7.1.10-kyotocabinet.patch index 43e62a3..00cdeab 100644 --- a/zarafa-7.1.10-kyotocabinet.patch +++ b/zarafa-7.1.10-kyotocabinet.patch @@ -4,6 +4,9 @@ broken on the given system and/or architecture. Interestingly that patch is not in 2012 the first time, proposed them as a patch to Zarafa and got merged. With a recent Zarafa release it seems they silently removed it again... +Proposed to upstream via e-mail on Fri, 11 Jul 2014 01:03:43 +0200, patch was put into the upstream ticket +https://jira.zarafa.com/browse/ZCP-12463. + --- zarafa-7.1.10/ECtools/zarafa-search/Makefile.am 2014-05-23 15:03:49.000000000 +0200 +++ zarafa-7.1.10/ECtools/zarafa-search/Makefile.am.kyotocabinet 2014-07-10 21:48:42.000000000 +0200 @@ -1,4 +1,8 @@ diff --git a/zarafa-7.1.10-ssl_protocols_ciphers.patch b/zarafa-7.1.10-ssl_protocols_ciphers.patch deleted file mode 100644 index 756d2fd..0000000 --- a/zarafa-7.1.10-ssl_protocols_ciphers.patch +++ /dev/null @@ -1,446 +0,0 @@ -Patch by Robert Scheck for Zarafa <= 7.1.10 which implements much more -fine granulated configuration settings for SSL/TLS protocol and cipher enabling and disabling. The -currently available "ssl_enable_v2" setting allows either to disable SSLv2 (and enables SSLv3 only -instead) or to enable all, thus SSLv2, SSLv3, TLSv1, TLSv1.1 and TLSv1.2 (TLSv1.1 and TLSv1.2 only -if Zarafa was linked against OpenSSL 1.0.1 or later). Since SSLv2 has known protocol weaknesses it -never should be enabled - but for Zarafa it currently must be enabled to support TLSv1 and better. - -This patch introduces the new setting "ssl_protocols" which replaces "ssl_enable_v2". The default -is "!SSLv2" to simply disable SSLv2 by default. The setting can be filled either with SSL protocols -that shall be enabled and/or disabled, e.g. "SSLv3 TLSv1" or "!SSLv2 !SSLv3". However only the more -usual disable/exclude option should be used as this does not exclude future protocols by default. - -Further this patch introduces the completely new setting "ssl_ciphers". This one allows to set SSL -cipher suites. Right now, all SSL ciphers are accepted which is just weak or might Zarafa even make -even vulnerable to known SSL attacks. The German Federal Office for Information Security (BSI) says -that RC4 should not be used anymore - but Zarafa does it by default. And without this patch there -is also no way for Zarafa administrators to avoid that. Indeed this setting has the risk to get the -administrators ending up in a cipher mismatch between different systems but this new setting still -could be declared as officially unsupported and only for the brave ones who know what they do. Thus -the default is already set to something less weak than before but still below BSI recommendations. - -Finally this patch introduces the also new setting "ssl_prefer_server_ciphers". It does what it is -named after: When choosing a cipher during an SSL/TLS handshake, normally the client's preference -is used. If this setting is enabled, the server's preference will be used instead. This comes handy -to administrators for strange cipher orderings required for special configurations and clients - or -new weaknesses where workarounds are required for the time being. - -Testing: Configure zarafa-gateway, zarafa-ical and zarafa-server for cleartext and SSL as usual. -Try to login via POP3S, IMAPS, CalDAV-SSL and MAPI in SOAP over HTTPS. Change SSL protocols and the -ciphers to something more weak ("SSLv2" and "LOW") or to something more strong ("TLSv1.2" and e.g. -"HIGH"). During all my tests I did not figure out any newly introduced issue or Zarafa breakage. - -Important: The technical implementation of this patch might be not perfect as I am not really a C/ -C++ developer. The logic and the implementation is heavily based on Dovecot, Postfix and hints from -https://docs.fedoraproject.org/en-US/Fedora_Security_Team/html/Defensive_Coding/. There should be -a code review and code clean up by an experienced C/C++ developer before merging into Zarafa core. - -This patch should be only applied in conjuction with the POP3 RESP-CODES and AUTH-RESP-CODE patch, -the POP3 CAPA (CAPABILITIES) patch as well as the POP3 STLS (STARTTLS) patch applied before. - ---- zarafa-7.1.10/caldav/CalDAV.cpp 2014-05-23 15:56:36.000000000 +0200 -+++ zarafa-7.1.10/caldav/CalDAV.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -220,7 +220,9 @@ - { "log_timestamp", "1" }, - { "ssl_private_key_file", "/etc/zarafa/ical/privkey.pem" }, - { "ssl_certificate_file", "/etc/zarafa/ical/cert.pem" }, -- { "ssl_enable_v2", "no" }, -+ { "ssl_protocols", "!SSLv2" }, -+ { "ssl_ciphers", "ALL:!LOW:!SSLv2:!EXP:!aNULL" }, -+ { "ssl_prefer_server_ciphers", "no" }, - { "ssl_verify_client", "no" }, - { "ssl_verify_file", "" }, - { "ssl_verify_path", "" }, ---- zarafa-7.1.10/common/ECChannel.cpp 2014-05-23 15:56:36.000000000 +0200 -+++ zarafa-7.1.10/common/ECChannel.cpp.rsc 2014-08-12 19:48:00.000000000 +0200 -@@ -92,6 +92,11 @@ - HRESULT hr = hrSuccess; - char *szFile = NULL; - char *szPath = NULL; -+ char *ssl_protocols = strdup(lpConfig->GetSetting("ssl_protocols")); -+ char *ssl_ciphers = lpConfig->GetSetting("ssl_ciphers"); -+ char *ssl_name; -+ int ssl_proto, ssl_op = 0, ssl_include = 0, ssl_exclude = 0; -+ bool ssl_neg; - - if (lpConfig == NULL) { - hr = MAPI_E_CALL_FAILED; -@@ -107,11 +112,79 @@ - SSL_load_error_strings(); - lpCTX = SSL_CTX_new(SSLv23_server_method()); - SSL_CTX_set_options(lpCTX, SSL_OP_ALL); -- SSL_CTX_set_default_verify_paths(lpCTX); - -- // disable SSLv2 support -- if (!parseBool(lpConfig->GetSetting("ssl_enable_v2", "", "no"))) -- SSL_CTX_set_options(lpCTX, SSL_OP_NO_SSLv2); -+ ssl_name = strtok(ssl_protocols, " "); -+ while(ssl_name != NULL) { -+ if (*ssl_name != '!') -+ ssl_neg = FALSE; -+ else { -+ ssl_name++; -+ ssl_neg = TRUE; -+ } -+ -+ if (strcasecmp(ssl_name, SSL_TXT_SSLV2) == 0) -+ ssl_proto = 0x01; -+ else if (strcasecmp(ssl_name, SSL_TXT_SSLV3) == 0) -+ ssl_proto = 0x02; -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1) == 0) -+ ssl_proto = 0x04; -+#ifdef SSL_TXT_TLSV1_1 -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1_1) == 0) -+ ssl_proto = 0x08; -+#endif -+#ifdef SSL_TXT_TLSV1_2 -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1_2) == 0) -+ ssl_proto = 0x10; -+#endif -+ else { -+ lpLogger->Log(EC_LOGLEVEL_ERROR, "Unknown protocol '%s' in ssl_protocols setting", ssl_name); -+ hr = MAPI_E_CALL_FAILED; -+ goto exit; -+ } -+ -+ if (ssl_neg) -+ ssl_exclude |= ssl_proto; -+ else -+ ssl_include |= ssl_proto; -+ -+ ssl_name = strtok(NULL, " "); -+ } -+ -+ if (ssl_include != 0) { -+ // Exclude everything, except those that are included (and let excludes still override those) -+ ssl_exclude |= 0x1f & ~ssl_include; -+ } -+ -+ if ((ssl_exclude & 0x01) != 0) -+ ssl_op |= SSL_OP_NO_SSLv2; -+ if ((ssl_exclude & 0x02) != 0) -+ ssl_op |= SSL_OP_NO_SSLv3; -+ if ((ssl_exclude & 0x04) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1; -+#ifdef SSL_OP_NO_TLSv1_1 -+ if ((ssl_exclude & 0x08) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1_1; -+#endif -+#ifdef SSL_OP_NO_TLSv1_2 -+ if ((ssl_exclude & 0x10) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1_2; -+#endif -+ -+ if (ssl_protocols) { -+ SSL_CTX_set_options(lpCTX, ssl_op); -+ } -+ -+ if (ssl_ciphers && SSL_CTX_set_cipher_list(lpCTX, ssl_ciphers) != 1) { -+ lpLogger->Log(EC_LOGLEVEL_ERROR, "Can not set SSL cipher list to '%s': %s", ssl_ciphers, ERR_error_string(ERR_get_error(), 0)); -+ hr = MAPI_E_CALL_FAILED; -+ goto exit; -+ } -+ -+ if (parseBool(lpConfig->GetSetting("ssl_prefer_server_ciphers"))) { -+ SSL_CTX_set_options(lpCTX, SSL_OP_CIPHER_SERVER_PREFERENCE); -+ } -+ -+ SSL_CTX_set_default_verify_paths(lpCTX); - - if (SSL_CTX_use_certificate_chain_file(lpCTX, lpConfig->GetSetting("ssl_certificate_file")) != 1) { - lpLogger->Log(EC_LOGLEVEL_ERROR, "SSL CTX certificate file error: %s", ERR_error_string(ERR_get_error(), 0)); ---- zarafa-7.1.10/doc/manual.xml 2014-05-23 15:01:13.000000000 +0200 -+++ zarafa-7.1.10/doc/manual.xml.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -4226,11 +4226,33 @@ - - - -- -+ - -- Incoming SSL connections normally are v3. -- Default: no -- -+ Disabled or enabled protocol names. Supported protocol names -+ are SSLv2, SSLv3 -+ and TLSv1. If Zarafa was linked against -+ OpenSSL 1.0.1 or later there is additional support for the new protocols -+ TLSv1.1 and TLSv1.2. -+ To exclude both, SSLv2 and SSLv3 set -+ to !SSLv2 !SSLv3. SSLv2 is considered unsafe -+ and these connections should not be accepted. -+ Default: !SSLv2 -+ -+ -+ -+ -+ -+ -+ SSL ciphers to use, set to ALL for backward compatibility. -+ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+ -+ -+ -+ -+ -+ Prefer the server's order of SSL ciphers over client's. -+ Default: no - - - -@@ -8070,11 +8092,32 @@ - - - -- -+ -+ -+ Disabled or enabled protocol names. Supported protocol names -+ are SSLv2, SSLv3 -+ and TLSv1. If Zarafa was linked against -+ OpenSSL 1.0.1 or later there is additional support for the new protocols -+ TLSv1.1 and TLSv1.2. -+ To exclude both, SSLv2 and SSLv3 set -+ to !SSLv2 !SSLv3. SSLv2 is considered unsafe -+ and these connections should not be accepted. -+ Default: !SSLv2 -+ -+ -+ -+ -+ -+ -+ SSL ciphers to use, set to ALL for backward compatibility. -+ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+ -+ -+ -+ - -- Accept SSLv2 only connections. SSLv2 is considered -- unsafe, and these connections should not be -- accepted. -+ Prefer the server's order of SSL ciphers over client's. - Default: no - - -@@ -10075,11 +10118,32 @@ - - - -- -+ -+ -+ Disabled or enabled protocol names. Supported protocol names -+ are SSLv2, SSLv3 -+ and TLSv1. If Zarafa was linked against -+ OpenSSL 1.0.1 or later there is additional support for the new protocols -+ TLSv1.1 and TLSv1.2. -+ To exclude both, SSLv2 and SSLv3 set -+ to !SSLv2 !SSLv3. SSLv2 is considered unsafe -+ and these connections should not be accepted. -+ Default: !SSLv2 -+ -+ -+ -+ -+ -+ -+ SSL ciphers to use, set to ALL for backward compatibility. -+ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+ -+ -+ -+ - -- Accept SSLv2 only connections. SSLv2 is considered -- unsafe, and these connections should not be -- accepted. -+ Prefer the server's order of SSL ciphers over client's. - Default: no - - ---- zarafa-7.1.10/gateway/Gateway.cpp 2014-05-23 15:56:37.000000000 +0200 -+++ zarafa-7.1.10/gateway/Gateway.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -365,7 +365,9 @@ - { "ssl_verify_client", "no" }, - { "ssl_verify_file", "" }, - { "ssl_verify_path", "" }, -- { "ssl_enable_v2", "no" }, -+ { "ssl_protocols", "!SSLv2" }, -+ { "ssl_ciphers", "ALL:!LOW:!SSLv2:!EXP:!aNULL" }, -+ { "ssl_prefer_server_ciphers", "no" }, - { "log_method", "file" }, - { "log_file", "-" }, - { "log_level", "2", CONFIGSETTING_RELOADABLE }, ---- zarafa-7.1.10/installer/linux/gateway.cfg 2014-05-23 15:03:19.000000000 +0200 -+++ zarafa-7.1.10/installer/linux/gateway.cfg.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -84,8 +84,14 @@ - ssl_verify_file = - ssl_verify_path = - --# Accept SSLv2 only incoming connections --ssl_enable_v2 = no -+# SSL protocols to use, set to '!SSLv2' for 'ssl_enable_v2 = no' -+ssl_protocols = !SSLv2 -+ -+# SSL ciphers to use, set to 'ALL' for backward compatibility -+ssl_ciphers = ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+# Prefer the server's order of SSL ciphers over client's -+ssl_prefer_server_ciphers = no - - # Process model, using pthreads (thread) or processes (fork) - process_model = fork ---- zarafa-7.1.10/installer/linux/ical.cfg 2014-05-23 15:03:19.000000000 +0200 -+++ zarafa-7.1.10/installer/linux/ical.cfg.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -66,8 +66,14 @@ - ssl_verify_file = - ssl_verify_path = - --# Accept SSLv2 only incoming connections --ssl_enable_v2 = no -+# SSL protocols to use, set to '!SSLv2' for 'ssl_enable_v2 = no' -+ssl_protocols = !SSLv2 -+ -+# SSL ciphers to use, set to 'ALL' for backward compatibility -+ssl_ciphers = ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+# Prefer the server's order of SSL ciphers over client's -+ssl_prefer_server_ciphers = no - - ############################################################## - # OTHER ICAL SETTINGS ---- zarafa-7.1.10/installer/linux/server.cfg 2014-05-23 15:03:19.000000000 +0200 -+++ zarafa-7.1.10/installer/linux/server.cfg.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -154,8 +154,14 @@ - # Path with CA certificates, e.g. /etc/ssl/certs - server_ssl_ca_path = - --# Accept SSLv2 only connections. Normally v3 connections are used. --server_ssl_enable_v2 = no -+# SSL protocols to use, set to '!SSLv2' for 'server_ssl_enable_v2 = no' -+server_ssl_protocols = !SSLv2 -+ -+# SSL ciphers to use, set to 'ALL' for backward compatibility -+server_ssl_ciphers = ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+# Prefer the server's order of SSL ciphers over client's -+server_ssl_prefer_server_ciphers = no - - # Path of SSL Public keys of clients - sslkeys_path = /etc/zarafa/sslkeys ---- zarafa-7.1.10/provider/server/ECServer.cpp 2014-05-23 15:56:37.000000000 +0200 -+++ zarafa-7.1.10/provider/server/ECServer.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -919,7 +919,9 @@ - { "server_ssl_key_pass", "server", CONFIGSETTING_EXACT }, - { "server_ssl_ca_file", "/etc/zarafa/ssl/cacert.pem" }, - { "server_ssl_ca_path", "" }, -- { "server_ssl_enable_v2", "no" }, -+ { "server_ssl_protocols", "!SSLv2" }, -+ { "server_ssl_ciphers", "ALL:!LOW:!SSLv2:!EXP:!aNULL" }, -+ { "server_ssl_prefer_server_ciphers", "no" }, - { "sslkeys_path", "/etc/zarafa/sslkeys" }, // login keys - // Database options - { "database_engine", "mysql" }, ---- zarafa-7.1.10/provider/server/ECSoapServerConnection.cpp 2014-05-23 15:56:37.000000000 +0200 -+++ zarafa-7.1.10/provider/server/ECSoapServerConnection.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -240,6 +240,11 @@ - ECRESULT er = erSuccess; - int socket = SOAP_INVALID_SOCKET; - struct soap *lpsSoap = NULL; -+ char *server_ssl_protocols = strdup(m_lpConfig->GetSetting("server_ssl_protocols")); -+ char *server_ssl_ciphers = m_lpConfig->GetSetting("server_ssl_ciphers"); -+ char *ssl_name; -+ int ssl_proto, ssl_op = 0, ssl_include = 0, ssl_exclude = 0; -+ bool ssl_neg; - - if(lpServerName == NULL) { - er = ZARAFA_E_INVALID_PARAMETER; -@@ -270,10 +275,79 @@ - goto exit; - } - -- // disable SSLv2 support -- if (!parseBool(m_lpConfig->GetSetting("server_ssl_enable_v2", "", "no"))) -- SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_NO_SSLv2); -- -+ SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_ALL); -+ -+ ssl_name = strtok(server_ssl_protocols, " "); -+ while(ssl_name != NULL) { -+ if (*ssl_name != '!') -+ ssl_neg = FALSE; -+ else { -+ ssl_name++; -+ ssl_neg = TRUE; -+ } -+ -+ if (strcasecmp(ssl_name, SSL_TXT_SSLV2) == 0) -+ ssl_proto = 0x01; -+ else if (strcasecmp(ssl_name, SSL_TXT_SSLV3) == 0) -+ ssl_proto = 0x02; -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1) == 0) -+ ssl_proto = 0x04; -+#ifdef SSL_TXT_TLSV1_1 -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1_1) == 0) -+ ssl_proto = 0x08; -+#endif -+#ifdef SSL_TXT_TLSV1_2 -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1_2) == 0) -+ ssl_proto = 0x10; -+#endif -+ else { -+ m_lpLogger->Log(EC_LOGLEVEL_FATAL, "Unknown protocol '%s' in server_ssl_protocols setting", ssl_name); -+ er = ZARAFA_E_CALL_FAILED; -+ goto exit; -+ } -+ -+ if (ssl_neg) -+ ssl_exclude |= ssl_proto; -+ else -+ ssl_include |= ssl_proto; -+ -+ ssl_name = strtok(NULL, " "); -+ } -+ -+ if (ssl_include != 0) { -+ // Exclude everything, except those that are included (and let excludes still override those) -+ ssl_exclude |= 0x1f & ~ssl_include; -+ } -+ -+ if ((ssl_exclude & 0x01) != 0) -+ ssl_op |= SSL_OP_NO_SSLv2; -+ if ((ssl_exclude & 0x02) != 0) -+ ssl_op |= SSL_OP_NO_SSLv3; -+ if ((ssl_exclude & 0x04) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1; -+#ifdef SSL_OP_NO_TLSv1_1 -+ if ((ssl_exclude & 0x08) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1_1; -+#endif -+#ifdef SSL_OP_NO_TLSv1_2 -+ if ((ssl_exclude & 0x10) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1_2; -+#endif -+ -+ if (server_ssl_protocols) { -+ SSL_CTX_set_options(lpsSoap->ctx, ssl_op); -+ } -+ -+ if (server_ssl_ciphers && SSL_CTX_set_cipher_list(lpsSoap->ctx, server_ssl_ciphers) != 1) { -+ m_lpLogger->Log(EC_LOGLEVEL_FATAL, "Can not set SSL cipher list to '%s': %s", server_ssl_ciphers, ERR_error_string(ERR_get_error(), 0)); -+ er = ZARAFA_E_CALL_FAILED; -+ goto exit; -+ } -+ -+ if (parseBool(m_lpConfig->GetSetting("server_ssl_prefer_server_ciphers"))) { -+ SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_CIPHER_SERVER_PREFERENCE); -+ } -+ - // request certificate from client, is OK if not present. - SSL_CTX_set_verify(lpsSoap->ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, NULL); - diff --git a/zarafa-7.1.11-plaintext_auth_localhost.patch b/zarafa-7.1.11-plaintext_auth_localhost.patch index 9b6aae0..c5fefd3 100644 --- a/zarafa-7.1.11-plaintext_auth_localhost.patch +++ b/zarafa-7.1.11-plaintext_auth_localhost.patch @@ -15,6 +15,9 @@ Important: The technical implementation of this patch might be not perfect as I C++ developer. There should be a code review by an experienced C/C++ developer before merging into Zarafa core. +Proposed to upstream via e-mail on Thu, 16 Oct 2014 00:00:05 +0200, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12473. + --- zarafa-7.1.11/gateway/IMAP.cpp 2014-09-03 10:45:06.000000000 +0200 +++ zarafa-7.1.11/gateway/IMAP.cpp.plaintext_auth_localhost 2014-09-24 01:29:10.000000000 +0200 @@ -757,7 +757,7 @@ diff --git a/zarafa-7.1.11-vacation-headers.patch b/zarafa-7.1.11-vacation-headers.patch new file mode 100644 index 0000000..924ff1d --- /dev/null +++ b/zarafa-7.1.11-vacation-headers.patch @@ -0,0 +1,32 @@ +Patch by Robert Scheck for Zarafa >= 7.1.11 which restricts replies by +zarafa-autorespond to automated processes and mailing lists according to RFC 5230, section 4.6. For +further details please have a look to http://tools.ietf.org/html/rfc5230#page-8 as well. + +Proposed to upstream via e-mail on Wed, 27 Aug 2014 23:30:31 +0200, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12590. + +--- zarafa-7.1.11/spooler/DAgent.cpp 2014-08-24 12:27:06.000000000 +0200 ++++ zarafa-7.1.11/spooler/DAgent.cpp.vacation-headers 2014-08-27 23:20:18.000000000 +0200 +@@ -1422,11 +1422,19 @@ + + // See if we're looping + if (lpMessageProps[0].ulPropTag == PR_TRANSPORT_MESSAGE_HEADERS_A) { +- if ( (strstr(lpMessageProps[0].Value.lpszA, "X-Zarafa-Vacation:") != NULL) || +- (strstr(lpMessageProps[0].Value.lpszA, "Auto-Submitted:") != NULL) || +- (strstr(lpMessageProps[0].Value.lpszA, "Precedence:") != NULL) ) ++ if ( (strstr(lpMessageProps[0].Value.lpszA, "X-Zarafa-Vacation:") != NULL) || // Zarafa ++ (strstr(lpMessageProps[0].Value.lpszA, "Auto-Submitted:") != NULL) || // RFC 3834 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Id:") != NULL) || // RFC 2919 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Help:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Subscribe:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Unsubscribe:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Post:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Owner:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Archive:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "Precedence:") != NULL) ) // RFC 3834 + // Vacation header already present, do not send vacation reply + // Precedence: list/bulk/junk, do not reply to these mails ++ // See also http://tools.ietf.org/html/rfc5230#page-8 for details + goto exit; + // save headers to a file so they can also be tested from the script we're runing + snprintf(szTemp, PATH_MAX, "%s/autorespond-headers.XXXXXX", getenv("TEMP") == NULL ? "/tmp" : getenv("TEMP")); diff --git a/zarafa-7.1.11-vacation-headers2.patch b/zarafa-7.1.11-vacation-headers2.patch new file mode 100644 index 0000000..7fcae17 --- /dev/null +++ b/zarafa-7.1.11-vacation-headers2.patch @@ -0,0 +1,44 @@ +Patch by Robert Scheck for Zarafa >= 7.1.11 which adds anti-loop headers +for automatic responses by zarafa-autorespond for Microsoft Exchange and all vacation(1) compatible +implementations. + +For the Microsoft Exchange related part useful links are: + - http://msdn.microsoft.com/en-us/library/ee219609(v=exchg.80).aspx + - https://www.jitbit.com/maxblog/18-detecting-outlook-autoreplyout-of-office-emails-and-x-auto-response-suppress-header/ + +For vacation(1) compatible implementations useful links are: + - http://www.daemon-systems.org/man/vacation.1.html + - Book "sendmail" (written by Bryan Costales, Claus Assmann, George Jansen, Gregory Neil Shapiro), ISBN 0596555342 + +Proposed to upstream via e-mail on Wed, 27 Aug 2014 23:59:58 +0200, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12591. + +--- zarafa-7.1.11/spooler/DAgent.cpp 2014-08-24 12:27:06.000000000 +0200 ++++ zarafa-7.1.11/spooler/DAgent.cpp.vacation-headers2 2014-08-27 23:52:42.000000000 +0200 +@@ -1469,12 +1469,25 @@ + if (hr != hrSuccess) + goto exit; + +- // add anti-loop header ++ // add anti-loop header for Zarafa + snprintf(szHeader, PATH_MAX, "\nX-Zarafa-Vacation: autorespond"); + hr = WriteOrLogError(fd, szHeader, strlen(szHeader)); + if (hr != hrSuccess) + goto exit; + ++ // add anti-loop header for Exchange, see http://msdn.microsoft.com/en-us/library/ee219609(v=exchg.80).aspx ++ snprintf(szHeader, PATH_MAX, "\nX-Auto-Response-Suppress: All"); ++ hr = WriteOrLogError(fd, szHeader, strlen(szHeader)); ++ if (hr != hrSuccess) ++ goto exit; ++ ++ // add anti-loop header for vacation(1) compatible implementations, see section 10.9 of book "sendmail" (written ++ // by Bryan Costales, Claus Assmann, George Jansen, Gregory Neil Shapiro), ISBN 0596555342 ++ snprintf(szHeader, PATH_MAX, "\nPrecedence: bulk"); ++ hr = WriteOrLogError(fd, szHeader, strlen(szHeader)); ++ if (hr != hrSuccess) ++ goto exit; ++ + if (lpMessageProps[3].ulPropTag == PR_SUBJECT_W) { + // convert as one string because of [] characters + swprintf(szwHeader, PATH_MAX, L"%ls [%ls]", szSubject, lpMessageProps[3].Value.lpszW); diff --git a/zarafa-7.1.11-webaccess-fail2ban.patch b/zarafa-7.1.11-webaccess-fail2ban.patch new file mode 100644 index 0000000..3c2b5c3 --- /dev/null +++ b/zarafa-7.1.11-webaccess-fail2ban.patch @@ -0,0 +1,21 @@ +Patch by Robert Scheck for Zarafa <= 7.1.11 which logs authentication +failures of Zarafa WebAccess into the error log of the webserver. This is basically a backport of +https://jira.zarafa.com/browse/WA-6908 from WebApp to WebAccess. In difference to original patch +there is no inappropriate space before a punctuation mark also known as "plenken". + +Proposed to upstream via e-mail on Wed, 13 Aug 2014 22:56:09 +0200, initial patch was put into the +upstream ticket https://jira.zarafa.com/browse/ZCP-12543. + +--- zarafa-7.1.11/php-webclient-ajax/client/login.php 2014-09-03 10:45:06.000000000 +0200 ++++ zarafa-7.1.11/php-webclient-ajax/client/login.php 2015-02-18 01:08:13.000000000 +0100 +@@ -86,6 +86,10 @@ + switch($_SESSION["hresult"]){ + case MAPI_E_LOGON_FAILED: + case MAPI_E_UNCONFIGURED: ++ // Print error message to error_log of webserver ++ if (!empty($_POST["username"])) { ++ error_log('user '.$_POST["username"].': authentication failure at MAPI'); ++ } + echo _("Logon failed, please check your name/password."); + break; + case MAPI_E_NETWORK_ERROR: diff --git a/zarafa-7.1.12-gcc5.patch b/zarafa-7.1.12-gcc5.patch new file mode 100644 index 0000000..02eecfc --- /dev/null +++ b/zarafa-7.1.12-gcc5.patch @@ -0,0 +1,2185 @@ +Patch by Robert Scheck for zarafa >= 7.1.12 which updates autoconf/boost.m4 to +avoid build failures like "configure: error: invalid value: boost_major_version=" when building using the +GCC 5.x. The second part of the patch just avoids running autoconf and is the generated result. + +--- zarafa-7.1.12/autoconf/boost.m4 2015-05-08 14:19:47.000000000 +0200 ++++ zarafa-7.1.12/autoconf/boost.m4.gcc5 2015-07-01 21:46:37.000000000 +0200 +@@ -1,5 +1,5 @@ + # boost.m4: Locate Boost headers and libraries for autoconf-based projects. +-# Copyright (C) 2007, 2008, 2009 Benoit Sigoure ++# Copyright (C) 2007-2011, 2014 Benoit Sigoure + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -22,7 +22,7 @@ + # along with this program. If not, see . + + m4_define([_BOOST_SERIAL], [m4_translit([ +-# serial 12 ++# serial 24 + ], [# + ], [])]) + +@@ -45,17 +45,22 @@ + # Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, + # simply read the README, it will show you what to do step by step. + +-m4_pattern_forbid([^_?BOOST_]) ++m4_pattern_forbid([^_?(BOOST|Boost)_]) + + + # _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, + # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) + # -------------------------------------------------------- + # Same as AC_EGREP_CPP, but leave the result in conftest.i. +-# PATTERN is *not* overquoted, as in AC_EGREP_CPP. It could be useful +-# to turn this into a macro which extracts the value of any macro. ++# ++# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded ++# in double-quotes, so escape your double quotes. ++# ++# It could be useful to turn this into a macro which extracts the ++# value of any macro. + m4_define([_BOOST_SED_CPP], +-[AC_LANG_PREPROC_REQUIRE()dnl ++[AC_LANG_PUSH([C++])dnl ++AC_LANG_PREPROC_REQUIRE()dnl + AC_REQUIRE([AC_PROG_SED])dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) + AS_IF([dnl eval is necessary to expand ac_cpp. +@@ -67,13 +72,31 @@ + dnl boost_cv_lib_version='1_37\r' for instance, which breaks + dnl everything else. + dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK ++dnl ++dnl Beware that GCC 5, when expanding macros, may embed # line directives ++dnl a within single line: ++dnl ++dnl # 1 "conftest.cc" ++dnl # 1 "" ++dnl # 1 "" ++dnl # 1 "conftest.cc" ++dnl # 1 "/opt/local/include/boost/version.hpp" 1 3 ++dnl # 2 "conftest.cc" 2 ++dnl boost-lib-version = ++dnl # 2 "conftest.cc" 3 ++dnl "1_56" ++dnl ++dnl So get rid of the # lines, and glue the remaining ones together. + (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | ++ grep -v '#' | + tr -d '\r' | ++ tr -s '\n' ' ' | + $SED -n -e "$1" >conftest.i 2>&1], + [$3], + [$4]) + rm -rf conftest* +-])# AC_EGREP_CPP ++AC_LANG_POP([C++])dnl ++])# _BOOST_SED_CPP + + + +@@ -98,6 +121,7 @@ + IFS=$boost_save_IFS + shift + boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` ++boost_version_req_string=$[1].$[2].$[3] + AC_ARG_WITH([boost], + [AS_HELP_STRING([--with-boost=DIR], + [prefix of Boost $1 @<:@guess@:>@])])dnl +@@ -113,9 +137,9 @@ + fi + fi + AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], +- ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"]) ++ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl + boost_save_CPPFLAGS=$CPPFLAGS +- AC_CACHE_CHECK([for Boost headers version >= $boost_version_req], ++ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string], + [boost_cv_inc_path], + [boost_cv_inc_path=no + AC_LANG_PUSH([C++])dnl +@@ -183,7 +207,7 @@ + ]) + case $boost_cv_inc_path in #( + no) +- boost_errmsg="cannot find Boost headers version >= $boost_version_req" ++ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string" + m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])], + [AC_MSG_NOTICE([$boost_errmsg])]) + $2 +@@ -192,21 +216,16 @@ + BOOST_CPPFLAGS= + ;;#( + *) +- AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"]) +- ;; +- esac +- case $boost_cv_inc_path in #( +- no) +- ;;#( +- *) +- AC_DEFINE([HAVE_BOOST], [1], +- [Defined if the requested minimum BOOST version is satisfied]) ++ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl + ;; + esac ++ if test x"$boost_cv_inc_path" != xno; then ++ AC_DEFINE([HAVE_BOOST], [1], ++ [Defined if the requested minimum BOOST version is satisfied]) + AC_CACHE_CHECK([for Boost's header version], + [boost_cv_lib_version], + [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl +- _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;g;}], ++ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]], + [#include + boost-lib-version = BOOST_LIB_VERSION], + [boost_cv_lib_version=`cat conftest.i`])]) +@@ -214,23 +233,26 @@ + boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` + case $boost_major_version in #( + '' | *[[!0-9]]*) +- AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version]) ++ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version']) + ;; + esac ++fi + CPPFLAGS=$boost_save_CPPFLAGS + ])# BOOST_REQUIRE + ++ + # BOOST_STATIC() + # -------------- + # Add the "--enable-static-boost" configure argument. If this argument is given + # on the command line, static versions of the libraries will be looked up. + AC_DEFUN([BOOST_STATIC], + [AC_ARG_ENABLE([static-boost], +- [AC_HELP_STRING([--enable-static-boost], ++ [AS_HELP_STRING([--enable-static-boost], + [Prefer the static boost libraries over the shared ones [no]])], + [enable_static_boost=yes], + [enable_static_boost=no])])# BOOST_STATIC + ++ + # BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) + # -------------------------------------------------------------------------- + # Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for +@@ -263,14 +285,16 @@ + ])# BOOST_FIND_HEADER + + +-# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], +-# [CXX-PROLOGUE]) +-# ------------------------------------------------------------------------- +-# Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for +-# libboost_thread). Check that HEADER-NAME works and check that +-# libboost_LIB-NAME can link with the code CXX-TEST. The optional argument +-# CXX-PROLOGUE can be used to include some C++ code before the `main' +-# function. ++# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES], ++# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], ++# [CXX-PROLOGUE]) ++# -------------------------------------------------------------- ++# Look for the Boost library COMPONENT-NAME (e.g., `thread', for ++# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g., ++# "thread_win32 thread"). Check that HEADER-NAME works and check that ++# libboost_LIB-NAME can link with the code CXX-TEST. The optional ++# argument CXX-PROLOGUE can be used to include some C++ code before ++# the `main' function. + # + # Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). + # +@@ -284,7 +308,7 @@ + # builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp + # ... If you want to make sure you have a specific version of Boost + # (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. +-AC_DEFUN([BOOST_FIND_LIB], ++AC_DEFUN([BOOST_FIND_LIBS], + [AC_REQUIRE([BOOST_REQUIRE])dnl + AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl + AC_REQUIRE([BOOST_STATIC])dnl +@@ -296,33 +320,71 @@ + AC_LANG_PUSH([C++])dnl + AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl + AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl ++AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl + AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl +-BOOST_FIND_HEADER([$3]) ++BOOST_FIND_HEADER([$4]) + boost_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +-# Now let's try to find the library. The algorithm is as follows: first look +-# for a given library name according to the user's PREFERRED-RT-OPT. For each +-# library name, we prefer to use the ones that carry the tag (toolset name). +-# Each library is searched through the various standard paths were Boost is +-# usually installed. If we can't find the standard variants, we try to +-# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +-# but there's -obviously- libboost_threads-mt.dylib). + AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], +- [Boost_lib=no +- case "$2" in #( +- mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +- mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #( +- *) boost_mt=; boost_rtopt=$2;; ++ [_BOOST_FIND_LIBS($@)]) ++case $Boost_lib in #( ++ (no) _AC_MSG_LOG_CONFTEST ++ AC_MSG_ERROR([cannot find the flags to link with Boost $1]) ++ ;; ++esac ++AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl ++AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl ++AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl ++AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl ++CPPFLAGS=$boost_save_CPPFLAGS ++AS_VAR_POPDEF([Boost_lib])dnl ++AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl ++AS_VAR_POPDEF([Boost_lib_LDPATH])dnl ++AS_VAR_POPDEF([Boost_lib_LIBS])dnl ++AC_LANG_POP([C++])dnl ++fi ++]) ++ ++ ++# BOOST_FIND_LIB([LIB-NAME], ++# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], ++# [CXX-PROLOGUE]) ++# -------------------------------------------------------------- ++# Backward compatibility wrapper for BOOST_FIND_LIBS. ++AC_DEFUN([BOOST_FIND_LIB], ++[BOOST_FIND_LIBS([$1], $@)]) ++ ++ ++# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES], ++# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], ++# [CXX-PROLOGUE]) ++# -------------------------------------------------------------- ++# Real implementation of BOOST_FIND_LIBS: rely on these local macros: ++# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS ++# ++# The algorithm is as follows: first look for a given library name ++# according to the user's PREFERRED-RT-OPT. For each library name, we ++# prefer to use the ones that carry the tag (toolset name). Each ++# library is searched through the various standard paths were Boost is ++# usually installed. If we can't find the standard variants, we try ++# to enforce -mt (for instance on MacOSX, libboost_thread.dylib ++# doesn't exist but there's -obviously- libboost_thread-mt.dylib). ++AC_DEFUN([_BOOST_FIND_LIBS], ++[Boost_lib=no ++ case "$3" in #( ++ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #( ++ (*) boost_mt=; boost_rtopt=$3;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( +- *d*) boost_rt_d=$boost_rtopt;; #( +- *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ (*d*) boost_rt_d=$boost_rtopt;; #( ++ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( +- *) boost_rt_d='-d';; ++ (*) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" +@@ -333,8 +395,8 @@ + AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) + boost_save_ac_objext=$ac_objext + # Generate the test file. +- AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> +-$5], [$4])]) ++ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4> ++$6], [$5])]) + dnl Optimization hacks: compiling C++ is slow, especially with Boost. What + dnl we're trying to do here is guess the right combination of link flags + dnl (LIBS / LDFLAGS) to use a given library. This can take several +@@ -356,38 +418,42 @@ + [AC_MSG_ERROR([cannot compile a test that uses Boost $1])]) + ac_objext=$boost_save_ac_objext + boost_failed_libs= +-# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +-# matter. ++# Don't bother to ident the following nested for loops, only the 2 ++# innermost ones matter. ++for boost_lib_ in $2; do + for boost_tag_ in -$boost_cv_lib_tag ''; do + for boost_ver_ in -$boost_cv_lib_version ''; do + for boost_mt_ in $boost_mt -mt ''; do + for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ +- boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +- boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \ +- boost_$1$boost_tag_$boost_mt_$boost_ver_ \ +- boost_$1$boost_tag_$boost_ver_ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( +- *@$boost_lib@*) continue;; ++ (*@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ +- /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ +- "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* + do +- test -e "$boost_ldpath" || continue ++ # Don't waste time with directories that don't exist. ++ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++ continue ++ fi + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( +- *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$Boost_lib_LIBS" || continue;; #( +- *) # No: use -lboost_foo to find the shared library. ++ (*) # No: use -lboost_foo to find the shared library. + Boost_lib_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS +@@ -401,8 +467,35 @@ + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$Boost_lib" = xyes; then +- Boost_lib_LDFLAGS="-L$boost_ldpath" +- break 6 ++ # Check or used cached result of whether or not using -R or ++ # -rpath makes sense. Some implementations of ld, such as for ++ # Mac OSX, require -rpath but -R is the flag known to work on ++ # other systems. https://github.com/tsuna/boost.m4/issues/19 ++ AC_CACHE_VAL([boost_cv_rpath_link_ldflag], ++ [case $boost_ldpath in ++ '') # Nothing to do. ++ boost_cv_rpath_link_ldflag= ++ boost_rpath_link_ldflag_found=yes;; ++ *) ++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ LIBS="$boost_save_LIBS $Boost_lib_LIBS" ++ _BOOST_AC_LINK_IFELSE([], ++ [boost_rpath_link_ldflag_found=yes ++ break], ++ [boost_rpath_link_ldflag_found=no]) ++ done ++ ;; ++ esac ++ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"], ++ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])]) ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ ]) ++ test x"$boost_ldpath" != x && ++ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ Boost_lib_LDPATH="$boost_ldpath" ++ break 7 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi +@@ -412,22 +505,10 @@ + done + done + done ++done # boost_lib_ + rm -f conftest.$ac_objext + ]) +-case $Boost_lib in #( +- no) _AC_MSG_LOG_CONFTEST +- AC_MSG_ERROR([cannot not find the flags to link with Boost $1]) +- ;; +-esac +-AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS]) +-AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS]) +-CPPFLAGS=$boost_save_CPPFLAGS +-AS_VAR_POPDEF([Boost_lib])dnl +-AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl +-AS_VAR_POPDEF([Boost_lib_LIBS])dnl +-AC_LANG_POP([C++])dnl +-fi +-])# BOOST_FIND_LIB ++ + + + # --------------------------------------- # +@@ -438,42 +519,155 @@ + # The page http://beta.boost.org/doc/libs is useful: it gives the first release + # version of each library (among other things). + ++# BOOST_DEFUN(LIBRARY, CODE) ++# -------------------------- ++# Define BOOST_ as a macro that runs CODE. ++# ++# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN. ++m4_define([BOOST_DEFUN], ++[m4_indir([AC_DEFUN], ++ m4_toupper([BOOST_$1]), ++[m4_pushdef([BOOST_Library], [$1])dnl ++$2 ++m4_popdef([BOOST_Library])dnl ++]) ++]) ++ + # BOOST_ARRAY() + # ------------- + # Look for Boost.Array +-AC_DEFUN([BOOST_ARRAY], ++BOOST_DEFUN([Array], + [BOOST_FIND_HEADER([boost/array.hpp])]) + + + # BOOST_ASIO() + # ------------ + # Look for Boost.Asio (new in Boost 1.35). +-AC_DEFUN([BOOST_ASIO], ++BOOST_DEFUN([Asio], + [AC_REQUIRE([BOOST_SYSTEM])dnl + BOOST_FIND_HEADER([boost/asio.hpp])]) + + + # BOOST_BIND() + # ------------ +-# Look for Boost.Bind +-AC_DEFUN([BOOST_BIND], ++# Look for Boost.Bind. ++BOOST_DEFUN([Bind], + [BOOST_FIND_HEADER([boost/bind.hpp])]) + + ++# BOOST_CHRONO() ++# -------------- ++# Look for Boost.Chrono. ++BOOST_DEFUN([Chrono], ++[# Do we have to check for Boost.System? This link-time dependency was ++# added as of 1.35.0. If we have a version <1.35, we must not attempt to ++# find Boost.System as it didn't exist by then. ++if test $boost_major_version -ge 135; then ++ BOOST_SYSTEM([$1]) ++fi # end of the Boost.System check. ++boost_filesystem_save_LIBS=$LIBS ++boost_filesystem_save_LDFLAGS=$LDFLAGS ++m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl ++LIBS="$LIBS $BOOST_SYSTEM_LIBS" ++LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" ++BOOST_FIND_LIB([chrono], [$1], ++ [boost/chrono.hpp], ++ [boost::chrono::thread_clock d;]) ++if test $enable_static_boost = yes && test $boost_major_version -ge 135; then ++ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS" ++fi ++LIBS=$boost_filesystem_save_LIBS ++LDFLAGS=$boost_filesystem_save_LDFLAGS ++])# BOOST_CHRONO ++ ++ ++# BOOST_CONTEXT([PREFERRED-RT-OPT]) ++# ----------------------------------- ++# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. This library was introduced in Boost ++# 1.51.0 ++BOOST_DEFUN([Context], ++[BOOST_FIND_LIB([context], [$1], ++ [boost/context/all.hpp],[[ ++// creates a stack ++void * stack_pointer = new void*[4096]; ++std::size_t const size = sizeof(void*[4096]); ++ ++// context fc uses f() as context function ++// fcontext_t is placed on top of context stack ++// a pointer to fcontext_t is returned ++fc = ctx::make_fcontext(stack_pointer, size, f); ++return ctx::jump_fcontext(&fcm, fc, 3) == 6;]],[dnl ++namespace ctx = boost::context; ++// context ++static ctx::fcontext_t fcm, *fc; ++// context-function ++static void f(intptr_t i) { ++ ctx::jump_fcontext(fc, &fcm, i * 2); ++}]) ++])# BOOST_CONTEXT ++ ++ + # BOOST_CONVERSION() + # ------------------ + # Look for Boost.Conversion (cast / lexical_cast) +-AC_DEFUN([BOOST_CONVERSION], ++BOOST_DEFUN([Conversion], + [BOOST_FIND_HEADER([boost/cast.hpp]) + BOOST_FIND_HEADER([boost/lexical_cast.hpp]) + ])# BOOST_CONVERSION + + ++# BOOST_COROUTINE([PREFERRED-RT-OPT]) ++# ----------------------------------- ++# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. This library was introduced in Boost ++# 1.53.0 ++BOOST_DEFUN([Coroutine], ++[ ++boost_coroutine_save_LIBS=$LIBS ++boost_coroutine_save_LDFLAGS=$LDFLAGS ++# Link-time dependency from coroutine to context ++BOOST_CONTEXT([$1]) ++# Starting from Boost 1.55 a dependency on Boost.System is added ++if test $boost_major_version -ge 155; then ++ BOOST_SYSTEM([$1]) ++fi ++m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)]) ++LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS" ++LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS" ++ ++BOOST_FIND_LIB([coroutine], [$1], ++ [boost/coroutine/coroutine.hpp], ++ [boost::coroutines::coroutine< int(int) > coro; coro.empty();]) ++ ++# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54 ++# coroutine doesn't use context from its headers but from its library. ++if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then ++ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS" ++ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS" ++fi ++if test $enable_static_boost = yes && test $boost_major_version -ge 155; then ++ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS" ++ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS" ++fi ++LIBS=$boost_coroutine_save_LIBS ++LDFLAGS=$boost_coroutine_save_LDFLAGS ++])# BOOST_COROUTINE ++ ++ ++# BOOST_CRC() ++# ----------- ++# Look for Boost.CRC ++BOOST_DEFUN([CRC], ++[BOOST_FIND_HEADER([boost/crc.hpp]) ++])# BOOST_CRC ++ ++ + # BOOST_DATE_TIME([PREFERRED-RT-OPT]) + # ----------------------------------- + # Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_DATE_TIME], ++BOOST_DEFUN([Date_Time], + [BOOST_FIND_LIB([date_time], [$1], + [boost/date_time/posix_time/posix_time.hpp], + [boost::posix_time::ptime t;]) +@@ -486,12 +680,12 @@ + # the documentation of BOOST_FIND_LIB above. + # Do not check for boost/filesystem.hpp because this file was introduced in + # 1.34. +-AC_DEFUN([BOOST_FILESYSTEM], ++BOOST_DEFUN([Filesystem], + [# Do we have to check for Boost.System? This link-time dependency was + # added as of 1.35.0. If we have a version <1.35, we must not attempt to + # find Boost.System as it didn't exist by then. + if test $boost_major_version -ge 135; then +-BOOST_SYSTEM([$1]) ++ BOOST_SYSTEM([$1]) + fi # end of the Boost.System check. + boost_filesystem_save_LIBS=$LIBS + boost_filesystem_save_LDFLAGS=$LDFLAGS +@@ -500,71 +694,125 @@ + LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" + BOOST_FIND_LIB([filesystem], [$1], + [boost/filesystem/path.hpp], [boost::filesystem::path p;]) ++if test $enable_static_boost = yes && test $boost_major_version -ge 135; then ++ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" ++fi + LIBS=$boost_filesystem_save_LIBS + LDFLAGS=$boost_filesystem_save_LDFLAGS + ])# BOOST_FILESYSTEM + + ++# BOOST_FLYWEIGHT() ++# ----------------- ++# Look for Boost.Flyweight. ++BOOST_DEFUN([Flyweight], ++[dnl There's a hidden dependency on pthreads. ++AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl ++BOOST_FIND_HEADER([boost/flyweight.hpp]) ++AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag]) ++]) ++ ++ + # BOOST_FOREACH() + # --------------- +-# Look for Boost.Foreach +-AC_DEFUN([BOOST_FOREACH], ++# Look for Boost.Foreach. ++BOOST_DEFUN([Foreach], + [BOOST_FIND_HEADER([boost/foreach.hpp])]) + + + # BOOST_FORMAT() + # -------------- +-# Look for Boost.Format ++# Look for Boost.Format. + # Note: we can't check for boost/format/format_fwd.hpp because the header isn't + # standalone. It can't be compiled because it triggers the following error: + # boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' + # does not name a type +-AC_DEFUN([BOOST_FORMAT], ++BOOST_DEFUN([Format], + [BOOST_FIND_HEADER([boost/format.hpp])]) + + + # BOOST_FUNCTION() + # ---------------- + # Look for Boost.Function +-AC_DEFUN([BOOST_FUNCTION], ++BOOST_DEFUN([Function], + [BOOST_FIND_HEADER([boost/function.hpp])]) + + ++# BOOST_GEOMETRY() ++# ---------------- ++# Look for Boost.Geometry (new since 1.47.0). ++BOOST_DEFUN([Geometry], ++[BOOST_FIND_HEADER([boost/geometry.hpp]) ++])# BOOST_GEOMETRY ++ ++ + # BOOST_GRAPH([PREFERRED-RT-OPT]) + # ------------------------------- + # Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_GRAPH], ++BOOST_DEFUN([Graph], + [BOOST_FIND_LIB([graph], [$1], + [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) + ])# BOOST_GRAPH + + + # BOOST_IOSTREAMS([PREFERRED-RT-OPT]) +-# ------------------------------- ++# ----------------------------------- + # Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_IOSTREAMS], ++BOOST_DEFUN([IOStreams], + [BOOST_FIND_LIB([iostreams], [$1], + [boost/iostreams/device/file_descriptor.hpp], +- [boost::iostreams::file_descriptor fd(0); fd.close();]) ++ [boost::iostreams::file_descriptor fd; fd.close();]) + ])# BOOST_IOSTREAMS + + + # BOOST_HASH() + # ------------ + # Look for Boost.Functional/Hash +-AC_DEFUN([BOOST_HASH], ++BOOST_DEFUN([Hash], + [BOOST_FIND_HEADER([boost/functional/hash.hpp])]) + + + # BOOST_LAMBDA() + # -------------- + # Look for Boost.Lambda +-AC_DEFUN([BOOST_LAMBDA], ++BOOST_DEFUN([Lambda], + [BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) + + ++# BOOST_LOCALE() ++# -------------- ++# Look for Boost.Locale ++BOOST_DEFUN([Locale], ++[BOOST_FIND_LIB([locale], [$1], ++ [boost/locale.hpp], ++ [[boost::locale::generator gen; std::locale::global(gen(""));]]) ++])# BOOST_LOCALE ++ ++# BOOST_LOG([PREFERRED-RT-OPT]) ++# ----------------------------- ++# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. ++BOOST_DEFUN([Log], ++[BOOST_FIND_LIB([log], [$1], ++ [boost/log/core/core.hpp], ++ [boost::log::attribute a; a.get_value();]) ++])# BOOST_LOG ++ ++ ++# BOOST_LOG_SETUP([PREFERRED-RT-OPT]) ++# ----------------------------------- ++# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. ++BOOST_DEFUN([Log_Setup], ++[AC_REQUIRE([BOOST_LOG])dnl ++BOOST_FIND_LIB([log_setup], [$1], ++ [boost/log/utility/setup/from_settings.hpp], ++ [boost::log::basic_settings bs; bs.empty();]) ++])# BOOST_LOG_SETUP ++ ++ + # BOOST_MATH() + # ------------ + # Look for Boost.Math +@@ -573,21 +821,52 @@ + # libboost_math_c99f, libboost_math_c99l, libboost_math_tr1, + # libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the + # right thing anyway. +-AC_DEFUN([BOOST_MATH], ++BOOST_DEFUN([Math], + [BOOST_FIND_HEADER([boost/math/special_functions.hpp])]) + + ++# BOOST_MPI([PREFERRED-RT-OPT]) ++# ------------------------------- ++# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is ++# set, otherwise tries CXX ++# ++BOOST_DEFUN([MPI], ++[boost_save_CXX=${CXX} ++boost_save_CXXCPP=${CXXCPP} ++if test x"${MPICXX}" != x; then ++ CXX=${MPICXX} ++ CXXCPP="${MPICXX} -E" ++fi ++BOOST_FIND_LIB([mpi], [$1], ++ [boost/mpi.hpp], ++ [int argc = 0; ++ char **argv = 0; ++ boost::mpi::environment env(argc,argv);]) ++CXX=${boost_save_CXX} ++CXXCPP=${boost_save_CXXCPP} ++])# BOOST_MPI ++ ++ + # BOOST_MULTIARRAY() + # ------------------ + # Look for Boost.MultiArray +-AC_DEFUN([BOOST_MULTIARRAY], ++BOOST_DEFUN([MultiArray], + [BOOST_FIND_HEADER([boost/multi_array.hpp])]) + + ++# BOOST_NUMERIC_UBLAS() ++# -------------------------- ++# Look for Boost.NumericUblas (Basic Linear Algebra) ++BOOST_DEFUN([Numeric_Ublas], ++[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp]) ++])# BOOST_NUMERIC_UBLAS ++ ++ + # BOOST_NUMERIC_CONVERSION() + # -------------------------- + # Look for Boost.NumericConversion (policy-based numeric conversion) +-AC_DEFUN([BOOST_NUMERIC_CONVERSION], ++BOOST_DEFUN([Numeric_Conversion], + [BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp]) + ])# BOOST_NUMERIC_CONVERSION + +@@ -595,32 +874,82 @@ + # BOOST_OPTIONAL() + # ---------------- + # Look for Boost.Optional +-AC_DEFUN([BOOST_OPTIONAL], ++BOOST_DEFUN([Optional], + [BOOST_FIND_HEADER([boost/optional.hpp])]) + + + # BOOST_PREPROCESSOR() + # -------------------- + # Look for Boost.Preprocessor +-AC_DEFUN([BOOST_PREPROCESSOR], ++BOOST_DEFUN([Preprocessor], + [BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) + + ++# BOOST_RANGE() ++# -------------------- ++# Look for Boost.Range ++BOOST_DEFUN([Range], ++[BOOST_FIND_HEADER([boost/range/adaptors.hpp])]) ++ ++# BOOST_UNORDERED() ++# ----------------- ++# Look for Boost.Unordered ++BOOST_DEFUN([Unordered], ++[BOOST_FIND_HEADER([boost/unordered_map.hpp])]) ++ ++ ++# BOOST_UUID() ++# ------------ ++# Look for Boost.Uuid ++BOOST_DEFUN([Uuid], ++[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])]) ++ ++ + # BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) + # ----------------------------------------- +-# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, see +-# the documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_PROGRAM_OPTIONS], ++# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, ++# see the documentation of BOOST_FIND_LIB above. ++BOOST_DEFUN([Program_Options], + [BOOST_FIND_LIB([program_options], [$1], + [boost/program_options.hpp], + [boost::program_options::options_description d("test");]) + ])# BOOST_PROGRAM_OPTIONS + + ++ ++# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG) ++# ------------------------------------ ++# Save VARIABLE, and define it via `python-config --FLAG`. ++# Substitute BOOST_PYTHON_VARIABLE. ++m4_define([_BOOST_PYTHON_CONFIG], ++[AC_SUBST([BOOST_PYTHON_$1], ++ [`python-config --$2 2>/dev/null`])dnl ++boost_python_save_$1=$$1 ++$1="$$1 $BOOST_PYTHON_$1"]) ++ ++ ++# BOOST_PYTHON([PREFERRED-RT-OPT]) ++# -------------------------------- ++# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT, ++# see the documentation of BOOST_FIND_LIB above. ++BOOST_DEFUN([Python], ++[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes]) ++_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags]) ++_BOOST_PYTHON_CONFIG([LIBS], [libs]) ++m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl ++BOOST_FIND_LIBS([python], [python python3], [$1], ++ [boost/python.hpp], ++ [], [BOOST_PYTHON_MODULE(empty) {}]) ++CPPFLAGS=$boost_python_save_CPPFLAGS ++LDFLAGS=$boost_python_save_LDFLAGS ++LIBS=$boost_python_save_LIBS ++])# BOOST_PYTHON ++ ++ + # BOOST_REF() + # ----------- + # Look for Boost.Ref +-AC_DEFUN([BOOST_REF], ++BOOST_DEFUN([Ref], + [BOOST_FIND_HEADER([boost/ref.hpp])]) + + +@@ -628,7 +957,7 @@ + # ------------------------------- + # Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_REGEX], ++BOOST_DEFUN([Regex], + [BOOST_FIND_LIB([regex], [$1], + [boost/regex.hpp], + [boost::regex exp("*"); boost::regex_match("foo", exp);]) +@@ -639,29 +968,37 @@ + # --------------------------------------- + # Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see + # the documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_SERIALIZATION], ++BOOST_DEFUN([Serialization], + [BOOST_FIND_LIB([serialization], [$1], + [boost/archive/text_oarchive.hpp], + [std::ostream* o = 0; // Cheap way to get an ostream... + boost::archive::text_oarchive t(*o);]) +-])# BOOST_SIGNALS ++])# BOOST_SERIALIZATION + + + # BOOST_SIGNALS([PREFERRED-RT-OPT]) + # --------------------------------- + # Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_SIGNALS], ++BOOST_DEFUN([Signals], + [BOOST_FIND_LIB([signals], [$1], + [boost/signal.hpp], + [boost::signal s;]) + ])# BOOST_SIGNALS + + ++# BOOST_SIGNALS2() ++# ---------------- ++# Look for Boost.Signals2 (new since 1.39.0). ++BOOST_DEFUN([Signals2], ++[BOOST_FIND_HEADER([boost/signals2.hpp]) ++])# BOOST_SIGNALS2 ++ ++ + # BOOST_SMART_PTR() + # ----------------- + # Look for Boost.SmartPtr +-AC_DEFUN([BOOST_SMART_PTR], ++BOOST_DEFUN([Smart_Ptr], + [BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) + BOOST_FIND_HEADER([boost/shared_ptr.hpp]) + ]) +@@ -670,14 +1007,14 @@ + # BOOST_STATICASSERT() + # -------------------- + # Look for Boost.StaticAssert +-AC_DEFUN([BOOST_STATICASSERT], ++BOOST_DEFUN([StaticAssert], + [BOOST_FIND_HEADER([boost/static_assert.hpp])]) + + + # BOOST_STRING_ALGO() + # ------------------- + # Look for Boost.StringAlgo +-AC_DEFUN([BOOST_STRING_ALGO], ++BOOST_DEFUN([String_Algo], + [BOOST_FIND_HEADER([boost/algorithm/string.hpp]) + ]) + +@@ -687,7 +1024,7 @@ + # Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. This library was introduced in Boost + # 1.35.0. +-AC_DEFUN([BOOST_SYSTEM], ++BOOST_DEFUN([System], + [BOOST_FIND_LIB([system], [$1], + [boost/system/error_code.hpp], + [boost::system::error_code e; e.clear();]) +@@ -698,7 +1035,7 @@ + # ------------------------------ + # Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_TEST], ++BOOST_DEFUN([Test], + [m4_pattern_allow([^BOOST_CHECK$])dnl + BOOST_FIND_LIB([unit_test_framework], [$1], + [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], +@@ -708,45 +1045,58 @@ + ])# BOOST_TEST + + +-# BOOST_THREADS([PREFERRED-RT-OPT]) ++# BOOST_THREAD([PREFERRED-RT-OPT]) + # --------------------------------- + # Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-# FIXME: Provide an alias "BOOST_THREAD". +-AC_DEFUN([BOOST_THREADS], ++BOOST_DEFUN([Thread], + [dnl Having the pthread flag is required at least on GCC3 where + dnl boost/thread.hpp would complain if we try to compile without + dnl -pthread on GNU/Linux. + AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl +-boost_threads_save_LIBS=$LIBS +-boost_threads_save_CPPFLAGS=$CPPFLAGS +-LIBS="$LIBS $boost_cv_pthread_flag" +-# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, +-# boost/thread.hpp will trigger a #error if -pthread isn't used: +-# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support +-# is not turned on. Please set the correct command line options for +-# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" ++boost_thread_save_LIBS=$LIBS ++boost_thread_save_LDFLAGS=$LDFLAGS ++boost_thread_save_CPPFLAGS=$CPPFLAGS ++# Link-time dependency from thread to system was added as of 1.49.0. ++if test $boost_major_version -ge 149; then ++BOOST_SYSTEM([$1]) ++fi # end of the Boost.System check. ++m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl ++LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" ++LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" + CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" +-BOOST_FIND_LIB([thread], [$1], ++ ++# When compiling for the Windows platform, the threads library is named ++# differently. ++case $host_os in ++ (*mingw*) boost_thread_lib_ext=_win32;; ++esac ++BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext], ++ [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) +-BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $boost_cv_pthread_flag" ++ ++BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" ++BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS" + BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" +-LIBS=$boost_threads_save_LIBS +-CPPFLAGS=$boost_threads_save_CPPFLAGS +-])# BOOST_THREADS ++LIBS=$boost_thread_save_LIBS ++LDFLAGS=$boost_thread_save_LDFLAGS ++CPPFLAGS=$boost_thread_save_CPPFLAGS ++])# BOOST_THREAD ++ ++AU_ALIAS([BOOST_THREADS], [BOOST_THREAD]) + + + # BOOST_TOKENIZER() + # ----------------- + # Look for Boost.Tokenizer +-AC_DEFUN([BOOST_TOKENIZER], ++BOOST_DEFUN([Tokenizer], + [BOOST_FIND_HEADER([boost/tokenizer.hpp])]) + + + # BOOST_TRIBOOL() + # --------------- + # Look for Boost.Tribool +-AC_DEFUN([BOOST_TRIBOOL], ++BOOST_DEFUN([Tribool], + [BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) + BOOST_FIND_HEADER([boost/logic/tribool.hpp]) + ]) +@@ -755,14 +1105,14 @@ + # BOOST_TUPLE() + # ------------- + # Look for Boost.Tuple +-AC_DEFUN([BOOST_TUPLE], ++BOOST_DEFUN([Tuple], + [BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) + + + # BOOST_TYPETRAITS() + # -------------------- + # Look for Boost.TypeTraits +-AC_DEFUN([BOOST_TYPETRAITS], ++BOOST_DEFUN([TypeTraits], + [BOOST_FIND_HEADER([boost/type_traits.hpp])]) + + +@@ -770,33 +1120,46 @@ + # --------------- + # Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, + # etc.) +-AC_DEFUN([BOOST_UTILITY], ++BOOST_DEFUN([Utility], + [BOOST_FIND_HEADER([boost/utility.hpp])]) + + + # BOOST_VARIANT() + # --------------- + # Look for Boost.Variant. +-AC_DEFUN([BOOST_VARIANT], ++BOOST_DEFUN([Variant], + [BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) + BOOST_FIND_HEADER([boost/variant.hpp])]) + + ++# BOOST_POINTER_CONTAINER() ++# ------------------------ ++# Look for Boost.PointerContainer ++BOOST_DEFUN([Pointer_Container], ++[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp]) ++])# BOOST_POINTER_CONTAINER ++ ++ + # BOOST_WAVE([PREFERRED-RT-OPT]) + # ------------------------------ + # NOTE: If you intend to use Wave/Spirit with thread support, make sure you +-# call BOOST_THREADS first. ++# call BOOST_THREAD first. + # Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_WAVE], ++BOOST_DEFUN([Wave], + [AC_REQUIRE([BOOST_FILESYSTEM])dnl + AC_REQUIRE([BOOST_DATE_TIME])dnl + boost_wave_save_LIBS=$LIBS + boost_wave_save_LDFLAGS=$LDFLAGS + m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl +-LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS\ ++LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \ + $BOOST_THREAD_LIBS" +-LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS\ ++LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \ + $BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" + BOOST_FIND_LIB([wave], [$1], + [boost/wave.hpp], +@@ -809,7 +1172,7 @@ + # BOOST_XPRESSIVE() + # ----------------- + # Look for Boost.Xpressive (new since 1.36.0). +-AC_DEFUN([BOOST_XPRESSIVE], ++BOOST_DEFUN([Xpressive], + [BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) + + +@@ -820,8 +1183,16 @@ + + # _BOOST_PTHREAD_FLAG() + # --------------------- +-# Internal helper for BOOST_THREADS. Based on ACX_PTHREAD: +-# http://autoconf-archive.cryp.to/acx_pthread.html ++# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag ++# which must be used in CPPFLAGS and LIBS. ++# ++# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, ++# boost/thread.hpp will trigger a #error if -pthread isn't used: ++# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support ++# is not turned on. Please set the correct command line options for ++# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" ++# ++# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html + AC_DEFUN([_BOOST_PTHREAD_FLAG], + [AC_REQUIRE([AC_PROG_CXX])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl +@@ -889,6 +1260,14 @@ + m4_define([_BOOST_gcc_test], + ["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl + ++# _BOOST_mingw_test(MAJOR, MINOR) ++# ----------------------------- ++# Internal helper for _BOOST_FIND_COMPILER_TAG. ++m4_define([_BOOST_mingw_test], ++["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl ++ + + # _BOOST_FIND_COMPILER_TAG() + # -------------------------- +@@ -898,9 +1277,11 @@ + AC_DEFUN([_BOOST_FIND_COMPILER_TAG], + [AC_REQUIRE([AC_PROG_CXX])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag], +-[AC_LANG_PUSH([C++])dnl +- boost_cv_lib_tag=unknown ++AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], ++ [boost_cv_lib_tag], ++[boost_cv_lib_tag=unknown ++if test x$boost_cv_inc_path != xno; then ++ AC_LANG_PUSH([C++])dnl + # The following tests are mostly inspired by boost/config/auto_link.hpp + # The list is sorted to most recent/common to oldest compiler (in order + # to increase the likelihood of finding the right compiler with the +@@ -914,11 +1295,30 @@ + # como, edg, kcc, bck, mp, sw, tru, xlc + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). +- # TODO: Move the test on GCC 4.4 up once it's released. + for i in \ ++ _BOOST_mingw_test(5, 0) \ ++ _BOOST_gcc_test(5, 0) \ ++ _BOOST_mingw_test(4, 10) \ ++ _BOOST_gcc_test(4, 10) \ ++ _BOOST_mingw_test(4, 9) \ ++ _BOOST_gcc_test(4, 9) \ ++ _BOOST_mingw_test(4, 8) \ ++ _BOOST_gcc_test(4, 8) \ ++ _BOOST_mingw_test(4, 7) \ ++ _BOOST_gcc_test(4, 7) \ ++ _BOOST_mingw_test(4, 6) \ ++ _BOOST_gcc_test(4, 6) \ ++ _BOOST_mingw_test(4, 5) \ ++ _BOOST_gcc_test(4, 5) \ ++ _BOOST_mingw_test(4, 4) \ ++ _BOOST_gcc_test(4, 4) \ ++ _BOOST_mingw_test(4, 3) \ + _BOOST_gcc_test(4, 3) \ ++ _BOOST_mingw_test(4, 2) \ + _BOOST_gcc_test(4, 2) \ ++ _BOOST_mingw_test(4, 1) \ + _BOOST_gcc_test(4, 1) \ ++ _BOOST_mingw_test(4, 0) \ + _BOOST_gcc_test(4, 0) \ + "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ + && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ +@@ -935,7 +1335,6 @@ + "defined __ICC && (defined __unix || defined __unix__) @ il" \ + "defined __ICL @ iw" \ + "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ +- _BOOST_gcc_test(4, 4) \ + _BOOST_gcc_test(2, 95) \ + "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ + "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ +@@ -975,7 +1374,7 @@ + boost_cv_lib_tag= + ;; + esac +-])dnl end of AC_CACHE_CHECK ++fi])dnl end of AC_CACHE_CHECK + ])# _BOOST_FIND_COMPILER_TAG + + +@@ -985,6 +1384,7 @@ + # Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. + AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], + [# Check whether we do better use `mt' even though we weren't ask to. ++AC_LANG_PUSH([C++])dnl + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #if defined _REENTRANT || defined _MT || defined __MT__ + /* use -mt */ +@@ -992,6 +1392,7 @@ + # error MT not needed + #endif + ]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) ++AC_LANG_POP([C++])dnl + ]) + + # _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +@@ -1015,11 +1416,11 @@ + test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && + _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) + AS_IF([_AC_DO_STDERR($ac_link) && { +- test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || +- test ! -s conftest.err ++ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || ++ test ! -s conftest.err + } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +- $as_executable_p conftest$ac_exeext ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext + dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. + }], + [$2], +--- zarafa-7.1.12/configure 2015-05-08 14:21:08.000000000 +0200 ++++ zarafa-7.1.12/configure.gcc5 2015-07-01 21:53:46.000000000 +0200 +@@ -648,10 +648,14 @@ + ICU_CFLAGS + ICU_CONFIG + BOOST_DATE_TIME_LIBS ++BOOST_DATE_TIME_LDPATH + BOOST_DATE_TIME_LDFLAGS + BOOST_FILESYSTEM_LIBS ++BOOST_FILESYSTEM_LDPATH + BOOST_FILESYSTEM_LDFLAGS + BOOST_SYSTEM_LIBS ++BOOST_LDPATH ++BOOST_SYSTEM_LDPATH + BOOST_SYSTEM_LDFLAGS + BOOST_CPPFLAGS + DISTCHECK_CONFIGURE_FLAGS +@@ -20532,7 +20536,7 @@ + + + # Boost +-echo "$as_me: this is boost.m4 serial 12" >&5 ++echo "$as_me: this is boost.m4 serial 24" >&5 + boost_save_IFS=$IFS + boost_version_req=1.35 + IFS=. +@@ -20540,6 +20544,7 @@ + IFS=$boost_save_IFS + shift + boost_version_req=`expr "$1" '*' 100000 + "$2" '*' 100 + "$3"` ++boost_version_req_string=$1.$2.$3 + + # Check whether --with-boost was given. + if test "${with_boost+set}" = set; then : +@@ -20558,10 +20563,9 @@ + fi + fi + DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'" +- + boost_save_CPPFLAGS=$CPPFLAGS +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost headers version >= $boost_version_req" >&5 +-$as_echo_n "checking for Boost headers version >= $boost_version_req... " >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost headers version >= $boost_version_req_string" >&5 ++$as_echo_n "checking for Boost headers version >= $boost_version_req_string... " >&6; } + if ${boost_cv_inc_path+:} false; then : + $as_echo_n "(cached) " >&6 + else +@@ -20656,7 +20660,7 @@ + $as_echo "$boost_cv_inc_path" >&6; } + case $boost_cv_inc_path in #( + no) +- boost_errmsg="cannot find Boost headers version >= $boost_version_req" ++ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string" + as_fn_error $? "$boost_errmsg" "$LINENO" 5 + + ;;#( +@@ -20665,34 +20669,40 @@ + ;;#( + *) + BOOST_CPPFLAGS="-I$boost_cv_inc_path" +- + ;; + esac +- case $boost_cv_inc_path in #( +- no) +- ;;#( +- *) ++ if test x"$boost_cv_inc_path" != xno; then + + $as_echo "#define HAVE_BOOST 1" >>confdefs.h + +- ;; +- esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost's header version" >&5 + $as_echo_n "checking for Boost's header version... " >&6; } + if ${boost_cv_lib_version+:} false; then : + $as_echo_n "(cached) " >&6 + else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + boost-lib-version = BOOST_LIB_VERSION + _ACEOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ grep -v '#' | + tr -d '\r' | +- $SED -n -e "/^boost-lib-version = /{s///;s/\"//g;p;g;}" >conftest.i 2>&1; then : ++ tr -s '\n' ' ' | ++ $SED -n -e "/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}" >conftest.i 2>&1; then : + boost_cv_lib_version=`cat conftest.i` + fi + rm -rf conftest* ++ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_version" >&5 +@@ -20701,9 +20711,10 @@ + boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` + case $boost_major_version in #( + '' | *[!0-9]*) +- as_fn_error $? "invalid value: boost_major_version=$boost_major_version" "$LINENO" 5 ++ as_fn_error $? "invalid value: boost_major_version='$boost_major_version'" "$LINENO" 5 + ;; + esac ++fi + CPPFLAGS=$boost_save_CPPFLAGS + + if test x"$boost_cv_inc_path" = xno; then +@@ -20765,17 +20776,19 @@ + fi + + ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the toolset name used by Boost for $CXX" >&5 + $as_echo_n "checking for the toolset name used by Boost for $CXX... " >&6; } + if ${boost_cv_lib_tag+:} false; then : + $as_echo_n "(cached) " >&6 + else ++ boost_cv_lib_tag=unknown ++if test x$boost_cv_inc_path != xno; then + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +- boost_cv_lib_tag=unknown + # The following tests are mostly inspired by boost/config/auto_link.hpp + # The list is sorted to most recent/common to oldest compiler (in order + # to increase the likelihood of finding the right compiler with the +@@ -20789,11 +20802,54 @@ + # como, edg, kcc, bck, mp, sw, tru, xlc + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). +- # TODO: Move the test on GCC 4.4 up once it's released. + for i in \ ++ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 0 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw50" \ ++ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc50" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 10 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw410" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 10 && !defined __ICC @ gcc410" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw49" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && !defined __ICC @ gcc49" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw48" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC @ gcc48" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw47" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC @ gcc47" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw46" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC @ gcc46" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw45" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC @ gcc45" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw44" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc44" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw43" \ + "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc43" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw42" \ + "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc42" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw41" \ + "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc41" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw40" \ + "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc40" \ + "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ + && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ +@@ -20810,7 +20866,6 @@ + "defined __ICC && (defined __unix || defined ) @ il" \ + "defined __ICL @ iw" \ + "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ +- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc44" \ + "defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95 && !defined __ICC @ gcc295" \ + "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ + "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ +@@ -20869,7 +20924,7 @@ + boost_cv_lib_tag= + ;; + esac +- ++fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_tag" >&5 + $as_echo "$boost_cv_lib_tag" >&6; } +@@ -20881,6 +20936,11 @@ + fi + + # Check whether we do better use `mt' even though we weren't ask to. ++ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -20904,12 +20964,17 @@ + boost_guess_use_mt=false + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + # Do we have to check for Boost.System? This link-time dependency was + # added as of 1.35.0. If we have a version <1.35, we must not attempt to + # find Boost.System as it didn't exist by then. + if test $boost_major_version -ge 135; then +-if test x"$boost_cv_inc_path" = xno; then ++ if test x"$boost_cv_inc_path" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost system library" >&5 + $as_echo "$as_me: Boost not available, not searching for the Boost system library" >&6;} + else +@@ -20949,13 +21014,6 @@ + + boost_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +-# Now let's try to find the library. The algorithm is as follows: first look +-# for a given library name according to the user's PREFERRED-RT-OPT. For each +-# library name, we prefer to use the ones that carry the tag (toolset name). +-# Each library is searched through the various standard paths were Boost is +-# usually installed. If we can't find the standard variants, we try to +-# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +-# but there's -obviously- libboost_threads-mt.dylib). + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost system library" >&5 + $as_echo_n "checking for the Boost system library... " >&6; } + if ${boost_cv_lib_system+:} false; then : +@@ -20963,19 +21021,19 @@ + else + boost_cv_lib_system=no + case "mt" in #( +- mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +- mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( +- *) boost_mt=; boost_rtopt=mt;; ++ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( ++ (*) boost_mt=; boost_rtopt=mt;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( +- *d*) boost_rt_d=$boost_rtopt;; #( +- *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ (*d*) boost_rt_d=$boost_rtopt;; #( ++ (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( +- *) boost_rt_d='-d';; ++ (*) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" +@@ -21006,38 +21064,42 @@ + rm -f core conftest.err conftest.$ac_objext + ac_objext=$boost_save_ac_objext + boost_failed_libs= +-# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +-# matter. ++# Don't bother to ident the following nested for loops, only the 2 ++# innermost ones matter. ++for boost_lib_ in system; do + for boost_tag_ in -$boost_cv_lib_tag ''; do + for boost_ver_ in -$boost_cv_lib_version ''; do + for boost_mt_ in $boost_mt -mt ''; do + for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ +- boost_system$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +- boost_system$boost_tag_$boost_rtopt_$boost_ver_ \ +- boost_system$boost_tag_$boost_mt_$boost_ver_ \ +- boost_system$boost_tag_$boost_ver_ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( +- *@$boost_lib@*) continue;; ++ (*@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ +- /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ +- "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* + do +- test -e "$boost_ldpath" || continue ++ # Don't waste time with directories that don't exist. ++ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++ continue ++ fi + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( +- *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + boost_cv_lib_system_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$boost_cv_lib_system_LIBS" || continue;; #( +- *) # No: use -lboost_foo to find the shared library. ++ (*) # No: use -lboost_foo to find the shared library. + boost_cv_lib_system_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS +@@ -21066,11 +21128,11 @@ + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { +- test -z "$ac_cxx_werror_flag" || +- test ! -s conftest.err ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err + } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +- $as_executable_p conftest$ac_exeext ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext + }; then : + boost_cv_lib_system=yes + else +@@ -21089,8 +21151,79 @@ + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$boost_cv_lib_system" = xyes; then +- boost_cv_lib_system_LDFLAGS="-L$boost_ldpath" +- break 6 ++ # Check or used cached result of whether or not using -R or ++ # -rpath makes sense. Some implementations of ld, such as for ++ # Mac OSX, require -rpath but -R is the flag known to work on ++ # other systems. https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $boost_ldpath in ++ '') # Nothing to do. ++ boost_cv_rpath_link_ldflag= ++ boost_rpath_link_ldflag_found=yes;; ++ *) ++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ LIBS="$boost_save_LIBS $boost_cv_lib_system_LIBS" ++ rm -f conftest$ac_exeext ++boost_save_ac_ext=$ac_ext ++boost_use_source=: ++# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++# tries to link the existing object file instead of compiling from source. ++test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++ $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++ break ++else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++ boost_rpath_link_ldflag_found=no ++fi ++ac_objext=$boost_save_ac_objext ++ac_ext=$boost_save_ac_ext ++rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ done ++ ;; ++ esac ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++fi ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ ++fi ++ ++ test x"$boost_ldpath" != x && ++ boost_cv_lib_system_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ boost_cv_lib_system_LDPATH="$boost_ldpath" ++ break 7 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi +@@ -21100,22 +21233,23 @@ + done + done + done ++done # boost_lib_ + rm -f conftest.$ac_objext + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_system" >&5 + $as_echo "$boost_cv_lib_system" >&6; } + case $boost_cv_lib_system in #( +- no) $as_echo "$as_me: failed program was:" >&5 ++ (no) $as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +- as_fn_error $? "cannot not find the flags to link with Boost system" "$LINENO" 5 ++ as_fn_error $? "cannot find the flags to link with Boost system" "$LINENO" 5 + ;; + esac + BOOST_SYSTEM_LDFLAGS=$boost_cv_lib_system_LDFLAGS +- ++BOOST_SYSTEM_LDPATH=$boost_cv_lib_system_LDPATH ++BOOST_LDPATH=$boost_cv_lib_system_LDPATH + BOOST_SYSTEM_LIBS=$boost_cv_lib_system_LIBS +- + CPPFLAGS=$boost_save_CPPFLAGS + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' +@@ -21125,6 +21259,7 @@ + fi + + ++ + fi # end of the Boost.System check. + boost_filesystem_save_LIBS=$LIBS + boost_filesystem_save_LDFLAGS=$LDFLAGS +@@ -21170,13 +21305,6 @@ + + boost_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +-# Now let's try to find the library. The algorithm is as follows: first look +-# for a given library name according to the user's PREFERRED-RT-OPT. For each +-# library name, we prefer to use the ones that carry the tag (toolset name). +-# Each library is searched through the various standard paths were Boost is +-# usually installed. If we can't find the standard variants, we try to +-# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +-# but there's -obviously- libboost_threads-mt.dylib). + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost filesystem library" >&5 + $as_echo_n "checking for the Boost filesystem library... " >&6; } + if ${boost_cv_lib_filesystem+:} false; then : +@@ -21184,19 +21312,19 @@ + else + boost_cv_lib_filesystem=no + case "mt" in #( +- mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +- mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( +- *) boost_mt=; boost_rtopt=mt;; ++ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( ++ (*) boost_mt=; boost_rtopt=mt;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( +- *d*) boost_rt_d=$boost_rtopt;; #( +- *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ (*d*) boost_rt_d=$boost_rtopt;; #( ++ (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( +- *) boost_rt_d='-d';; ++ (*) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" +@@ -21227,38 +21355,42 @@ + rm -f core conftest.err conftest.$ac_objext + ac_objext=$boost_save_ac_objext + boost_failed_libs= +-# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +-# matter. ++# Don't bother to ident the following nested for loops, only the 2 ++# innermost ones matter. ++for boost_lib_ in filesystem; do + for boost_tag_ in -$boost_cv_lib_tag ''; do + for boost_ver_ in -$boost_cv_lib_version ''; do + for boost_mt_ in $boost_mt -mt ''; do + for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ +- boost_filesystem$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +- boost_filesystem$boost_tag_$boost_rtopt_$boost_ver_ \ +- boost_filesystem$boost_tag_$boost_mt_$boost_ver_ \ +- boost_filesystem$boost_tag_$boost_ver_ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( +- *@$boost_lib@*) continue;; ++ (*@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ +- /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ +- "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* + do +- test -e "$boost_ldpath" || continue ++ # Don't waste time with directories that don't exist. ++ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++ continue ++ fi + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( +- *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + boost_cv_lib_filesystem_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$boost_cv_lib_filesystem_LIBS" || continue;; #( +- *) # No: use -lboost_foo to find the shared library. ++ (*) # No: use -lboost_foo to find the shared library. + boost_cv_lib_filesystem_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS +@@ -21287,11 +21419,11 @@ + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { +- test -z "$ac_cxx_werror_flag" || +- test ! -s conftest.err ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err + } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +- $as_executable_p conftest$ac_exeext ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext + }; then : + boost_cv_lib_filesystem=yes + else +@@ -21310,8 +21442,79 @@ + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$boost_cv_lib_filesystem" = xyes; then +- boost_cv_lib_filesystem_LDFLAGS="-L$boost_ldpath" +- break 6 ++ # Check or used cached result of whether or not using -R or ++ # -rpath makes sense. Some implementations of ld, such as for ++ # Mac OSX, require -rpath but -R is the flag known to work on ++ # other systems. https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $boost_ldpath in ++ '') # Nothing to do. ++ boost_cv_rpath_link_ldflag= ++ boost_rpath_link_ldflag_found=yes;; ++ *) ++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ LIBS="$boost_save_LIBS $boost_cv_lib_filesystem_LIBS" ++ rm -f conftest$ac_exeext ++boost_save_ac_ext=$ac_ext ++boost_use_source=: ++# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++# tries to link the existing object file instead of compiling from source. ++test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++ $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++ break ++else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++ boost_rpath_link_ldflag_found=no ++fi ++ac_objext=$boost_save_ac_objext ++ac_ext=$boost_save_ac_ext ++rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ done ++ ;; ++ esac ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++fi ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ ++fi ++ ++ test x"$boost_ldpath" != x && ++ boost_cv_lib_filesystem_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ boost_cv_lib_filesystem_LDPATH="$boost_ldpath" ++ break 7 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi +@@ -21321,22 +21524,23 @@ + done + done + done ++done # boost_lib_ + rm -f conftest.$ac_objext + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_filesystem" >&5 + $as_echo "$boost_cv_lib_filesystem" >&6; } + case $boost_cv_lib_filesystem in #( +- no) $as_echo "$as_me: failed program was:" >&5 ++ (no) $as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +- as_fn_error $? "cannot not find the flags to link with Boost filesystem" "$LINENO" 5 ++ as_fn_error $? "cannot find the flags to link with Boost filesystem" "$LINENO" 5 + ;; + esac + BOOST_FILESYSTEM_LDFLAGS=$boost_cv_lib_filesystem_LDFLAGS +- ++BOOST_FILESYSTEM_LDPATH=$boost_cv_lib_filesystem_LDPATH ++BOOST_LDPATH=$boost_cv_lib_filesystem_LDPATH + BOOST_FILESYSTEM_LIBS=$boost_cv_lib_filesystem_LIBS +- + CPPFLAGS=$boost_save_CPPFLAGS + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' +@@ -21345,9 +21549,13 @@ + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + fi + ++if test $enable_static_boost = yes && test $boost_major_version -ge 135; then ++ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" ++fi + LIBS=$boost_filesystem_save_LIBS + LDFLAGS=$boost_filesystem_save_LDFLAGS + ++ + if test x"$boost_cv_inc_path" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost date_time library" >&5 + $as_echo "$as_me: Boost not available, not searching for the Boost date_time library" >&6;} +@@ -21388,13 +21596,6 @@ + + boost_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +-# Now let's try to find the library. The algorithm is as follows: first look +-# for a given library name according to the user's PREFERRED-RT-OPT. For each +-# library name, we prefer to use the ones that carry the tag (toolset name). +-# Each library is searched through the various standard paths were Boost is +-# usually installed. If we can't find the standard variants, we try to +-# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +-# but there's -obviously- libboost_threads-mt.dylib). + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost date_time library" >&5 + $as_echo_n "checking for the Boost date_time library... " >&6; } + if ${boost_cv_lib_date_time+:} false; then : +@@ -21402,19 +21603,19 @@ + else + boost_cv_lib_date_time=no + case "mt" in #( +- mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +- mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( +- *) boost_mt=; boost_rtopt=mt;; ++ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( ++ (*) boost_mt=; boost_rtopt=mt;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( +- *d*) boost_rt_d=$boost_rtopt;; #( +- *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ (*d*) boost_rt_d=$boost_rtopt;; #( ++ (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( +- *) boost_rt_d='-d';; ++ (*) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" +@@ -21445,38 +21646,42 @@ + rm -f core conftest.err conftest.$ac_objext + ac_objext=$boost_save_ac_objext + boost_failed_libs= +-# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +-# matter. ++# Don't bother to ident the following nested for loops, only the 2 ++# innermost ones matter. ++for boost_lib_ in date_time; do + for boost_tag_ in -$boost_cv_lib_tag ''; do + for boost_ver_ in -$boost_cv_lib_version ''; do + for boost_mt_ in $boost_mt -mt ''; do + for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ +- boost_date_time$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +- boost_date_time$boost_tag_$boost_rtopt_$boost_ver_ \ +- boost_date_time$boost_tag_$boost_mt_$boost_ver_ \ +- boost_date_time$boost_tag_$boost_ver_ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( +- *@$boost_lib@*) continue;; ++ (*@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ +- /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ +- "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* + do +- test -e "$boost_ldpath" || continue ++ # Don't waste time with directories that don't exist. ++ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++ continue ++ fi + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( +- *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + boost_cv_lib_date_time_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$boost_cv_lib_date_time_LIBS" || continue;; #( +- *) # No: use -lboost_foo to find the shared library. ++ (*) # No: use -lboost_foo to find the shared library. + boost_cv_lib_date_time_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS +@@ -21505,11 +21710,11 @@ + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { +- test -z "$ac_cxx_werror_flag" || +- test ! -s conftest.err ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err + } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +- $as_executable_p conftest$ac_exeext ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext + }; then : + boost_cv_lib_date_time=yes + else +@@ -21528,8 +21733,79 @@ + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$boost_cv_lib_date_time" = xyes; then +- boost_cv_lib_date_time_LDFLAGS="-L$boost_ldpath" +- break 6 ++ # Check or used cached result of whether or not using -R or ++ # -rpath makes sense. Some implementations of ld, such as for ++ # Mac OSX, require -rpath but -R is the flag known to work on ++ # other systems. https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $boost_ldpath in ++ '') # Nothing to do. ++ boost_cv_rpath_link_ldflag= ++ boost_rpath_link_ldflag_found=yes;; ++ *) ++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ LIBS="$boost_save_LIBS $boost_cv_lib_date_time_LIBS" ++ rm -f conftest$ac_exeext ++boost_save_ac_ext=$ac_ext ++boost_use_source=: ++# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++# tries to link the existing object file instead of compiling from source. ++test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++ $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++ break ++else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++ boost_rpath_link_ldflag_found=no ++fi ++ac_objext=$boost_save_ac_objext ++ac_ext=$boost_save_ac_ext ++rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ done ++ ;; ++ esac ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++fi ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ ++fi ++ ++ test x"$boost_ldpath" != x && ++ boost_cv_lib_date_time_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ boost_cv_lib_date_time_LDPATH="$boost_ldpath" ++ break 7 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi +@@ -21539,22 +21815,23 @@ + done + done + done ++done # boost_lib_ + rm -f conftest.$ac_objext + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_date_time" >&5 + $as_echo "$boost_cv_lib_date_time" >&6; } + case $boost_cv_lib_date_time in #( +- no) $as_echo "$as_me: failed program was:" >&5 ++ (no) $as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +- as_fn_error $? "cannot not find the flags to link with Boost date_time" "$LINENO" 5 ++ as_fn_error $? "cannot find the flags to link with Boost date_time" "$LINENO" 5 + ;; + esac + BOOST_DATE_TIME_LDFLAGS=$boost_cv_lib_date_time_LDFLAGS +- ++BOOST_DATE_TIME_LDPATH=$boost_cv_lib_date_time_LDPATH ++BOOST_LDPATH=$boost_cv_lib_date_time_LDPATH + BOOST_DATE_TIME_LIBS=$boost_cv_lib_date_time_LIBS +- + CPPFLAGS=$boost_save_CPPFLAGS + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' +@@ -21565,6 +21842,7 @@ + + + ++ + # Check whether --enable-icu was given. + if test "${enable_icu+set}" = set; then : + enableval=$enable_icu; want_icu=${enableval} diff --git a/zarafa-7.1.12-gsoap-sslv3.patch b/zarafa-7.1.12-gsoap-sslv3.patch new file mode 100644 index 0000000..b1e58f2 --- /dev/null +++ b/zarafa-7.1.12-gsoap-sslv3.patch @@ -0,0 +1,38 @@ +Patch by Robert Scheck for zarafa >= 7.1.12 which disables weak SSLv2 +and SSLv3 protocols for encrypted SOAP connections between the Zarafa services. Until (including) +the Zarafa 7.1.11 release the upstream default was to replace the SSLv23_method() that a pristine +gSOAP library ships with the "safer" SSLv3_method(). With Zarafa 7.1.12 the SSLv3_method() was +changed to SSLv23_method(). However this enables SSLv2 again (and still does not disable SSLv3). +Thus this patch disables SSLv2 and SSLv3 as well as TLS compression explicitly; similar like the +Zarafa Outlook Client which meanwhile only allows TLSv1.0 (and better). + +Proposed to upstream via e-mail on Wed, 2 Apr 2014 11:35:40 +0200, initial patch was put into the +upstream ticket Ticket#2014040210000266. + +--- zarafa-7.1.12/provider/common/SOAPSock.cpp 2015-04-07 13:10:13.000000000 +0200 ++++ zarafa-7.1.12/provider/common/SOAPSock.cpp.gsoap-sslv3 2015-04-07 16:32:20.000000000 +0200 +@@ -157,9 +157,6 @@ + + lpCmd->endpoint = strdup(strServerPath.c_str()); + +- // default allow SSLv3, TLSv1, TLSv1.1 and TLSv1.2 +- lpCmd->soap->ctx = SSL_CTX_new(SSLv23_method()); +- + #ifdef WITH_OPENSSL + if (strncmp("https:", lpCmd->endpoint, 6) == 0) { + // no need to add certificates to call, since soap also calls SSL_CTX_set_default_verify_paths() +@@ -183,6 +180,14 @@ + lpCmd->soap->fsslverify = ssl_verify_callback_zarafa_silent; + + SSL_CTX_set_verify(lpCmd->soap->ctx, SSL_VERIFY_PEER, lpCmd->soap->fsslverify); ++ ++ // disable SSLv2 (according to RFC 6176) and SSLv3, leaving just TLSv1.0 (and better) ++ SSL_CTX_set_options(lpCmd->soap->ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); ++ ++#ifdef SSL_OP_NO_COMPRESSION ++ // disable TLS compression to close the CRIME attack vector (also known as CVE-2012-4929) ++ SSL_CTX_set_options(lpCmd->soap->ctx, SSL_OP_NO_COMPRESSION); ++#endif + } + #endif + diff --git a/zarafa-7.1.9-ssl_ecdhe.patch b/zarafa-7.1.12-ssl_ecdhe.patch similarity index 66% rename from zarafa-7.1.9-ssl_ecdhe.patch rename to zarafa-7.1.12-ssl_ecdhe.patch index f1a1a8e..837fba2 100644 --- a/zarafa-7.1.9-ssl_ecdhe.patch +++ b/zarafa-7.1.12-ssl_ecdhe.patch @@ -1,4 +1,4 @@ -Patch by Robert Scheck for Zarafa <= 7.1.9 which implements ECDHE (elliptic +Patch by Robert Scheck for Zarafa >= 7.1.12 which implements ECDHE (elliptic curve diffie-hellman key exchange) support. http://en.wikipedia.org/wiki/Elliptic_curve_cryptography is providing more information about elliptic curves. @@ -22,21 +22,24 @@ by an experienced C/C++ and OpenSSL developer before merging into Zarafa core. This patch should be only applied after ZCP-12143 and its dependencies. However this patch might maybe not directly apply due to some previous merge issues as mentioned in Ticket#2014030810000131. ---- zarafa-7.1.9/common/ECChannel.cpp 2014-04-13 23:46:59.000000000 +0200 -+++ zarafa-7.1.9/common/ECChannel.cpp.ssl_ecdhe 2014-04-13 23:59:43.000000000 +0200 -@@ -97,6 +97,9 @@ - char *ssl_name; - int ssl_proto, ssl_op = 0, ssl_include = 0, ssl_exclude = 0; - bool ssl_neg; +Proposed to upstream via e-mail on Mon, 14 Apr 2014 12:04:17 +0200, initial patch was put into upstream +ticket https://jira.zarafa.com/browse/ZCP-12237. + +--- zarafa-7.1.12/common/ECChannel.cpp 2015-04-07 13:10:12.000000000 +0200 ++++ zarafa-7.1.12/common/ECChannel.cpp.ssl_ecdhe 2015-04-07 17:12:15.000000000 +0200 +@@ -93,6 +93,9 @@ + char *ssl_ciphers = lpConfig->GetSetting("ssl_ciphers"); + char *ssl_name = NULL; + int ssl_op = 0, ssl_include = 0, ssl_exclude = 0; +#if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + EC_KEY *ecdh; +#endif if (lpConfig == NULL) { - hr = MAPI_E_CALL_FAILED; + lpLogger->Log(EC_LOGLEVEL_ERROR, "ECChannel::HrSetCtx(): invalid parameters"); @@ -113,6 +116,16 @@ - lpCTX = SSL_CTX_new(SSLv23_server_method()); - SSL_CTX_set_options(lpCTX, SSL_OP_ALL); + + SSL_CTX_set_options(lpCTX, SSL_OP_ALL); // enable quirk and bug workarounds +#if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); @@ -50,20 +53,20 @@ not directly apply due to some previous merge issues as mentioned in Ticket#2014 + ssl_name = strtok(ssl_protocols, " "); while(ssl_name != NULL) { - if (*ssl_name != '!') ---- zarafa-7.1.9/provider/server/ECSoapServerConnection.cpp 2014-04-13 23:46:59.000000000 +0200 -+++ zarafa-7.1.9/provider/server/ECSoapServerConnection.cpp.ssl_ecdhe 2014-04-14 00:00:54.000000000 +0200 -@@ -245,6 +245,9 @@ - char *ssl_name; - int ssl_proto, ssl_op = 0, ssl_include = 0, ssl_exclude = 0; - bool ssl_neg; + int ssl_proto = 0; +--- zarafa-7.1.12/provider/server/ECSoapServerConnection.cpp 2015-04-07 13:10:13.000000000 +0200 ++++ zarafa-7.1.12/provider/server/ECSoapServerConnection.cpp.ssl_ecdhe 2015-04-07 17:13:23.000000000 +0200 +@@ -235,6 +235,9 @@ + char *server_ssl_ciphers = m_lpConfig->GetSetting("server_ssl_ciphers"); + char *ssl_name = NULL; + int ssl_op = 0, ssl_include = 0, ssl_exclude = 0; +#if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + EC_KEY *ecdh; +#endif if(lpServerName == NULL) { - er = ZARAFA_E_INVALID_PARAMETER; -@@ -277,6 +280,16 @@ + free(server_ssl_ciphers); +@@ -268,6 +271,16 @@ SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_ALL); @@ -79,4 +82,4 @@ not directly apply due to some previous merge issues as mentioned in Ticket#2014 + ssl_name = strtok(server_ssl_protocols, " "); while(ssl_name != NULL) { - if (*ssl_name != '!') + int ssl_proto = 0; diff --git a/zarafa-7.1.12-ssl_protocols_ciphers.patch b/zarafa-7.1.12-ssl_protocols_ciphers.patch new file mode 100644 index 0000000..c9de1c6 --- /dev/null +++ b/zarafa-7.1.12-ssl_protocols_ciphers.patch @@ -0,0 +1,123 @@ +Patch by Robert Scheck for Zarafa >= 7.1.12 which re-adds the whole +documentation that was initially proposed to upstream but lost when this feature was backported +from Zarafa 7.2 to the 7.1 series. + +Proposed to upstream via e-mail on Sat, 8 Mar 2014 14:30:29 +0100, initial patch was put into +the upstream ticket https://jira.zarafa.com/browse/ZCP-12143. + +--- zarafa-7.1.12/doc/manual.xml 2015-04-07 12:03:31.000000000 +0200 ++++ zarafa-7.1.12/doc/manual.xml.ssl_protocols_ciphers 2015-04-07 17:05:47.000000000 +0200 +@@ -4226,14 +4226,35 @@ + + + +- ++ + +- Incoming SSL connections normally are v3. +- Default: no +- ++ Disabled or enabled protocol names. Supported protocol names ++ are SSLv2, SSLv3 ++ and TLSv1. If Zarafa was linked against ++ OpenSSL 1.0.1 or later there is additional support for the new protocols ++ TLSv1.1 and TLSv1.2. ++ To exclude both, SSLv2 and SSLv3 set ++ to !SSLv2 !SSLv3. SSLv2 is considered unsafe ++ and these connections should not be accepted. ++ Default: !SSLv2 ++ ++ ++ ++ ++ ++ ++ SSL ciphers to use, set to ALL for backward compatibility. ++ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL + + + ++ ++ ++ ++ Prefer the server's order of SSL ciphers over client's. ++ Default: no ++ ++ + + + +@@ -8090,11 +8111,32 @@ + + + +- ++ ++ ++ Disabled or enabled protocol names. Supported protocol names ++ are SSLv2, SSLv3 ++ and TLSv1. If Zarafa was linked against ++ OpenSSL 1.0.1 or later there is additional support for the new protocols ++ TLSv1.1 and TLSv1.2. ++ To exclude both, SSLv2 and SSLv3 set ++ to !SSLv2 !SSLv3. SSLv2 is considered unsafe ++ and these connections should not be accepted. ++ Default: !SSLv2 ++ ++ ++ ++ ++ + +- Accept SSLv2 only connections. SSLv2 is considered +- unsafe, and these connections should not be +- accepted. ++ SSL ciphers to use, set to ALL for backward compatibility. ++ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL ++ ++ ++ ++ ++ ++ ++ Prefer the server's order of SSL ciphers over client's. + Default: no + + +@@ -10091,11 +10133,32 @@ + + + +- ++ ++ ++ Disabled or enabled protocol names. Supported protocol names ++ are SSLv2, SSLv3 ++ and TLSv1. If Zarafa was linked against ++ OpenSSL 1.0.1 or later there is additional support for the new protocols ++ TLSv1.1 and TLSv1.2. ++ To exclude both, SSLv2 and SSLv3 set ++ to !SSLv2 !SSLv3. SSLv2 is considered unsafe ++ and these connections should not be accepted. ++ Default: !SSLv2 ++ ++ ++ ++ ++ ++ ++ SSL ciphers to use, set to ALL for backward compatibility. ++ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL ++ ++ ++ ++ ++ + +- Accept SSLv2 only connections. SSLv2 is considered +- unsafe, and these connections should not be +- accepted. ++ Prefer the server's order of SSL ciphers over client's. + Default: no + + diff --git a/zarafa-7.1.12-upgrade-lock.patch b/zarafa-7.1.12-upgrade-lock.patch new file mode 100644 index 0000000..2a1fddd --- /dev/null +++ b/zarafa-7.1.12-upgrade-lock.patch @@ -0,0 +1,56 @@ +Patch by Robert Scheck for Zarafa 7.1.12 which backports the fix for +CVE-2015-3436. Guido Günther detected and reported that replacing "/tmp/zarafa-upgrade-lock" by +a symlink makes the zarafa-server process following that symlink and thus allows to overwrite +arbitrary files in the filesystem (assuming zarafa-server runs as root which is not the case by +default at Fedora, but it is the upstream default). One just needs write permissions in /tmp and +wait until the zarafa-server is restarted. https://bugzilla.redhat.com/show_bug.cgi?id=1222151 +contains further information. The difference between this backport and the original diff is that +the log levels were reworked from Zarafa 7.1.x to 7.2.x (which this backport takes care of). + +--- zarafa-7.1.12/provider/server/ECServer.cpp 2015-05-08 15:09:05.000000000 +0200 ++++ zarafa-7.1.12/provider/server/ECServer.cpp.upgrade-lock 2015-05-18 23:05:00.000000000 +0200 +@@ -101,6 +101,8 @@ + // have to go with the safe value which is for 64bit. + #define MYSQL_MIN_THREAD_STACK (256*1024) + ++const char upgrade_lock_file[] = "/tmp/zarafa-upgrade-lock"; ++ + extern ECSessionManager* g_lpSessionManager; + + // scheduled functions +@@ -832,7 +834,7 @@ + // SIGSEGV backtrace support + stack_t st = {0}; + struct sigaction act = {{0}}; +- FILE *tmplock = NULL; ++ int tmplock = -1; + struct stat dir = {0}; + struct passwd *runasUser = NULL; + +@@ -1288,8 +1290,9 @@ + m_bDatabaseUpdateIgnoreSignals = true; + + // add a lock file to disable the /etc/init.d scripts +- tmplock = fopen("/tmp/zarafa-upgrade-lock","w"); +- if (!tmplock) ++ tmplock = open(upgrade_lock_file, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); ++ ++ if (tmplock == -1) + g_lpLogger->Log(EC_LOGLEVEL_FATAL, "WARNING: Unable to place upgrade lockfile: %s", strerror(errno)); + + #ifdef EMBEDDED_MYSQL +@@ -1314,9 +1317,11 @@ + er = lpDatabaseFactory->UpdateDatabase(m_bForceDatabaseUpdate, dbError); + + // remove lock file +- if (tmplock) { +- fclose(tmplock); +- unlink("/tmp/zarafa-upgrade-lock"); ++ if (tmplock != -1) { ++ if (unlink(upgrade_lock_file) == -1) ++ g_lpLogger->Log(EC_LOGLEVEL_FATAL, "WARNING: Unable to delete upgrade lockfile (%s): %s", upgrade_lock_file, strerror(errno)); ++ ++ close(tmplock); + } + + if(er == ZARAFA_E_INVALID_VERSION) { diff --git a/zarafa-7.1.12-webaccess-defaultfont.patch b/zarafa-7.1.12-webaccess-defaultfont.patch new file mode 100644 index 0000000..2b261b6 --- /dev/null +++ b/zarafa-7.1.12-webaccess-defaultfont.patch @@ -0,0 +1,18 @@ +Patch by Robert Scheck for Zarafa WebAccess >= 7.1.12 which fixes the issue that the configured +default font from the settings (for HTML e-mails) is just not applied when creating a new e-mail. This issue is also known +to Zarafa since at least April 2011 - but will be not fixed at upstream; see also: https://jira.zarafa.com/browse/ZCP-7492 + +This patch is is free software: You can redistribute it and/or modify it under the terms of the GNU Affero General +Public License, version 3, as published by the Free Software Foundation. + +--- zarafa-7.1.12/php-webclient-ajax/client/layout/dialogs/standard/createmail.php 2015-05-08 15:09:05.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/client/layout/dialogs/standard/createmail.php.rsc 2015-07-12 04:26:59.000000000 +0200 +@@ -381,7 +381,7 @@ + + //set the default font-family for editorarea + var font_family = parentWebclient.settings.get("createmail/maildefaultfont","Arial"); +- document.fckEditor.EditorDocument.body.style.fontFamily = font_family; ++ document.fckEditor.EditorDocument.body.getElementsByTagName("p")[0].style.fontFamily = font_family; + + // set content of body if it is passed in URL + diff --git a/zarafa-7.1.12-webaccess-mcrypt.patch b/zarafa-7.1.12-webaccess-mcrypt.patch new file mode 100644 index 0000000..e7b3fcd --- /dev/null +++ b/zarafa-7.1.12-webaccess-mcrypt.patch @@ -0,0 +1,58 @@ +Patch by Robert Scheck for Zarafa >= 7.1.12 which fixes the fix that fixes CVE-2014-0103. Ush, +that was complicated, so: CVE-2014-0103 exists because Zarafa WebAccess < 7.1.10 and Zarafa WebApp < 1.6 storing passwords +in cleartext on server (in the PHP session). Zarafa solved this flaw by using openssl_encrypt() and openssl_decrypt() from +PHP's OpenSSL bindings. However these functions are only available in PHP 5.3 or later. Without this patch suggestion, any +older but still supported Linux distribution like Red Hat Enterprise Linux 5 or SuSE Linux Enterprise Server 10 (which are +both shipping PHP < 5.3 by default) would still be left vulnerable. + +Given that I am personally more a fan of OpenSSL rather mcrypt, I am not absolutely sure if this implementation is really +correct even it works fine on my test system. So please explicitly review this code to avoid introducing another security +flaw by trying to fix one! A thing that I generally question for myself is the usage of "des-ede3-cbc"/"MCRYPT_TRIPLEDES" +instead of e.g. MCRYPT_RIJNDAEL_128. Given that this decision was initially made by Zarafa I am just following that here. + +Important: To get this patch really powerful the install-time requirement needs to be adapted like this (this example is +based on Fedora's build system so the macros %{?rhel} and %{?fedora} might not exist at Zarafa but need to be replaced by +other macros): + +%if 0%{?rhel}%{?fedora} < 6 +Requires: php-mcrypt +%else +Requires: php-openssl +%endif + +This requires php-openssl (provided by php-common) on RHEL 6 (and later) and php-mcrypt (separate package) before RHEL 6. + +Proposed to upstream via e-mail on Thu, 5 Jun 2014 00:24:32 +0200, initial patch was put into the (non-disclosed) upstream +ticket https://jira.zarafa.com/browse/ZCP-12407. + +--- zarafa-7.1.12/php-webclient-ajax/index.php 2015-04-07 13:10:13.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/index.php.webaccess-mcrypt 2015-04-07 16:22:23.000000000 +0200 +@@ -135,6 +135,8 @@ + } else { + $_SESSION['password'] = openssl_encrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } ++ } elseif(function_exists("mcrypt_encrypt")) { ++ $_SESSION['password'] = base64_encode(mcrypt_encrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, $password, MCRYPT_MODE_CBC, PASSWORD_IV)); + } else { + $_SESSION["password"] = $password; + } +--- zarafa-7.1.12/php-webclient-ajax/server/core/class.mapisession.php 2015-04-07 13:10:14.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/server/core/class.mapisession.php.webaccess-mcrypt 2015-04-07 16:23:58.000000000 +0200 +@@ -132,6 +132,8 @@ + } else { + $password = openssl_decrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } ++ } elseif(function_exists("mcrypt_decrypt")) { ++ $password = rtrim(mcrypt_decrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, base64_decode($password), MCRYPT_MODE_CBC, PASSWORD_IV), "\0"); + } + // logon + $this->session = mapi_logon_zarafa($username, $password, $server, $sslcert_file, $sslcert_pass); +@@ -144,6 +146,8 @@ + } else { + $password = openssl_encrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } ++ } elseif(function_exists("mcrypt_encrypt")) { ++ $password = base64_encode(mcrypt_encrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, $password, MCRYPT_MODE_CBC, PASSWORD_IV)); + } + + if ($result == NOERROR && $this->session !== false){ diff --git a/zarafa-7.1.12-webaccess-xss.patch b/zarafa-7.1.12-webaccess-xss.patch new file mode 100644 index 0000000..7bd5b28 --- /dev/null +++ b/zarafa-7.1.12-webaccess-xss.patch @@ -0,0 +1,30 @@ +Patch by Robert Scheck for Zarafa WebAccess >= 6.00 which ensures proper escaping of +multiple user properties like fullname/realname, username and e-mail address. Without this patch a user having +the unlikely fullname/realname '' (without the '') is not properly escaped +on all places within the Zarafa WebAccess; this might be an XSS flaw. + +This patch is is free software: You can redistribute it and/or modify it under the terms of the GNU Affero General +Public License, version 3, as published by the Free Software Foundation. + +--- zarafa-7.1.12/php-webclient-ajax/client/webclient.php 2015-05-08 15:09:05.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/client/webclient.php.webaccess-xss 2015-07-09 23:42:35.000000000 +0200 +@@ -220,7 +220,7 @@ + dhtml.executeEvent(document.body, "ZarafaDnD:initDragMsgsToDesktop"); + } + +- webclient.setUserInfo("getUserName()))?>", "getFullName()))?>", "getUserEntryid())?>" , "getEmail()))?>"); ++ webclient.setUserInfo("getUserName())))?>", "getFullName())))?>", "getUserEntryid())?>" , "getEmail())))?>"); + + // Store current sessionid in sessionid variable + webclient.sessionid = ""; +--- zarafa-7.1.12/php-webclient-ajax/client/core/layoutmanager.js 2015-05-08 15:09:06.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/client/core/layoutmanager.js.webaccess-xss 2015-07-09 23:43:39.000000000 +0200 +@@ -324,7 +324,7 @@ + var loggedon = dhtml.getElementById("loggedon"); + + var loggedonas = document.createElement("span"); +- loggedonas.innerHTML = _("you are logged on as") + " " + escapeHtml(webclient.fullname); ++ loggedonas.innerHTML = _("you are logged on as") + " " + webclient.fullname; + loggedon.appendChild(loggedonas); + + var seperator = document.createElement("span"); diff --git a/zarafa-7.1.13-ssl_dhe.patch b/zarafa-7.1.13-ssl_dhe.patch new file mode 100644 index 0000000..9eae54a --- /dev/null +++ b/zarafa-7.1.13-ssl_dhe.patch @@ -0,0 +1,298 @@ +Patch by Robert Scheck for Zarafa >= 7.1.13 which implements DHE aka EDH +(diffie-hellman key exchange) support. https://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange is +providing more information about Perfect Forward Secrecy (PFS). This implementation might need some +more resources compared to ECDHE, however not all servers and/or clients are supporting it through; +e.g. Red Hat Enterprise Linux 5 (and derivates). The prime length of 1024, 2048, 3072, 4096, 6144 +and 8192 bits are based on the private key size to avoid any static DH parameters. Please be aware +that this patch may cause issues with some older SSL/TLS clients, mostly Java 7 or earlier, that do +not support primes larger than 1024 bits. + +Suggestions for testing; run the following openssl(1) commands before and after applying this patch: + +1. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :110 -starttls pop3 2>&1 | grep Cipher +2. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :143 -starttls imap 2>&1 | grep Cipher +3. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :237 2>&1 | grep Cipher +4. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :993 2>&1 | grep Cipher +5. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :995 2>&1 | grep Cipher +6. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :8443 2>&1 | grep Cipher + +After applying this patch the output should contain e.g. "DHE-RSA-AES256-GCM-SHA384" on a Red Hat +Enterprise Linux 6 (and derivates). Without this patch the result is e.g. "AES256-GCM-SHA384". Note +that ZCP-12237 is maybe having influence on the result depending on the exact test case. + +Important: As https://www.mail-archive.com/haproxy@formilux.org/msg13274.html is the origin for this +patch (a HAProxy patch suggestion, which itself bases on mod_ssl of Apache httpd), the licensing is +likely a combination out of the Apache License, Version 2.0, the GNU General Public License, version +2 (or later) and the GNU Affero General Public License, version 3 (and thus excludes dual-licensing +situations such as at the upstream of Zarafa). + +This patch should be only applied after ZCP-12237 and its dependencies. + +--- zarafa-7.1.13/common/ECChannel.cpp 2015-07-30 01:01:07.212313822 +0200 ++++ zarafa-7.1.13/common/ECChannel.cpp.ssl_dhe 2015-07-30 02:05:36.045747555 +0200 +@@ -85,6 +85,119 @@ + // because of statics + SSL_CTX* ECChannel::lpCTX = NULL; + ++#if !defined(OPENSSL_NO_DH) ++static DH *ssl_get_dh_1024(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc2409_prime_1024(NULL); ++ // See RFC 2409, Section 6 "Oakley Groups" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_2048(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_2048(NULL); ++ // See RFC 3526, Section 3 "2048-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_3072(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_3072(NULL); ++ // See RFC 3526, Section 4 "3072-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_4096(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_4096(NULL); ++ // See RFC 3526, Section 5 "4096-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_6144(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_6144(NULL); ++ // See RFC 3526, Section 6 "6144-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_8192(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_8192(NULL); ++ // See RFC 3526, Section 7 "8192-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++// Returns Diffie-Hellman parameters matching the private key length ++static DH *ssl_get_tmp_dh(SSL *ssl, int exporting, int keylen) { ++ DH *dh = NULL; ++ EVP_PKEY *pkey = SSL_get_privatekey(ssl); ++ int type = pkey ? EVP_PKEY_type(pkey->type) : EVP_PKEY_NONE; ++ ++ if (type == EVP_PKEY_RSA || type == EVP_PKEY_DSA) { ++ keylen = EVP_PKEY_bits(pkey); ++ } ++ ++ if (keylen >= 8192) { ++ dh = ssl_get_dh_8192(); ++ } else if (keylen >= 6144) { ++ dh = ssl_get_dh_6144(); ++ } else if (keylen >= 4096) { ++ dh = ssl_get_dh_4096(); ++ } else if (keylen >= 3072) { ++ dh = ssl_get_dh_3072(); ++ } else if (keylen >= 2048) { ++ dh = ssl_get_dh_2048(); ++ } else { ++ dh = ssl_get_dh_1024(); ++ } ++ ++ return dh; ++} ++#endif ++ + HRESULT ECChannel::HrSetCtx(ECConfig *lpConfig, ECLogger *lpLogger) { + HRESULT hr = hrSuccess; + char *szFile = NULL; +@@ -116,6 +229,11 @@ + + SSL_CTX_set_options(lpCTX, SSL_OP_ALL); // enable quirk and bug workarounds + ++#if !defined(OPENSSL_NO_DH) ++ SSL_CTX_set_options(lpCTX, SSL_OP_SINGLE_DH_USE); ++ SSL_CTX_set_tmp_dh_callback(lpCTX, ssl_get_tmp_dh); ++#endif ++ + #if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + +--- zarafa-7.1.13/provider/server/ECSoapServerConnection.cpp 2015-07-30 01:01:07.212313822 +0200 ++++ zarafa-7.1.13/provider/server/ECSoapServerConnection.cpp.ssl_dhe 2015-07-30 02:05:54.658626465 +0200 +@@ -165,6 +165,119 @@ + return nRet; + } + ++#if !defined(OPENSSL_NO_DH) ++static DH *ssl_get_dh_1024(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc2409_prime_1024(NULL); ++ // See RFC 2409, Section 6 "Oakley Groups" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_2048(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_2048(NULL); ++ // See RFC 3526, Section 3 "2048-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_3072(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_3072(NULL); ++ // See RFC 3526, Section 4 "3072-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_4096(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_4096(NULL); ++ // See RFC 3526, Section 5 "4096-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_6144(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_6144(NULL); ++ // See RFC 3526, Section 6 "6144-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_8192(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_8192(NULL); ++ // See RFC 3526, Section 7 "8192-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++// Returns Diffie-Hellman parameters matching the private key length ++static DH *ssl_get_tmp_dh(SSL *ssl, int exporting, int keylen) { ++ DH *dh = NULL; ++ EVP_PKEY *pkey = SSL_get_privatekey(ssl); ++ int type = pkey ? EVP_PKEY_type(pkey->type) : EVP_PKEY_NONE; ++ ++ if (type == EVP_PKEY_RSA || type == EVP_PKEY_DSA) { ++ keylen = EVP_PKEY_bits(pkey); ++ } ++ ++ if (keylen >= 8192) { ++ dh = ssl_get_dh_8192(); ++ } else if (keylen >= 6144) { ++ dh = ssl_get_dh_6144(); ++ } else if (keylen >= 4096) { ++ dh = ssl_get_dh_4096(); ++ } else if (keylen >= 3072) { ++ dh = ssl_get_dh_3072(); ++ } else if (keylen >= 2048) { ++ dh = ssl_get_dh_2048(); ++ } else { ++ dh = ssl_get_dh_1024(); ++ } ++ ++ return dh; ++} ++#endif ++ + ECSoapServerConnection::ECSoapServerConnection(ECConfig* lpConfig, ECLogger* lpLogger) + { + m_lpConfig = lpConfig; +@@ -271,6 +384,11 @@ + + SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_ALL); + ++#if !defined(OPENSSL_NO_DH) ++ SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_SINGLE_DH_USE); ++ SSL_CTX_set_tmp_dh_callback(lpsSoap->ctx, ssl_get_tmp_dh); ++#endif ++ + #if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + diff --git a/zarafa.spec b/zarafa.spec index 13819dc..a0918f4 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,6 +1,6 @@ %global beta_or_rc 0 -%global actual_release 2 -%global svnrevision 46050 +%global actual_release 1 +%global svnrevision 51822 %global with_search 1 %global with_ldap 1 %global with_xmlto 1 @@ -31,7 +31,7 @@ Summary: Open Source Edition of the Zarafa Collaboration Platform Name: zarafa -Version: 7.1.11 +Version: 7.1.14 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -57,9 +57,21 @@ Source3: %{name}-webaccess.conf Patch0: zarafa-7.1.11-rpath.patch Patch1: zarafa-7.1.11-php-unbundle.patch Patch2: zarafa-7.1.10-kyotocabinet.patch -Patch3: zarafa-7.1.10-ssl_protocols_ciphers.patch -Patch4: zarafa-7.1.9-ssl_ecdhe.patch +Patch3: zarafa-7.1.12-ssl_protocols_ciphers.patch +Patch4: zarafa-7.1.12-ssl_ecdhe.patch Patch5: zarafa-7.1.11-plaintext_auth_localhost.patch +Patch6: zarafa-7.1.10-imap-badcharset.patch +Patch7: zarafa-7.1.10-imap-fetch-body.patch +Patch8: zarafa-7.1.11-vacation-headers.patch +Patch9: zarafa-7.1.11-vacation-headers2.patch +Patch10: zarafa-7.1.11-webaccess-fail2ban.patch +Patch11: zarafa-7.1.12-webaccess-mcrypt.patch +Patch12: zarafa-7.1.12-gsoap-sslv3.patch +Patch14: zarafa-7.1.12-upgrade-lock.patch +Patch15: zarafa-7.1.12-gcc5.patch +Patch16: zarafa-7.1.12-webaccess-xss.patch +Patch17: zarafa-7.1.12-webaccess-defaultfont.patch +Patch18: zarafa-7.1.13-ssl_dhe.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -315,7 +327,7 @@ Group: Applications/Productivity Requires: httpd, php-mapi = %{version}-%{release} # Bug: php53 from RHEL 5 does not provide php (#717158) %if 0%{?rhel} == 5 -Requires: mod_php >= 4.3 +Requires: mod_php >= 4.3, php-mcrypt %else Requires: php >= 4.3, php-openssl %endif @@ -373,6 +385,8 @@ PHP projects, using the MAPI functions like a normal MAPI program. %package -n python-MAPI Summary: The Python MAPI extension by Zarafa Group: Development/Languages +Provides: python-mapi = %{version}-%{release} +Provides: python-mapi%{?_isa} = %{version}-%{release} %description -n python-MAPI The python-MAPI package contains the Python MAPI extension to provide the @@ -391,6 +405,20 @@ touch -c -r aclocal.m4.rpath aclocal.m4 %patch3 -p1 -b .ssl_protocols_ciphers %patch4 -p1 -b .ssl_ecdhe %patch5 -p1 -b .disable_plaintext_auth-localhost +%patch6 -p1 -b .imap-badcharset +%patch7 -p1 -b .imap-fetch-body +%patch8 -p1 -b .vacation-headers +%patch9 -p1 -b .vacation-headers2 +%patch10 -p1 -b .webaccess-fail2ban +%patch11 -p1 -b .webaccess-mcrypt +%patch12 -p1 -b .gsoap-sslv3 +%patch14 -p1 -b .upgrade-lock +%patch15 -p1 -b .gcc5 +touch -c -r autoconf/boost.m4.gcc5 autoconf/boost.m4 +%patch16 -p1 -b .webaccess-xss +%patch17 -p1 -b .webaccess-defaultfont +rm -f php-webclient-ajax/{.,*,*/*,*/*/*/*}/*.webaccess-* +%patch18 -p1 -b .ssl_dhe %build %if 0%{?rhel}%{?fedora} < 6 @@ -473,6 +501,10 @@ done # Move the logrotate configuration file to its correct place install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 +sed -e 's/}/\tsu root root\n}/' -i $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +touch -c -r %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +%endif # Move the userscripts to their correct place and symlink them mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/userscripts/ @@ -534,7 +566,7 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/plugins/ # Remove unwanted language connectors and webaccess files rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/client/widgets/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.{cfm,pl} -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/{.htaccess,%{name}-webaccess.conf,senddocument.php} +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/{.htaccess,%{name}-webaccess.conf} # Remove flash-based multi-attachment upload (missing source) %if %{no_multiupload} @@ -725,7 +757,8 @@ fi %files common %defattr(-,root,root,-) -%doc installer/licenseagreement/AGPL-3 +%{!?_licensedir:%global license %%doc} +%license installer/licenseagreement/AGPL-3 %dir %{_sysconfdir}/%{name}/ %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name} @@ -762,8 +795,6 @@ fi %{_libdir}/libicalmapi.so %{_libdir}/libinetmapi.so %{_libdir}/libmapi.so -%{_libdir}/libmapicalendar.so -%{_libdir}/libmapitimezone.so %{_libdir}/libcommon_mapi.a %{_libdir}/libcommon_service.a %{_libdir}/libcommon_ssl.a @@ -772,10 +803,8 @@ fi %{_libdir}/libzarafasync.so %{_includedir}/icalmapi/ %{_includedir}/inetmapi/ -%{_includedir}/mapitimezone/ %{_includedir}/mapi4linux/ %{_includedir}/libfreebusy/ -%{_includedir}/libmapicalendar/ %{_includedir}/libzarafasync/ %{_includedir}/%{name}/ %{_libdir}/pkgconfig/%{name}.pc @@ -920,12 +949,11 @@ fi %{_libdir}/libicalmapi.so.* %{_libdir}/libinetmapi.so.* %{_libdir}/libmapi.so.* -%{_libdir}/libmapicalendar.so.* -%{_libdir}/libmapitimezone.so.* %files -n php-mapi %defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/php.d/%{ini_name} +%config(noreplace) %{_sysconfdir}/%{name}/php-mapi.cfg %{_datadir}/php/mapi/ %{_libdir}/php/modules/mapi.so @@ -934,6 +962,28 @@ fi %{python_sitearch}/* %changelog +* Tue Nov 10 2015 Robert Scheck 7.1.14-1 +- Upgrade to 7.1.14 (#1263006) + +* Wed Aug 05 2015 Robert Scheck 7.1.13-1 +- Upgrade to 7.1.13 +- Added patch to fix a possible XSS situation in WebAccess +- Added patch to avoid non-working default font in WebAccess +- Added patch to implement DHE/EDH support (aside of ECDHE) + +* Wed Jul 01 2015 Robert Scheck 7.1.12-3 +- Added patch to build using GCC 5.x + +* Mon May 18 2015 Robert Scheck 7.1.12-2 +- Upgrade to 7.1.12 (re-released) +- Backported patch from Zarafa 7.2 to fix CVE-2015-3436 (#1222151) + +* Tue Apr 07 2015 Robert Scheck 7.1.12-1 +- Upgrade to 7.1.12 +- Added multiple minor enhancement and bugfix patches +- Added patch to fix CVE-2014-0103 for PHP < 5.3 (#1073618) +- Handle "su" option in logrotate >= 3.8.0 to avoid errors + * Sat Oct 25 2014 Kevin Kofler 7.1.11-2 - Rebuild for reference-counting-enabled clucene09