import CS evolution-ews-3.28.5-15.el8

This commit is contained in:
eabdullin 2024-03-27 19:38:11 +00:00
parent 19f3b50226
commit 0fc0f80e2c
3 changed files with 97 additions and 1 deletions

View File

@ -0,0 +1,57 @@
diff -up evolution-ews-3.28.5/src/camel/camel-ews-folder.c.workaround-office365.com-bug evolution-ews-3.28.5/src/camel/camel-ews-folder.c
--- evolution-ews-3.28.5/src/camel/camel-ews-folder.c.workaround-office365.com-bug 2018-07-30 16:01:00.000000000 +0200
+++ evolution-ews-3.28.5/src/camel/camel-ews-folder.c 2023-12-13 13:38:31.707627927 +0100
@@ -355,7 +355,7 @@ ews_get_calendar_mime_part (CamelMimePar
}
static gchar *
-ews_update_mgtrequest_mime_calendar_itemid (const gchar *mime_fname,
+ews_update_mtgrequest_mime_calendar_itemid (const gchar *mime_fname,
const EwsId *calendar_item_id,
gboolean is_calendar_UID,
const EwsId *mail_item_id,
@@ -414,6 +414,35 @@ ews_update_mgtrequest_mime_calendar_item
if (ba && ba->len) {
g_byte_array_append (ba, (guint8 *) "\0", 1);
icalcomp = icalparser_parse_string ((gchar *) ba->data);
+ if (!icalcomp) {
+ const gchar *content = (const gchar *) ba->data;
+ const gchar *begin_vcalendar, *end_vcalendar;
+
+ /* Workaround Office365.com error, which returns invalid iCalendar object (without 'END:VCALENDAR'),
+ in the MimeContent's text/calendar attachments as of 2023-12-12. */
+ begin_vcalendar = camel_strstrcase (content, "BEGIN:VCALENDAR");
+ end_vcalendar = camel_strstrcase (content, "END:VCALENDAR");
+
+ /* If it exists, then it should be alone on a separate line */
+ if (!(begin_vcalendar && (begin_vcalendar == content || begin_vcalendar[-1] == '\n') &&
+ (begin_vcalendar[15 /* strlen ("BEGIN:VCALENDAR") */] == '\r' || begin_vcalendar[15] == '\n')))
+ begin_vcalendar = NULL;
+
+ /* If it exists, then it should be alone on a separate line and not at the very beginning of the mime_content */
+ if (!(end_vcalendar && end_vcalendar > content && end_vcalendar[-1] == '\n' &&
+ (end_vcalendar[13 /* strlen ("END:VCALENDAR") */] == '\r' || end_vcalendar[13] == '\n' || end_vcalendar[13] == '\0')))
+ end_vcalendar = NULL;
+
+ if (begin_vcalendar && !end_vcalendar) {
+ g_byte_array_remove_index (ba, ba->len - 1);
+ #define add_str(_str) g_byte_array_append (ba, (guint8 *) _str, strlen (_str))
+ add_str ("\r\nEND:VCALENDAR\r\n");
+ #undef add_str
+ g_byte_array_append (ba, (guint8 *) "\0", 1);
+
+ icalcomp = icalparser_parse_string ((gchar *) ba->data);
+ }
+ }
}
if (icalcomp) {
icalcomponent *subcomp;
@@ -888,7 +917,7 @@ camel_ews_folder_get_message (CamelFolde
calendar_item_accept_id = e_ews_item_get_id (items->data);
is_calendar_UID = FALSE;
}
- mime_fname_new = ews_update_mgtrequest_mime_calendar_itemid (mime_content, calendar_item_accept_id, is_calendar_UID, e_ews_item_get_id (items->data), error);
+ mime_fname_new = ews_update_mtgrequest_mime_calendar_itemid (mime_content, calendar_item_accept_id, is_calendar_UID, e_ews_item_get_id (items->data), error);
if (mime_fname_new)
mime_content = (const gchar *) mime_fname_new;

View File

@ -0,0 +1,28 @@
diff -up evolution-ews-3.28.5/src/server/e-ews-connection.c.deadlock evolution-ews-3.28.5/src/server/e-ews-connection.c
--- evolution-ews-3.28.5/src/server/e-ews-connection.c.deadlock 2024-02-06 15:56:24.994038118 +0100
+++ evolution-ews-3.28.5/src/server/e-ews-connection.c 2024-02-06 15:57:45.656178096 +0100
@@ -698,22 +698,20 @@ ews_next_request (gpointer _cnc)
/* Add to active job queue */
cnc->priv->active_job_queue = g_slist_append (cnc->priv->active_job_queue, node);
+ QUEUE_UNLOCK (cnc);
+
if (cnc->priv->soup_session) {
SoupMessage *msg = SOUP_MESSAGE (node->msg);
if (!e_ews_connection_utils_prepare_message (cnc, msg, node->cancellable)) {
e_ews_debug_dump_raw_soup_request (msg);
- QUEUE_UNLOCK (cnc);
ews_response_cb (cnc->priv->soup_session, msg, node);
} else {
e_ews_debug_dump_raw_soup_request (msg);
soup_session_queue_message (cnc->priv->soup_session, msg, ews_response_cb, node);
- QUEUE_UNLOCK (cnc);
}
} else {
- QUEUE_UNLOCK (cnc);
-
ews_cancel_request (NULL, node);
}

View File

@ -2,7 +2,7 @@
Name: evolution-ews
Version: 3.28.5
Release: 13%{?dist}
Release: 15%{?dist}
Group: Applications/Productivity
Summary: Evolution extension for Exchange Web Services
License: LGPLv2
@ -52,6 +52,9 @@ Patch13: evolution-ews-3.28.5-cmake-variable-name-comparison.patch
# RH bug #2082245
Patch14: evolution-ews-3.28.5-autodiscover-improvements.patch
Patch15: 0001-I-250-Mail-Calendar-attachments-can-be-broken-by-the.patch
Patch16: 0002-deadlock-on-op-cancel.patch
Requires: evolution >= %{eds_evo_version}
Requires: evolution-data-server >= %{eds_evo_version}
Requires: %{name}-langpacks = %{version}-%{release}
@ -105,6 +108,8 @@ This package contains translations for %{name}.
%patch12 -p1 -b .oauth2-endpoints
%patch13 -p1 -b .cmake-variable-name-comparison
%patch14 -p1 -b .autodiscover-improvements
%patch15 -p1 -b .workaround-office365.com-bug
%patch16 -p1 -b .deadlock-on-cancel
%build
@ -145,6 +150,12 @@ make install DESTDIR=$RPM_BUILD_ROOT
%files langpacks -f _build/%{name}.lang
%changelog
* Thu Feb 08 2024 Milan Crha <mcrha@redhat.com> - 3.28.5-15
- Resolves: RHEL-24829 (Release queue lock as soon as possible in ews_next_request())
* Wed Dec 13 2023 Milan Crha <mcrha@redhat.com> - 3.28.5-14
- Resolves: RHEL-19376 (Backport upstream patch to workaround broken text/calendar mail attachments by the server)
* Fri May 06 2022 Milan Crha <mcrha@redhat.com> - 3.28.5-13
- Related: #2082245 (Fix issues in the patch found by Coverity scan)