From 8073cfb09da6d3ca9ad1ea7d37041b796a392288 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 2 May 2017 10:55:03 +0200 Subject: [PATCH] Added mozilla-1158578-recursion-fix patch and update to 52.1.0 --- mozilla-1158578-recursion-fix.patch | 147 ++++++++++++++++++++++++++++ thunderbird.spec | 18 +++- 2 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 mozilla-1158578-recursion-fix.patch diff --git a/mozilla-1158578-recursion-fix.patch b/mozilla-1158578-recursion-fix.patch new file mode 100644 index 0000000..77bc6ef --- /dev/null +++ b/mozilla-1158578-recursion-fix.patch @@ -0,0 +1,147 @@ +# vim: se ft=diff : +# HG changeset patch +# User Jan Horak +# Date 2017-04-26 02:36 +# Parent 540cd06b1aea0bfa6f906b86393f5480914c01c2 +Bug 1158578 - fix crash when compacting IMAP account. r=jorgk + +diff --git a/mailnews/base/src/nsMsgFolderCompactor.cpp b/mailnews/base/src/nsMsgFolderCompactor.cpp +--- a/mailnews/base/src/nsMsgFolderCompactor.cpp ++++ b/mailnews/base/src/nsMsgFolderCompactor.cpp +@@ -31,16 +31,17 @@ + #include "nsIMsgStatusFeedback.h" + #include "nsMsgBaseCID.h" + #include "nsIMsgFolderNotificationService.h" + #include "nsIMsgPluggableStore.h" + #include "nsMsgFolderCompactor.h" + #include + #include "nsIOutputStream.h" + #include "nsIInputStream.h" ++#include "nsPrintfCString.h" + + + ////////////////////////////////////////////////////////////////////////////// + // nsFolderCompactState + ////////////////////////////////////////////////////////////////////////////// + + NS_IMPL_ISUPPORTS(nsFolderCompactState, nsIMsgFolderCompactor, nsIRequestObserver, nsIStreamListener, nsICopyMessageStreamListener, nsIUrlListener) + +@@ -1096,16 +1097,24 @@ nsOfflineStoreCompactState::OnStopReques + // check for it specifically and don't terminate the compaction. + if (NS_FAILED(rv) && rv != NS_MSG_ERROR_MSG_NOT_OFFLINE) + goto done; + uri = do_QueryInterface(ctxt, &rv); + if (NS_FAILED(rv)) goto done; + rv = GetMessage(getter_AddRefs(msgHdr)); + if (NS_FAILED(rv)) goto done; + ++ // This is however an unexpected condition, so let's print a warning. ++ if (rv == NS_MSG_ERROR_MSG_NOT_OFFLINE) { ++ nsAutoCString spec; ++ uri->GetSpec(spec); ++ nsPrintfCString msg("Message expectedly not available offline: %s", spec.get()); ++ NS_WARNING(msg.get()); ++ } ++ + if (msgHdr) + { + if (NS_SUCCEEDED(status)) + { + msgHdr->SetMessageOffset(m_startOfNewMsg); + char storeToken[100]; + PR_snprintf(storeToken, sizeof(storeToken), "%lld", m_startOfNewMsg); + msgHdr->SetStringProperty("storeToken", storeToken); +diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp +--- a/mailnews/imap/src/nsImapProtocol.cpp ++++ b/mailnews/imap/src/nsImapProtocol.cpp +@@ -9500,35 +9500,66 @@ nsresult nsImapMockChannel::ReadFromMemC + // Content is modified so return an error so we try to open it the + // old fashioned way. + rv = NS_ERROR_FAILURE; + } + + return rv; + } + ++class nsReadFromImapConnectionFailure : public mozilla::Runnable ++{ ++public: ++ nsReadFromImapConnectionFailure(nsImapMockChannel *aChannel) ++ : mImapMockChannel(aChannel) ++ {} ++ ++ NS_IMETHOD Run() ++ { ++ if (mImapMockChannel) { ++ mImapMockChannel->RunOnStopRequestFailure(); ++ } ++ return NS_OK; ++ } ++private: ++ RefPtr mImapMockChannel; ++}; ++ ++ ++nsresult nsImapMockChannel::RunOnStopRequestFailure() ++{ ++ if (m_channelListener) { ++ m_channelListener->OnStopRequest(this, m_channelContext, ++ NS_MSG_ERROR_MSG_NOT_OFFLINE); ++ } ++ return NS_OK; ++} ++ + // the requested url isn't in any of our caches so create an imap connection + // to process it. + nsresult nsImapMockChannel::ReadFromImapConnection() + { + nsresult rv = NS_OK; + nsCOMPtr imapUrl = do_QueryInterface(m_url); + nsCOMPtr mailnewsUrl = do_QueryInterface(m_url); + + bool localOnly = false; + imapUrl->GetLocalFetchOnly(&localOnly); + if (localOnly) + { + // This will cause an OnStartRunningUrl, and the subsequent close + // will then cause an OnStopRunningUrl with the cancel status. + NotifyStartEndReadFromCache(true); + Cancel(NS_MSG_ERROR_MSG_NOT_OFFLINE); +- if (m_channelListener) +- m_channelListener->OnStopRequest(this, m_channelContext, +- NS_MSG_ERROR_MSG_NOT_OFFLINE); ++ ++ // Dispatch error notification, so ReadFromImapConnection() returns *before* ++ // the error is sent to the listener's OnStopRequest(). This avoids ++ // endless recursion where the caller relies on async execution. ++ nsCOMPtr event = new nsReadFromImapConnectionFailure(this); ++ NS_DispatchToCurrentThread(event); + return NS_MSG_ERROR_MSG_NOT_OFFLINE; + } + + nsCOMPtr loadGroup; + GetLoadGroup(getter_AddRefs(loadGroup)); + if (!loadGroup) // if we don't have one, the url will snag one from the msg window... + mailnewsUrl->GetLoadGroup(getter_AddRefs(loadGroup)); + +diff --git a/mailnews/imap/src/nsImapProtocol.h b/mailnews/imap/src/nsImapProtocol.h +--- a/mailnews/imap/src/nsImapProtocol.h ++++ b/mailnews/imap/src/nsImapProtocol.h +@@ -714,16 +714,17 @@ public: + NS_DECL_NSIIMAPMOCKCHANNEL + NS_DECL_NSICHANNEL + NS_DECL_NSIREQUEST + NS_DECL_NSICACHEENTRYOPENCALLBACK + NS_DECL_NSITRANSPORTEVENTSINK + + nsImapMockChannel(); + static nsresult Create (const nsIID& iid, void **result); ++ nsresult RunOnStopRequestFailure(); + + protected: + virtual ~nsImapMockChannel(); + nsCOMPtr m_url; + + nsCOMPtr m_originalUrl; + nsCOMPtr m_loadGroup; + nsCOMPtr m_loadInfo; diff --git a/thunderbird.spec b/thunderbird.spec index 47d320f..a4d5a0d 100644 --- a/thunderbird.spec +++ b/thunderbird.spec @@ -63,13 +63,13 @@ %endif %define tb_version 45.6.0 -%define tarballdir thunderbird-52.0 +%define tarballdir thunderbird-52.1.0 %define thunderbird_app_id \{3550f703-e582-4d05-9a08-453d09bdfdc6\} # Bump one with each minor lightning release %define gdata_version 3.3 # BUMP VERSION THERE: -%define gdata_version_internal 0.1 +%define gdata_version_internal 0.2 %global gdata_extname %{_libdir}/mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc} # The tarball is pretty inconsistent with directory structure. @@ -91,14 +91,14 @@ Summary: Mozilla Thunderbird mail/newsgroup client Name: thunderbird -Version: 52.0 -Release: 2%{?dist} +Version: 52.1.0 +Release: 1%{?dist} URL: http://www.mozilla.org/projects/thunderbird/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Group: Applications/Internet Source0: ftp://ftp.mozilla.org/pub/thunderbird/releases/%{version}%{?pre_version}/source/thunderbird-%{version}%{?pre_version}.source.tar.xz %if %{build_langpacks} -Source1: thunderbird-langpacks-%{version}-20170404.tar.xz +Source1: thunderbird-langpacks-%{version}-20170502.tar.xz %endif # Locales for lightning Source2: l10n-lightning-%{version}.tar.xz @@ -139,6 +139,9 @@ Patch400: rhbz-966424.patch Patch403: rhbz-1400293-fix-mozilla-1324096.patch # libvpx no longer has compat defines, use the current ones +# Upstream patches +Patch500: mozilla-1158578-recursion-fix.patch + %if %{official_branding} # Required by Mozilla Corporation @@ -274,6 +277,7 @@ cd .. %patch305 -p1 -b .fix-dupes %patch105 -p1 -b .bad-langs %patch200 -p1 -b .addons +%patch500 -p1 -b .1158578-recursion-fix %if %{official_branding} @@ -720,6 +724,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #=============================================================================== %changelog +* Tue May 2 2017 Jan Horak - 52.1.0-1 +- Update to 52.1.0 +- Added patch for rhbz#1442903 - crash when compacting folder + * Wed Apr 12 2017 Jan Horak - 52.0-2 - Added fix for rhbz#1441601 - problems with TLS server certificates