Projects
home:tpokorra:branches:Kolab:16
cyrus-imapd
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
cyrus-imapd.spec
Changed
@@ -37,7 +37,7 @@ Name: cyrus-imapd Summary: A high-performance mail server with IMAP, POP3, NNTP and SIEVE support Version: %{tag_version} -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.cyrusimap.org @@ -65,6 +65,7 @@ ## Patch0001: 0001-dlist-Use-int8_t-in-dlist_parsemap.patch Patch0002: 0002-Avoid-returning-1-as-255.patch +Patch0003: 0003-Canonification-for-multiple-domains.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -270,6 +271,8 @@ %patch0002 -p1 %endif +%patch0003 -p1 + # only to update config.* files autoreconf -vi || (libtoolize --force && autoreconf -vi) @@ -757,6 +760,9 @@ %{_libdir}/*.la %changelog +* Tue Mar 12 2019 Timotheus Pokorra <tp@tbits.net> - 2.5.12.25-2 +- Backport patch from upstream for canonification for multiple domains + * Wed Jan 2 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 2.5.12.25-1 - Rebase on to upstream 2.5.12
View file
0003-Canonification-for-multiple-domains.patch
Added
@@ -0,0 +1,62 @@ +--- a/ptclient/ldap.c 2019-01-02 14:44:17.000000000 +0100 ++++ b/ptclient/ldap.c 2019-03-12 22:13:34.207770974 +0100 +@@ -933,7 +933,58 @@ + if (rc != PTSM_OK) + return rc; + +- if (ptsm->domain_base_dn && (strrchr(canon_id, '@') != NULL)) { ++ if (ptsm->domain_base_dn && ptsm->domain_base_dn[0] != '\0' && (strrchr(canon_id, '@') == NULL)) { ++ syslog(LOG_DEBUG, "collecting all domains from %s", ptsm->domain_base_dn); ++ ++ snprintf(domain_filter, sizeof(domain_filter), ptsm->domain_filter, "*"); ++ ++ syslog(LOG_DEBUG, "Domain filter: %s", domain_filter); ++ ++ rc = ldap_search_st(ptsm->ld, ptsm->domain_base_dn, ptsm->domain_scope, domain_filter, domain_attrs, 0, &(ptsm->timeout), &res); ++ ++ if (rc != LDAP_SUCCESS) { ++ if (rc == LDAP_SERVER_DOWN) { ++ syslog(LOG_ERR, "LDAP not available: %s", ldap_err2string(rc)); ++ ldap_unbind(ptsm->ld); ++ ptsm->ld = NULL; ++ return PTSM_RETRY; ++ } ++ ++ syslog(LOG_ERR, "LDAP search for domain failed: %s", ldap_err2string(rc)); ++ return PTSM_FAIL; ++ } ++ if (ldap_count_entries(ptsm->ld, res) < 1) { ++ syslog(LOG_ERR, "No domain found"); ++ return PTSM_FAIL; ++ } else if (ldap_count_entries(ptsm->ld, res) >= 1) { ++ int count_matches = 0; ++ char *temp_base = NULL; ++ LDAPMessage *res2; ++ for (entry = ldap_first_entry(ptsm->ld, res); entry != NULL; entry = ldap_next_entry(ptsm->ld, entry)) { ++ if ((vals = ldap_get_values(ptsm->ld, entry, ptsm->domain_name_attribute)) != NULL) { ++ syslog(LOG_DEBUG, "we have a domain %s", vals[0]); ++ ptsmodule_standard_root_dn(vals[0], (const char **) &temp_base); ++ rc = ldap_search_st(ptsm->ld, temp_base, ptsm->scope, filter, attrs, 0, &(ptsm->timeout), &res2); ++ if (rc == LDAP_SUCCESS && ldap_count_entries(ptsm->ld, res2) == 1) { ++ syslog(LOG_DEBUG, "Found %s in %s", canon_id, temp_base); ++ base = temp_base; ++ count_matches++; ++ } ++ } ++ } ++ ++ if (count_matches > 1) { ++ syslog(LOG_ERR, "LDAP search for %s failed because it matches multiple accounts.", canon_id); ++ return PTSM_FAIL; ++ } else if (count_matches == 0) { ++ syslog(LOG_ERR, "LDAP search for %s failed because it does not match any account in all domains.", canon_id); ++ return PTSM_FAIL; ++ } ++ ++ syslog(LOG_DEBUG, "we have found %s in %s", canon_id, base); ++ } ++ } ++ else if (ptsm->domain_base_dn && ptsm->domain_base_dn[0] != '\0' && (strrchr(canon_id, '@') != NULL)) { + syslog(LOG_DEBUG, "Attempting to get domain for %s from %s", canon_id, ptsm->domain_base_dn); + + /* Get the base dn to search from domain_base_dn searched on domain_scope with
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.