Hello community,
here is the log from the commit of package evolution-data-server for
openSUSE:Factory checked in at 2018-01-16 09:28:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/evolution-data-server (Old)
and /work/SRC/openSUSE:Factory/.evolution-data-server.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "evolution-data-server"
Tue Jan 16 09:28:36 2018 rev:182 rq:562586 version:3.26.4
Changes:
--------
---
/work/SRC/openSUSE:Factory/evolution-data-server/evolution-data-server.changes
2017-12-29 18:49:26.490194799 +0100
+++
/work/SRC/openSUSE:Factory/.evolution-data-server.new/evolution-data-server.changes
2018-01-16 09:28:45.475910425 +0100
@@ -1,0 +2,9 @@
+Mon Jan 8 15:45:41 UTC 2018 - [email protected]
+
+- Update to version 3.26.4:
+ + Prevent passing NULL ldap handle into LDAP functions.
+ + [Maildir]: Correct double free when the source message file
+ doesn't exist.
+ + Bugs fixed: bgo#791475, bgo#791282.
+
+-------------------------------------------------------------------
Old:
----
evolution-data-server-3.26.3.tar.xz
New:
----
evolution-data-server-3.26.4.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ evolution-data-server.spec ++++++
--- /var/tmp/diff_new_pack.3cl8BC/_old 2018-01-16 09:28:47.347822845 +0100
+++ /var/tmp/diff_new_pack.3cl8BC/_new 2018-01-16 09:28:47.351822658 +0100
@@ -1,7 +1,7 @@
#
# spec file for package evolution-data-server
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -32,7 +32,7 @@
Name: evolution-data-server
%define _evo_version 3.26
-Version: 3.26.3
+Version: 3.26.4
Release: 0
Summary: Evolution Data Server
License: LGPL-2.1+
++++++ evolution-data-server-3.26.3.tar.xz ->
evolution-data-server-3.26.4.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/evolution-data-server-3.26.3/CMakeLists.txt
new/evolution-data-server-3.26.4/CMakeLists.txt
--- old/evolution-data-server-3.26.3/CMakeLists.txt 2017-12-11
11:57:27.000000000 +0100
+++ new/evolution-data-server-3.26.4/CMakeLists.txt 2018-01-08
11:05:37.000000000 +0100
@@ -4,7 +4,7 @@
cmake_policy(VERSION 3.1)
project(evolution-data-server
- VERSION 3.26.3
+ VERSION 3.26.4
LANGUAGES C CXX)
set(PROJECT_BUGREPORT
"http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution-Data-Server")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/evolution-data-server-3.26.3/NEWS
new/evolution-data-server-3.26.4/NEWS
--- old/evolution-data-server-3.26.3/NEWS 2017-12-11 11:57:27.000000000
+0100
+++ new/evolution-data-server-3.26.4/NEWS 2018-01-08 11:05:37.000000000
+0100
@@ -1,3 +1,14 @@
+Evolution-Data-Server 3.26.4 2018-01-08
+---------------------------------------
+
+Bug Fixes:
+ Bug 791475 - Incorrectly parses headers in certain case (Milan Crha)
+ Bug 791282 - Sanitize RFC2047 encoded strings to avoid exploits (Milan
Crha)
+
+Miscellaneous:
+ Prevent passing NULL ldap handle into LDAP functions (Milan Crha)
+ [Maildir] Correct double free when the source message file doesn't
exist (Milan Crha)
+
Evolution-Data-Server 3.26.3 2017-12-11
---------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/evolution-data-server-3.26.3/src/addressbook/backends/ldap/e-book-backend-ldap.c
new/evolution-data-server-3.26.4/src/addressbook/backends/ldap/e-book-backend-ldap.c
---
old/evolution-data-server-3.26.3/src/addressbook/backends/ldap/e-book-backend-ldap.c
2017-12-11 11:57:27.000000000 +0100
+++
new/evolution-data-server-3.26.4/src/addressbook/backends/ldap/e-book-backend-ldap.c
2018-01-08 11:05:37.000000000 +0100
@@ -535,10 +535,11 @@
g_rec_mutex_unlock (&eds_ldap_handler_lock);
return;
}
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
- if (!bl->priv->schema_dn)
+ if (!bl->priv->schema_dn) {
+ g_rec_mutex_unlock (&eds_ldap_handler_lock);
return;
+ }
bl->priv->evolutionPersonChecked = TRUE;
@@ -548,7 +549,6 @@
timeout.tv_sec = 30;
timeout.tv_usec = 0;
- g_rec_mutex_lock (&eds_ldap_handler_lock);
if (ldap_search_ext_s (bl->priv->ldap, bl->priv->schema_dn,
LDAP_SCOPE_BASE,
"(objectClass=subschema)", (gchar **) attrs, 0,
NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp) ==
LDAP_SUCCESS) {
@@ -684,7 +684,6 @@
g_rec_mutex_unlock (&eds_ldap_handler_lock);
return ldap_error;
}
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
attrs[i++] = "supportedControl";
attrs[i++] = "supportedExtension";
@@ -697,14 +696,13 @@
timeout.tv_sec = 30;
timeout.tv_usec = 0;
- g_rec_mutex_lock (&eds_ldap_handler_lock);
ldap_error = ldap_search_ext_s (
bl->priv->ldap,
LDAP_ROOT_DSE, LDAP_SCOPE_BASE,
"(objectclass=*)",
(gchar **) attrs, 0, NULL, NULL, &timeout, LDAP_NO_LIMIT,
&resp);
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (ldap_error != LDAP_SUCCESS) {
+ g_rec_mutex_unlock (&eds_ldap_handler_lock);
g_warning (
"could not perform query on Root DSE "
"(ldap_error 0x%02x/%s)", ldap_error,
@@ -714,9 +712,7 @@
return ldap_error;
}
- g_rec_mutex_lock (&eds_ldap_handler_lock);
values = ldap_get_values (bl->priv->ldap, resp, "supportedControl");
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (values) {
if (enable_debug) {
for (i = 0; values[i]; i++)
@@ -725,9 +721,7 @@
ldap_value_free (values);
}
- g_rec_mutex_lock (&eds_ldap_handler_lock);
values = ldap_get_values (bl->priv->ldap, resp, "supportedExtension");
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (values) {
if (enable_debug) {
for (i = 0; values[i]; i++) {
@@ -740,26 +734,22 @@
ldap_value_free (values);
}
- g_rec_mutex_lock (&eds_ldap_handler_lock);
values = ldap_get_values (bl->priv->ldap, resp, "subschemaSubentry");
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (!values || !values[0]) {
if (values) ldap_value_free (values);
- g_rec_mutex_lock (&eds_ldap_handler_lock);
values = ldap_get_values (bl->priv->ldap, resp,
"schemaNamingContext");
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
}
if (values && values[0]) {
g_free (bl->priv->schema_dn);
bl->priv->schema_dn = g_strdup (values[0]);
- }
- else {
+ } else {
g_warning ("could not determine location of schema information
on LDAP server");
}
if (values)
ldap_value_free (values);
ldap_msgfree (resp);
+ g_rec_mutex_unlock (&eds_ldap_handler_lock);
return LDAP_SUCCESS;
}
@@ -1023,10 +1013,14 @@
if (bl->priv->auth_dn) {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_simple_bind_s (
- bl->priv->ldap,
- bl->priv->auth_dn,
- bl->priv->auth_secret);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_simple_bind_s (
+ bl->priv->ldap,
+ bl->priv->auth_dn,
+ bl->priv->auth_secret);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
}
book_view_notify_status (bl, book_view, "");
@@ -1539,9 +1533,9 @@
ldap_op_finished (op);
return;
}
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (LDAP_RES_ADD != ldap_msgtype (res)) {
+ g_rec_mutex_unlock (&eds_ldap_handler_lock);
e_data_book_respond_create_contacts (
op->book,
op->opid,
@@ -1551,7 +1545,6 @@
return;
}
- g_rec_mutex_lock (&eds_ldap_handler_lock);
ldap_parse_result (
bl->priv->ldap, res, &ldap_error,
NULL, &ldap_error_msg, NULL, NULL, 0);
@@ -1610,9 +1603,9 @@
ldap_op_finished (op);
return;
}
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (LDAP_RES_DELETE != ldap_msgtype (res)) {
+ g_rec_mutex_unlock (&eds_ldap_handler_lock);
e_data_book_respond_remove_contacts (
op->book,
op->opid,
@@ -1622,7 +1615,6 @@
return;
}
- g_rec_mutex_lock (&eds_ldap_handler_lock);
ldap_parse_result (
bl->priv->ldap, res, &ldap_error,
NULL, &ldap_error_msg, NULL, NULL, 0);
@@ -1701,9 +1693,9 @@
ldap_op_finished (op);
return;
}
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (LDAP_RES_MODIFY != ldap_msgtype (res)) {
+ g_rec_mutex_unlock (&eds_ldap_handler_lock);
e_data_book_respond_modify_contacts (op->book,
op->opid,
EDB_ERROR_MSG_TYPE
(ldap_msgtype (res)),
@@ -1712,7 +1704,6 @@
return;
}
- g_rec_mutex_lock (&eds_ldap_handler_lock);
ldap_parse_result (
bl->priv->ldap, res, &ldap_error,
NULL, &ldap_error_msg, NULL, NULL, 0);
@@ -1767,7 +1758,10 @@
LDAPMessage *e;
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_first_entry (bl->priv->ldap, res);
+ if (bl->priv->ldap)
+ e = ldap_first_entry (bl->priv->ldap, res);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (!e) {
@@ -1795,9 +1789,13 @@
/* grab the result code, and set up the actual modify (or
rename)
* if it was successful */
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_parse_result (
- bl->priv->ldap, res, &ldap_error,
- NULL, &ldap_error_msg, NULL, NULL, 0);
+ if (bl->priv->ldap) {
+ ldap_parse_result (
+ bl->priv->ldap, res, &ldap_error,
+ NULL, &ldap_error_msg, NULL, NULL, 0);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (ldap_error != LDAP_SUCCESS) {
g_warning (
@@ -1846,12 +1844,16 @@
/* actually perform the ldap rename */
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_rename (
- bl->priv->ldap, current_dn,
- new_uid /* newRDN */,
- NULL /* NewSuperior */,
- 0 /* deleteOldRDN */,
- NULL, NULL, &rename_contact_msgid);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_rename (
+ bl->priv->ldap, current_dn,
+ new_uid /* newRDN */,
+ NULL /* NewSuperior */,
+ 0 /* deleteOldRDN */,
+ NULL, NULL,
&rename_contact_msgid);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
g_free (new_uid);
@@ -1924,9 +1926,13 @@
}
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_parse_result (
- bl->priv->ldap, res, &ldap_error,
- NULL, &ldap_error_msg, NULL, NULL, 0);
+ if (bl->priv->ldap) {
+ ldap_parse_result (
+ bl->priv->ldap, res, &ldap_error,
+ NULL, &ldap_error_msg, NULL, NULL, 0);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (ldap_error != LDAP_SUCCESS) {
g_warning (
@@ -2005,9 +2011,13 @@
#endif
/* actually perform the ldap modify */
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_modify_ext (
- bl->priv->ldap, modify_op->id, ldap_mods,
- NULL, NULL, &modify_contact_msgid);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_modify_ext (
+ bl->priv->ldap, modify_op->id, ldap_mods,
+ NULL, NULL, &modify_contact_msgid);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (ldap_error == LDAP_SUCCESS) {
@@ -2090,7 +2100,10 @@
gchar *vcard;
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_first_entry (bl->priv->ldap, res);
+ if (bl->priv->ldap)
+ e = ldap_first_entry (bl->priv->ldap, res);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (!e) {
@@ -2106,6 +2119,17 @@
}
contact = build_contact_from_entry (bl, e, NULL, NULL);
+ if (!contact) {
+ e_data_book_respond_get_contact (
+ op->book, op->opid,
+ e_data_book_create_error_fmt (
+ E_DATA_BOOK_STATUS_OTHER_ERROR,
+ _("%s: NULL returned from
ldap_first_entry"),
+ G_STRFUNC),
+ NULL);
+ ldap_op_finished (op);
+ return;
+ }
vcard = e_vcard_to_string (E_VCARD (contact),
EVC_FORMAT_VCARD_30);
e_data_book_respond_get_contact (
@@ -2132,9 +2156,13 @@
gint ldap_error;
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_parse_result (
- bl->priv->ldap, res, &ldap_error,
- NULL, &ldap_error_msg, NULL, NULL, 0);
+ if (bl->priv->ldap) {
+ ldap_parse_result (
+ bl->priv->ldap, res, &ldap_error,
+ NULL, &ldap_error_msg, NULL, NULL, 0);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (ldap_error != LDAP_SUCCESS) {
g_warning (
@@ -2206,7 +2234,10 @@
msg_type = ldap_msgtype (res);
if (msg_type == LDAP_RES_SEARCH_ENTRY) {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_first_entry (bl->priv->ldap, res);
+ if (bl->priv->ldap)
+ e = ldap_first_entry (bl->priv->ldap, res);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
while (NULL != e) {
@@ -2214,18 +2245,22 @@
gchar *vcard;
contact = build_contact_from_entry (bl, e, NULL, NULL);
+ if (contact) {
+ vcard = e_vcard_to_string (E_VCARD (contact),
EVC_FORMAT_VCARD_30);
- vcard = e_vcard_to_string (E_VCARD (contact),
EVC_FORMAT_VCARD_30);
-
- if (enable_debug)
- printf ("vcard = %s\n", vcard);
+ if (enable_debug)
+ printf ("vcard = %s\n", vcard);
- contact_list_op->contacts = g_slist_append
(contact_list_op->contacts, vcard);
+ contact_list_op->contacts = g_slist_append
(contact_list_op->contacts, vcard);
- g_object_unref (contact);
+ g_object_unref (contact);
+ }
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_next_entry (bl->priv->ldap, e);
+ if (bl->priv->ldap)
+ e = ldap_next_entry (bl->priv->ldap, e);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
}
} else if (msg_type == LDAP_RES_SEARCH_REFERENCE) {
@@ -2235,9 +2270,13 @@
gint ldap_error;
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_parse_result (
- bl->priv->ldap, res, &ldap_error,
- NULL, &ldap_error_msg, NULL, NULL, 0);
+ if (bl->priv->ldap) {
+ ldap_parse_result (
+ bl->priv->ldap, res, &ldap_error,
+ NULL, &ldap_error_msg, NULL, NULL, 0);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (ldap_error != LDAP_SUCCESS) {
g_warning (
@@ -2341,7 +2380,10 @@
msg_type = ldap_msgtype (res);
if (msg_type == LDAP_RES_SEARCH_ENTRY) {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_first_entry (bl->priv->ldap, res);
+ if (bl->priv->ldap)
+ e = ldap_first_entry (bl->priv->ldap, res);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
while (NULL != e) {
@@ -2349,15 +2391,19 @@
gchar *uid = NULL;
contact = build_contact_from_entry (bl, e, NULL, &uid);
- g_object_unref (contact);
+ g_clear_object (&contact);
if (enable_debug)
- printf ("uid = %s\n", uid);
+ printf ("uid = %s\n", uid ? uid : "(null)");
- contact_list_uids_op->uids = g_slist_append
(contact_list_uids_op->uids, uid);
+ if (uid)
+ contact_list_uids_op->uids = g_slist_append
(contact_list_uids_op->uids, uid);
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_next_entry (bl->priv->ldap, e);
+ if (bl->priv->ldap)
+ e = ldap_next_entry (bl->priv->ldap, e);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
}
} else if (msg_type == LDAP_RES_SEARCH_REFERENCE) {
@@ -2367,9 +2413,13 @@
gint ldap_error;
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_parse_result (
- bl->priv->ldap, res, &ldap_error,
- NULL, &ldap_error_msg, NULL, NULL, 0);
+ if (bl->priv->ldap) {
+ ldap_parse_result (
+ bl->priv->ldap, res, &ldap_error,
+ NULL, &ldap_error_msg, NULL, NULL, 0);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (ldap_error != LDAP_SUCCESS) {
g_warning (
@@ -3930,27 +3980,25 @@
BerElement *ber = NULL;
g_rec_mutex_lock (&eds_ldap_handler_lock);
+ if (!bl->priv->ldap) {
+ g_rec_mutex_unlock (&eds_ldap_handler_lock);
+ return NULL;
+ }
dn = ldap_get_dn (bl->priv->ldap, e);
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
e_contact_set (contact, E_CONTACT_UID, dn);
ldap_memfree (dn);
if (ldap_uid) *ldap_uid = NULL;
- g_rec_mutex_lock (&eds_ldap_handler_lock);
for (attr = ldap_first_attribute (bl->priv->ldap, e, &ber); attr;
attr = ldap_next_attribute (bl->priv->ldap, e, ber)) {
gint i;
struct prop_info *info = NULL;
gchar **values;
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
-
if (enable_debug)
printf ("attr = %s \n", attr);
if (ldap_uid && !g_ascii_strcasecmp (attr, "uid")) {
- g_rec_mutex_lock (&eds_ldap_handler_lock);
values = ldap_get_values (bl->priv->ldap, e, attr);
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (values) {
if (enable_debug)
printf ("uid value = %s\n", values[0]);
@@ -3959,9 +4007,7 @@
ldap_value_free (values);
}
} else if (!g_ascii_strcasecmp (attr, "objectclass")) {
- g_rec_mutex_lock (&eds_ldap_handler_lock);
values = ldap_get_values (bl->priv->ldap, e, attr);
- g_rec_mutex_unlock (&eds_ldap_handler_lock);
for (i = 0; values[i]; i++) {
if (enable_debug)
printf ("value = %s\n", values[i]);
@@ -3993,9 +4039,7 @@
if (info->prop_type & PROP_TYPE_BINARY) {
struct berval **ber_values;
- g_rec_mutex_lock
(&eds_ldap_handler_lock);
ber_values = ldap_get_values_len
(bl->priv->ldap, e, attr);
- g_rec_mutex_unlock
(&eds_ldap_handler_lock);
if (ber_values) {
info->binary_populate_contact_func (contact, ber_values);
@@ -4004,9 +4048,7 @@
}
}
else {
- g_rec_mutex_lock
(&eds_ldap_handler_lock);
values = ldap_get_values
(bl->priv->ldap, e, attr);
- g_rec_mutex_unlock
(&eds_ldap_handler_lock);
if (values) {
if (info->prop_type &
PROP_TYPE_STRING) {
@@ -4047,17 +4089,22 @@
if
(enable_debug)
printf
("value (dn) = %s \n", values[j]);
do {
-
g_rec_mutex_lock (&eds_ldap_handler_lock);
- if
((ldap_error = ldap_search_ext_s (bl->priv->ldap,
-
values[j],
-
LDAP_SCOPE_BASE,
-
NULL,
-
(gchar **) grpattrs, 0,
-
NULL,
-
NULL,
-
NULL,
-
view_limit,
-
&result)) == LDAP_SUCCESS) {
+ if
(bl->priv->ldap) {
+
ldap_error = ldap_search_ext_s (bl->priv->ldap,
+
values[j],
+
LDAP_SCOPE_BASE,
+
NULL,
+
(gchar **) grpattrs, 0,
+
NULL,
+
NULL,
+
NULL,
+
view_limit,
+
&result);
+ } else {
+
ldap_error = LDAP_SERVER_DOWN;
+ }
+
+ if
(ldap_error == LDAP_SUCCESS) {
/* find the e-mail ids of members */
cn_values = ldap_get_values (bl->priv->ldap, result, "cn");
email_values = ldap_get_values (bl->priv->ldap, result, "mail");
@@ -4081,7 +4128,6 @@
ldap_value_free (cn_values);
}
}
-
g_rec_mutex_unlock (&eds_ldap_handler_lock);
}
while
(e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
@@ -4107,7 +4153,6 @@
}
ldap_memfree (attr);
- g_rec_mutex_lock (&eds_ldap_handler_lock);
}
g_rec_mutex_unlock (&eds_ldap_handler_lock);
@@ -4229,17 +4274,25 @@
msg_type = ldap_msgtype (res);
if (msg_type == LDAP_RES_SEARCH_ENTRY) {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_first_entry (bl->priv->ldap, res);
+ if (bl->priv->ldap)
+ e = ldap_first_entry (bl->priv->ldap, res);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
while (NULL != e) {
EContact *contact = build_contact_from_entry (bl, e,
NULL, NULL);
- e_data_book_view_notify_update (view, contact);
- g_object_unref (contact);
+ if (contact) {
+ e_data_book_view_notify_update (view, contact);
+ g_object_unref (contact);
+ }
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_next_entry (bl->priv->ldap, e);
+ if (bl->priv->ldap)
+ e = ldap_next_entry (bl->priv->ldap, e);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
}
} else if (msg_type == LDAP_RES_SEARCH_REFERENCE) {
@@ -4250,9 +4303,13 @@
gint ldap_error;
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_parse_result (
- bl->priv->ldap, res, &ldap_error,
- NULL, &ldap_error_msg, NULL, NULL, 0);
+ if (bl->priv->ldap) {
+ ldap_parse_result (
+ bl->priv->ldap, res, &ldap_error,
+ NULL, &ldap_error_msg, NULL, NULL, 0);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (ldap_error != LDAP_SUCCESS) {
g_warning (
@@ -4388,15 +4445,19 @@
book_view_notify_status (bl, view, _("Searching..."));
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_err = ldap_search_ext (
- bl->priv->ldap, bl->priv->ldap_rootdn,
- bl->priv->ldap_scope,
- ldap_query,
- NULL, 0,
- NULL, /* XXX */
- NULL, /* XXX */
- NULL, /* XXX timeout */
- view_limit, &search_msgid);
+ if (bl->priv->ldap) {
+ ldap_err = ldap_search_ext (
+ bl->priv->ldap, bl->priv->ldap_rootdn,
+ bl->priv->ldap_scope,
+ ldap_query,
+ NULL, 0,
+ NULL, /* XXX */
+ NULL, /* XXX */
+ NULL, /* XXX timeout */
+ view_limit, &search_msgid);
+ } else {
+ ldap_err = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
} while (e_book_backend_ldap_reconnect (bl, view, ldap_err));
@@ -4512,16 +4573,23 @@
msg_type = ldap_msgtype (res);
if (msg_type == LDAP_RES_SEARCH_ENTRY) {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_first_entry (bl->priv->ldap, res);
+ if (bl->priv->ldap)
+ e = ldap_first_entry (bl->priv->ldap, res);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
while (e != NULL) {
EContact *contact = build_contact_from_entry (bl, e,
NULL, NULL);
- contact_list_op->contacts = g_slist_prepend
(contact_list_op->contacts, contact);
+ if (contact)
+ contact_list_op->contacts = g_slist_prepend
(contact_list_op->contacts, contact);
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_next_entry (bl->priv->ldap, e);
+ if (bl->priv->ldap)
+ e = ldap_next_entry (bl->priv->ldap, e);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
}
} else {
@@ -4649,14 +4717,18 @@
do {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_search_ext (
- priv->ldap,
- priv->ldap_rootdn,
- priv->ldap_scope,
- "(cn=*)",
- NULL, 0, NULL, NULL,
- NULL, /* XXX timeout */
- LDAP_NO_LIMIT, &contact_list_msgid);
+ if (priv->ldap) {
+ ldap_error = ldap_search_ext (
+ priv->ldap,
+ priv->ldap_rootdn,
+ priv->ldap_scope,
+ "(cn=*)",
+ NULL, 0, NULL, NULL,
+ NULL, /* XXX timeout */
+ LDAP_NO_LIMIT, &contact_list_msgid);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
} while (e_book_backend_ldap_reconnect (book_backend_ldap, NULL,
ldap_error));
@@ -5112,9 +5184,13 @@
do {
book_view_notify_status (bl, book_view, _("Adding contact to
LDAP server..."));
g_rec_mutex_lock (&eds_ldap_handler_lock);
- err = ldap_add_ext (
- bl->priv->ldap, create_op->dn, ldap_mods,
- NULL, NULL, &create_contact_msgid);
+ if (bl->priv->ldap) {
+ err = ldap_add_ext (
+ bl->priv->ldap, create_op->dn, ldap_mods,
+ NULL, NULL, &create_contact_msgid);
+ } else {
+ err = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
} while (e_book_backend_ldap_reconnect (bl, book_view, err));
@@ -5188,13 +5264,17 @@
book_view_notify_status (bl, book_view, _("Modifying contact
from LDAP server..."));
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_search_ext (
- bl->priv->ldap, modify_op->id,
- LDAP_SCOPE_BASE,
- "(objectclass=*)",
- NULL, 0, NULL, NULL,
- NULL, /* XXX timeout */
- 1, &modify_contact_msgid);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_search_ext (
+ bl->priv->ldap, modify_op->id,
+ LDAP_SCOPE_BASE,
+ "(objectclass=*)",
+ NULL, 0, NULL, NULL,
+ NULL, /* XXX timeout */
+ 1, &modify_contact_msgid);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
} while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
@@ -5254,10 +5334,14 @@
book_view_notify_status (bl, book_view, _("Removing contact
from LDAP server..."));
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_delete_ext (
- bl->priv->ldap,
- remove_op->id,
- NULL, NULL, &remove_msgid);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_delete_ext (
+ bl->priv->ldap,
+ remove_op->id,
+ NULL, NULL, &remove_msgid);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
} while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
@@ -5340,13 +5424,17 @@
do {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_search_ext (
- bl->priv->ldap, id,
- LDAP_SCOPE_BASE,
- "(objectclass=*)",
- NULL, 0, NULL, NULL,
- NULL, /* XXX timeout */
- 1, &get_contact_msgid);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_search_ext (
+ bl->priv->ldap, id,
+ LDAP_SCOPE_BASE,
+ "(objectclass=*)",
+ NULL, 0, NULL, NULL,
+ NULL, /* XXX timeout */
+ 1, &get_contact_msgid);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
} while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
@@ -5443,14 +5531,18 @@
do {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_search_ext (
- bl->priv->ldap,
- bl->priv->ldap_rootdn,
- bl->priv->ldap_scope,
- ldap_query,
- NULL, 0, NULL, NULL,
- NULL, /* XXX timeout */
- LDAP_NO_LIMIT, &contact_list_msgid);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_search_ext (
+ bl->priv->ldap,
+ bl->priv->ldap_rootdn,
+ bl->priv->ldap_scope,
+ ldap_query,
+ NULL, 0, NULL, NULL,
+ NULL, /* XXX timeout */
+ LDAP_NO_LIMIT, &contact_list_msgid);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
} while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
@@ -5546,14 +5638,18 @@
do {
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_search_ext (
- bl->priv->ldap,
- bl->priv->ldap_rootdn,
- bl->priv->ldap_scope,
- ldap_query,
- NULL, 0, NULL, NULL,
- NULL, /* XXX timeout */
- LDAP_NO_LIMIT, &contact_list_uids_msgid);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_search_ext (
+ bl->priv->ldap,
+ bl->priv->ldap_rootdn,
+ bl->priv->ldap_scope,
+ ldap_query,
+ NULL, 0, NULL, NULL,
+ NULL, /* XXX timeout */
+ LDAP_NO_LIMIT, &contact_list_uids_msgid);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
} while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
@@ -5626,12 +5722,16 @@
gchar *entry_dn;
g_rec_mutex_lock (&eds_ldap_handler_lock);
- ldap_error = ldap_search_s (
- bl->priv->ldap,
- bl->priv->ldap_rootdn,
- bl->priv->ldap_scope,
- query,
- NULL, 0, &res);
+ if (bl->priv->ldap) {
+ ldap_error = ldap_search_s (
+ bl->priv->ldap,
+ bl->priv->ldap_rootdn,
+ bl->priv->ldap_scope,
+ query,
+ NULL, 0, &res);
+ } else {
+ ldap_error = LDAP_SERVER_DOWN;
+ }
g_rec_mutex_unlock (&eds_ldap_handler_lock);
g_free (query);
@@ -5639,7 +5739,10 @@
goto exit;
g_rec_mutex_lock (&eds_ldap_handler_lock);
- e = ldap_first_entry (bl->priv->ldap, res);
+ if (bl->priv->ldap)
+ e = ldap_first_entry (bl->priv->ldap, res);
+ else
+ e = NULL;
g_rec_mutex_unlock (&eds_ldap_handler_lock);
if (!e) {
ldap_msgfree (res);
@@ -5656,7 +5759,10 @@
}
g_rec_mutex_lock (&eds_ldap_handler_lock);
- entry_dn = ldap_get_dn (bl->priv->ldap, e);
+ if (bl->priv->ldap)
+ entry_dn = ldap_get_dn (bl->priv->ldap, e);
+ else
+ entry_dn = NULL;
bl->priv->connected = FALSE; /* to reconnect with
credentials */
g_rec_mutex_unlock (&eds_ldap_handler_lock);
dn = g_strdup (entry_dn);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/evolution-data-server-3.26.3/src/camel/camel-mime-parser.c
new/evolution-data-server-3.26.4/src/camel/camel-mime-parser.c
--- old/evolution-data-server-3.26.3/src/camel/camel-mime-parser.c
2017-12-11 11:57:27.000000000 +0100
+++ new/evolution-data-server-3.26.4/src/camel/camel-mime-parser.c
2018-01-08 11:05:37.000000000 +0100
@@ -98,6 +98,7 @@
gint unstep; /* how many states to 'unstep' (repeat the
current state) */
guint midline:1; /* are we mid-line interrupted? */
+ guint check_header_folded:1; /* check whether header is folded
first? */
guint scan_from:1; /* do we care about From lines? */
guint scan_pre_from:1; /* do we return pre-from data? */
guint eof:1; /* reached eof? */
@@ -1308,6 +1309,23 @@
goto header_done;
}
+ } else if (s->check_header_folded) {
+ if (*inptr != ' ' && *inptr != '\t') {
+ s->outptr[0] = 0;
+
+ /* The outbuf can contain an
extra \r\n, thus remove it */
+ if (s->outptr > s->outbuf &&
s->outptr[-1] == '\n')
+ s->outptr[-1] = 0;
+
+ if (s->outptr - 1 > s->outbuf
&& s->outptr[-2] == '\r')
+ s->outptr[-2] = 0;
+
+ h (printf ("header not folded
'%s' at %d\n", s->outbuf, (gint) s->header_start));
+
+ header_raw_append_parse
(&h->headers, s->outbuf, s->header_start);
+ s->outptr = s->outbuf;
+ s->header_start = -1;
+ }
}
/* goto next line/sentinal */
@@ -1317,16 +1335,18 @@
g_return_val_if_fail (inptr <= s->inend + 1,
NULL);
/* check for sentinal or real end of line */
- if (inptr > inend) {
+ if (inptr >= inend) {
h (printf ("not at end of line yet,
going further\n"));
/* didn't find end of line within our
allowed area */
- inptr = inend;
s->midline = TRUE;
+ s->check_header_folded = inptr == inend;
+ inptr = inend;
header_append (s, start, inptr);
} else {
h (printf ("got line part: '%.*s'\n",
inptr - 1 - start, start));
/* got a line, strip and add it,
process it */
s->midline = FALSE;
+ s->check_header_folded = FALSE;
header_append (s, start, inptr - 1);
/* check for end of headers */
@@ -1554,6 +1574,7 @@
s->start_of_boundary = -1;
s->midline = FALSE;
+ s->check_header_folded = FALSE;
s->scan_from = FALSE;
s->scan_pre_from = FALSE;
s->eof = FALSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/evolution-data-server-3.26.3/src/camel/camel-mime-utils.c
new/evolution-data-server-3.26.4/src/camel/camel-mime-utils.c
--- old/evolution-data-server-3.26.3/src/camel/camel-mime-utils.c
2017-12-11 11:57:27.000000000 +0100
+++ new/evolution-data-server-3.26.4/src/camel/camel-mime-utils.c
2018-01-08 11:05:37.000000000 +0100
@@ -1128,6 +1128,35 @@
}
}
+static void
+sanitize_decoded_text (guchar *text,
+ gssize *inout_textlen)
+{
+ gssize ii, jj, textlen;
+
+ g_return_if_fail (text != NULL);
+ g_return_if_fail (inout_textlen != NULL);
+
+ textlen = *inout_textlen;
+
+ for (ii = 0, jj = 0; ii < textlen; ii++) {
+ /* Skip '\0' and '\r' characters */
+ if (text[ii] == 0 || text[ii] == '\r')
+ continue;
+
+ /* Change '\n' into space */
+ if (text[ii] == '\n')
+ text[ii] = ' ';
+
+ if (ii != jj)
+ text[jj] = text[ii];
+
+ jj++;
+ }
+
+ *inout_textlen = jj;
+}
+
/* decode an rfc2047 encoded-word token */
static gchar *
rfc2047_decode_word (const gchar *in,
@@ -1176,6 +1205,8 @@
return NULL;
}
+ sanitize_decoded_text (decoded, &declen);
+
/* never return empty string, return rather NULL */
if (!declen)
return NULL;
@@ -2892,6 +2923,10 @@
}
address = camel_header_address_new_name (name ? name->str : "",
addr->str);
+ } else if (name) {
+ /* A name-only address, might be something wrong, but include
it anyway */
+ make_string_utf8_valid (name->str, name->len);
+ address = camel_header_address_new_name (name->str, "");
}
d (printf ("got mailbox: %s\n", addr->str));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/evolution-data-server-3.26.3/src/camel/providers/local/camel-maildir-summary.c
new/evolution-data-server-3.26.4/src/camel/providers/local/camel-maildir-summary.c
---
old/evolution-data-server-3.26.3/src/camel/providers/local/camel-maildir-summary.c
2017-12-11 11:57:27.000000000 +0100
+++
new/evolution-data-server-3.26.4/src/camel/providers/local/camel-maildir-summary.c
2018-01-08 11:05:37.000000000 +0100
@@ -872,7 +872,6 @@
}
if (g_stat (dest, &st) == -1) {
/* we'll assume it didn't work, but
dont change anything else */
- g_free (newname);
} else {
/* TODO: If this is made mt-safe, then
this code could be a problem, since
* the estrv is being modified.