From 1b28bbfa7f731fd7e4f7e37e20b950a13f80a005 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 19 2017 13:25:06 +0000 Subject: import qt-4.8.5-15.el7_4 --- diff --git a/SOURCES/qt-4.8.5-fix-data-corruption-in-readData.patch b/SOURCES/qt-4.8.5-fix-data-corruption-in-readData.patch new file mode 100644 index 0000000..eeedf4c --- /dev/null +++ b/SOURCES/qt-4.8.5-fix-data-corruption-in-readData.patch @@ -0,0 +1,39 @@ +From 1f40ed553e618c3b0511c7db4b4fd26c2d2b65bf Mon Sep 17 00:00:00 2001 +From: Peter Hartmann +Date: Thu, 25 Jul 2013 12:05:29 -0400 +Subject: [PATCH] QHttpMultiPart: fix data corruption in readData method + +When readData() is called repeatedly, we need to keep track which +part of the multipart message we are currently reading from. +Hereby we also need to take the boundary size into account, and not +only the size of the multipart; otherwise we would skip a not +completely read part. This would then later lead to advancing the +read pointer by negative indexes and data loss. + +Task-number: QTBUG-32534 +Change-Id: Ibb6dff16adaf4ea67181d23d1d0c8459e33a0ed0 +Reviewed-by: Jonathan Liu +Reviewed-by: Shane Kearns +(cherry picked from qtbase/af96c6fed931564c95037539f07e9c8e33c69529) +Reviewed-by: Thiago Macieira +--- + src/network/access/qhttpmultipart.cpp | 3 +- + tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 44 ++++++++++++++++++++++++ + 2 files changed, 46 insertions(+), 1 deletions(-) + +diff --git a/src/network/access/qhttpmultipart.cpp b/src/network/access/qhttpmultipart.cpp +index 635129a..b25e917 100644 +--- a/src/network/access/qhttpmultipart.cpp ++++ b/src/network/access/qhttpmultipart.cpp +@@ -488,7 +488,8 @@ qint64 QHttpMultiPartIODevice::readData(char *data, qint64 maxSize) + + // skip the parts we have already read + while (index < multiPart->parts.count() && +- readPointer >= partOffsets.at(index) + multiPart->parts.at(index).d->size()) ++ readPointer >= partOffsets.at(index) + multiPart->parts.at(index).d->size() ++ + multiPart->boundary.count() + 6) // 6 == 2 boundary dashes, \r\n after boundary, \r\n after multipart + index++; + + // read the data +-- +1.7.1 diff --git a/SOURCES/qt-everywhere-opensource-src-4.8.5-do-not-close-apps-on-gnome-shutdown-dialog.patch b/SOURCES/qt-everywhere-opensource-src-4.8.5-do-not-close-apps-on-gnome-shutdown-dialog.patch new file mode 100644 index 0000000..5fb038c --- /dev/null +++ b/SOURCES/qt-everywhere-opensource-src-4.8.5-do-not-close-apps-on-gnome-shutdown-dialog.patch @@ -0,0 +1,42 @@ +diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp +index acb115f..5316c40 100644 +--- a/src/gui/kernel/qapplication.cpp ++++ b/src/gui/kernel/qapplication.cpp +@@ -3525,21 +3525,24 @@ void QApplication::commitData(QSessionManager& manager ) + { + emit commitDataRequest(manager); + if (manager.allowsInteraction()) { +- QWidgetList done; +- QWidgetList list = QApplication::topLevelWidgets(); +- bool cancelled = false; +- for (int i = 0; !cancelled && i < list.size(); ++i) { +- QWidget* w = list.at(i); +- if (w->isVisible() && !done.contains(w)) { +- cancelled = !w->close(); +- if (!cancelled) +- done.append(w); +- list = QApplication::topLevelWidgets(); +- i = -1; ++ const QString desktopEnv = qgetenv("XDG_CURRENT_DESKTOP"); ++ if (!desktopEnv.startsWith(QLatin1String("GNOME"))) { ++ QWidgetList done; ++ QWidgetList list = QApplication::topLevelWidgets(); ++ bool cancelled = false; ++ for (int i = 0; !cancelled && i < list.size(); ++i) { ++ QWidget* w = list.at(i); ++ if (w->isVisible() && !done.contains(w)) { ++ cancelled = !w->close(); ++ if (!cancelled) ++ done.append(w); ++ list = QApplication::topLevelWidgets(); ++ i = -1; ++ } + } ++ if (cancelled) ++ manager.cancel(); + } +- if (cancelled) +- manager.cancel(); + } + } + diff --git a/SPECS/qt.spec b/SPECS/qt.spec index 43576b7..9bbe498 100644 --- a/SPECS/qt.spec +++ b/SPECS/qt.spec @@ -26,7 +26,7 @@ Summary: Qt toolkit Name: qt Epoch: 1 Version: 4.8.5 -Release: 13%{?dist} +Release: 15%{?dist} # See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT @@ -170,7 +170,11 @@ Patch113: qt-everywhere-opensource-src-4.8.5-QTBUG-22829.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1259675 Patch114: qt-revert-QTBUG-15319-fix-shortcuts-with-secondary-Xkb.patch -## upstream git +# Bug 1378865 - Qt based applications get killed in Gnome before confirmation for Logout/Shutdown/Restart +Patch115: qt-everywhere-opensource-src-4.8.5-do-not-close-apps-on-gnome-shutdown-dialog.patch + +# Bug 1489851 - Backport security improvement patch to the current QT 4.8.5 in RHEL7 +Patch150: qt-4.8.5-fix-data-corruption-in-readData.patch # security patches @@ -536,8 +540,10 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch102 -p1 -b .qgtkstyle_disable_gtk_theme_check %patch113 -p1 -b .QTBUG-22829 %patch114 -p1 -b .revert-QTBUG-15319-fix-shortcuts-with-secondary-Xkb.patch +%patch115 -p1 -b .qt-everywhere-opensource-src-4.8.5-do-not-close-apps-on-gnome-shutdown-dialog # upstream git +%patch150 -p1 -b .fix-data-corruption-in-readData # security fixes @@ -1222,6 +1228,14 @@ fi %changelog +* Mon Sep 11 2017 Jan Grulich - 1:4.8.5-15 +- Fix data corruption in readData() + Resolves: bz#1489851 + +* Wed May 24 2017 Jan Grulich - 1:4.8.5-14 +- Don't close Qt apps in Gnome on shutdown dialog + Resolves: bz#1378865 + * Mon May 02 2016 Jan Grulich - 1:4.8.5-13 - Prefer adwaita-qt theme over gtk Resolves: bz#1332094