Added patch to mozbz#1460871

This commit is contained in:
Jan Horak 2018-10-04 10:44:47 +02:00
parent c6fa01d4d1
commit 78bde015a4
2 changed files with 169 additions and 2 deletions

View File

@ -0,0 +1,164 @@
diff -up thunderbird-60.2.1/comm/ldap/xpcom/public/nsILDAPOperation.idl.1460871-ldap-query thunderbird-60.2.1/comm/ldap/xpcom/public/nsILDAPOperation.idl
--- thunderbird-60.2.1/comm/ldap/xpcom/public/nsILDAPOperation.idl.1460871-ldap-query 2018-10-01 16:52:39.000000000 +0200
+++ thunderbird-60.2.1/comm/ldap/xpcom/public/nsILDAPOperation.idl 2018-10-04 09:40:04.491575949 +0200
@@ -52,6 +52,10 @@ interface nsILDAPOperation : nsISupports
* private parameter (anything caller desires)
*/
attribute nsISupports closure;
+ /**
+ * number of the request for compare that the request is still valid.
+ */
+ attribute unsigned long requestNum;
/**
* No time and/or size limit specified
diff -up thunderbird-60.2.1/comm/ldap/xpcom/src/nsLDAPOperation.cpp.1460871-ldap-query thunderbird-60.2.1/comm/ldap/xpcom/src/nsLDAPOperation.cpp
--- thunderbird-60.2.1/comm/ldap/xpcom/src/nsLDAPOperation.cpp.1460871-ldap-query 2018-10-01 16:52:39.000000000 +0200
+++ thunderbird-60.2.1/comm/ldap/xpcom/src/nsLDAPOperation.cpp 2018-10-04 09:40:04.491575949 +0200
@@ -400,6 +400,19 @@ convertControlArray(nsIArray *aXpcomArra
return NS_OK;
}
+ /* attribute unsigned long requestNum; */
+NS_IMETHODIMP nsLDAPOperation::GetRequestNum(uint32_t *aRequestNum)
+{
+ *aRequestNum = mRequestNum;
+ return NS_OK;
+}
+
+NS_IMETHODIMP nsLDAPOperation::SetRequestNum(uint32_t aRequestNum)
+{
+ mRequestNum = aRequestNum;
+ return NS_OK;
+}
+
NS_IMETHODIMP
nsLDAPOperation::SearchExt(const nsACString& aBaseDn, int32_t aScope,
const nsACString& aFilter,
diff -up thunderbird-60.2.1/comm/ldap/xpcom/src/nsLDAPOperation.h.1460871-ldap-query thunderbird-60.2.1/comm/ldap/xpcom/src/nsLDAPOperation.h
--- thunderbird-60.2.1/comm/ldap/xpcom/src/nsLDAPOperation.h.1460871-ldap-query 2018-10-01 16:52:39.000000000 +0200
+++ thunderbird-60.2.1/comm/ldap/xpcom/src/nsLDAPOperation.h 2018-10-04 09:40:04.491575949 +0200
@@ -36,6 +36,8 @@ class nsLDAPOperation : public nsILDAPOp
* used to break cycles
*/
void Clear();
+ // Stores the request number for later check of the operation is still valid
+ int32_t mRequestNum;
private:
virtual ~nsLDAPOperation();
diff -up thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp.1460871-ldap-query thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
--- thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp.1460871-ldap-query 2018-10-01 16:52:43.000000000 +0200
+++ thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp 2018-10-04 09:40:55.334670404 +0200
@@ -22,6 +22,8 @@
using namespace mozilla;
+extern mozilla::LazyLogModule gLDAPLogModule; // defined in nsLDAPService.cpp
+
// nsAbLDAPListenerBase inherits nsILDAPMessageListener
class nsAbQueryLDAPMessageListener : public nsAbLDAPListenerBase
{
@@ -66,7 +68,6 @@ protected:
bool mFinished;
bool mCanceled;
- bool mWaitingForPrevQueryToFinish;
nsCOMPtr<nsIMutableArray> mServerSearchControls;
nsCOMPtr<nsIMutableArray> mClientSearchControls;
@@ -94,7 +95,6 @@ nsAbQueryLDAPMessageListener::nsAbQueryL
mResultLimit(resultLimit),
mFinished(false),
mCanceled(false),
- mWaitingForPrevQueryToFinish(false),
mServerSearchControls(serverSearchControls),
mClientSearchControls(clientSearchControls)
{
@@ -116,9 +116,6 @@ nsresult nsAbQueryLDAPMessageListener::C
return NS_OK;
mCanceled = true;
- if (!mFinished)
- mWaitingForPrevQueryToFinish = true;
-
return NS_OK;
}
@@ -129,6 +126,8 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListen
int32_t messageType;
rv = aMessage->GetType(&messageType);
+ uint32_t requestNum;
+ mOperation->GetRequestNum(&requestNum);
NS_ENSURE_SUCCESS(rv, rv);
bool cancelOperation = false;
@@ -137,6 +136,14 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListen
{
MutexAutoLock lock (mLock);
+ if (requestNum != sCurrentRequestNum) {
+ MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug,
+ ("nsAbQueryLDAPMessageListener::OnLDAPMessage: Ignoring message with "
+ "request num %d, current request num is %d.",
+ requestNum, sCurrentRequestNum));
+ return NS_OK;
+ }
+
if (mFinished)
return NS_OK;
@@ -166,11 +173,10 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListen
rv = OnLDAPMessageSearchResult(aMessage);
break;
case nsILDAPMessage::RES_SEARCH_ENTRY:
- if (!mFinished && !mWaitingForPrevQueryToFinish)
+ if (!mFinished)
rv = OnLDAPMessageSearchEntry(aMessage);
break;
case nsILDAPMessage::RES_SEARCH_RESULT:
- mWaitingForPrevQueryToFinish = false;
rv = OnLDAPMessageSearchResult(aMessage);
NS_ENSURE_SUCCESS(rv, rv);
break;
@@ -207,6 +213,8 @@ nsresult nsAbQueryLDAPMessageListener::D
rv = mOperation->Init(mConnection, this, nullptr);
NS_ENSURE_SUCCESS(rv, rv);
+ mOperation->SetRequestNum(++sCurrentRequestNum);
+
nsAutoCString dn;
rv = mSearchUrl->GetDn(dn);
NS_ENSURE_SUCCESS(rv, rv);
diff -up thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPListenerBase.cpp.1460871-ldap-query thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPListenerBase.cpp
--- thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPListenerBase.cpp.1460871-ldap-query 2018-10-01 16:52:43.000000000 +0200
+++ thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPListenerBase.cpp 2018-10-04 09:40:04.492575951 +0200
@@ -20,6 +20,8 @@
using namespace mozilla;
+uint32_t nsAbLDAPListenerBase::sCurrentRequestNum = 0;
+
nsAbLDAPListenerBase::nsAbLDAPListenerBase(nsILDAPURL* url,
nsILDAPConnection* connection,
const nsACString &login,
@@ -249,6 +251,7 @@ NS_IMETHODIMP nsAbLDAPListenerBase::OnLD
InitFailed();
return rv;
}
+ mOperation->SetRequestNum(++sCurrentRequestNum);
// Try non-password mechanisms first
if (mSaslMechanism.EqualsLiteral("GSSAPI"))
diff -up thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPListenerBase.h.1460871-ldap-query thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPListenerBase.h
--- thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPListenerBase.h.1460871-ldap-query 2018-10-01 16:52:43.000000000 +0200
+++ thunderbird-60.2.1/comm/mailnews/addrbook/src/nsAbLDAPListenerBase.h 2018-10-04 09:40:04.492575951 +0200
@@ -47,6 +47,7 @@ protected:
int32_t mTimeOut;
bool mBound;
bool mInitialized;
+ static uint32_t sCurrentRequestNum;
mozilla::Mutex mLock;
};

View File

@ -89,7 +89,7 @@
Summary: Mozilla Thunderbird mail/newsgroup client Summary: Mozilla Thunderbird mail/newsgroup client
Name: thunderbird Name: thunderbird
Version: 60.2.1 Version: 60.2.1
Release: 1%{?dist} Release: 2%{?dist}
URL: http://www.mozilla.org/projects/thunderbird/ URL: http://www.mozilla.org/projects/thunderbird/
License: MPLv1.1 or GPLv2+ or LGPLv2+ License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet Group: Applications/Internet
@ -126,6 +126,7 @@ Patch305: build-big-endian.patch
Patch306: mozilla-1353817.patch Patch306: mozilla-1353817.patch
Patch307: build-disable-elfhack.patch Patch307: build-disable-elfhack.patch
Patch308: build-triplet-failure.patch Patch308: build-triplet-failure.patch
Patch309: mozilla-1460871-ldap-query.patch
# Fedora specific patches # Fedora specific patches
@ -238,6 +239,7 @@ debug %{name}, you want to install %{name}-debuginfo instead.
%patch304 -p1 -b .1245783 %patch304 -p1 -b .1245783
%patch308 -p1 -b .triplet-failure %patch308 -p1 -b .triplet-failure
%patch309 -p1 -b .1460871-ldap-query
# Patch for big endian platforms only # Patch for big endian platforms only
%if 0%{?big_endian} %if 0%{?big_endian}
%patch26 -p1 -b .icu %patch26 -p1 -b .icu
@ -693,8 +695,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#=============================================================================== #===============================================================================
%changelog %changelog
* Wed Oct 3 2018 Jan Horak <jhorak@redhat.com> - 60.2.1-1 * Wed Oct 3 2018 Jan Horak <jhorak@redhat.com> - 60.2.1-2
- Update to 60.2.1 - Update to 60.2.1
- Added fix for rhbz#1546988
* Wed Aug 15 2018 Jan Horak <jhorak@redhat.com> - 60.0-1 * Wed Aug 15 2018 Jan Horak <jhorak@redhat.com> - 60.0-1
- Update to 60.0 - Update to 60.0