Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 551640
Collapse All | Expand All

(-)a/dev-qt/qtcore/Manifest (+11 lines)
Line 0 Link Here
1
AUX CVE-2013-4549-01-disallow-deep-or-widely-nested-entity-refs.patch 4531 SHA256 fd6e59635ea7bc86fdc36333ecd77609ae5cdc52c3a388c3b0088887d9a21b72 SHA512 b81810d62e8652f91b787285e8208b42d723e89aef248aeca24f02cd84b4a098c82571ece7c8af9c25c0535bde61ee376b6c24992f55fbaef2dd77f54f14ef1a WHIRLPOOL f7e6d005c157314eba3501bb9fdcecdb1f0b317880d659ac42e9b17a79ba98892c6ad9b49651a81d2a8c5c77d9e6ab9b7953422435543b1e38f1eeef0865dbd3
2
AUX CVE-2013-4549-02-fully-expand-entities.patch 6117 SHA256 848dbcd78c2ae0a3f6acca07b48067c453f721adfbe4dcdc90ca8267eedbc065 SHA512 1564fc1e299704c7f51015fdf3213e3c85460d2950821f53f94bbf98c80275e845aa8804250081df9db8172ca26fde11070e21ce18b8ee17961689ceb96daac9 WHIRLPOOL ccf1494fd0b243aed5149d6f1ebaadb5bfefff4698a95fae6d006247a9daee493e8e4c567a2bc930efc7b22c27761207afd1c8fe8f104c5a3fed491a669d14e8
3
AUX qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch 3410 SHA256 9dbb9be4dfefc00711058b99fe2425bb43c811a1b36a6f046336e13c666d40ea SHA512 6770959ba01756d6a3fa9e03edd5f6c1df0d8625f4add65f7fef55a93b7b52c555a0ce749984938fb7ab905c2e0875cec0cb5d07f45c1b447fbc9e2d0ec678bb WHIRLPOOL d06e33e4d6545b99d930212f6ad767a6c59cb241cb0b28fe3401853700c26c9fd9a5dc0eb5cfaef62ed8f7874eccf906c7c39c469c6725e9db3836c8982422d8
4
AUX qtcore-4.8.5-moc-boost-lexical-cast.patch 584 SHA256 dadd3eab516ee26f1c19f17dbcb7be46e7c9efba49924fa1d53cc0176491736a SHA512 ed2cc3d36ac8576cee42d1586b99913ce060a47e72c82890e7b5fe4fc500e857693f2348f4446ce7dfbd1bbdf6e51b99b57f2fc09d6c15f9075f10c4b5459fa6 WHIRLPOOL d4ee64605ad9dacd371519a9c08582c25ea891480c79795822cfe74e6bafb332d558dca5d024c6f369e3674fde5a89a15a7d79042093295ac9d0a0d516493583
5
AUX qtcore-4.8.5-qeventdispatcher-recursive.patch 4017 SHA256 5db36cbb0686b8a503941779c821febc4a0330dc260e51d603f7aa1e4d8860ad SHA512 bd63961bcb695beebe8686142b84bff7702db4d85d737f5c2da927252b931700d03602f80048223cbbb05d85a5ddb9cb818321d756577f84843690b318f0c413 WHIRLPOOL f981bf3c3d1a62b486788433cabb2880b7f361ccdf99e502fb595608195168d72ba14018c93273f2726c60bae61a44cba3244026009823e832109a1f7418e773
6
AUX qtcore-4.8.6-QNAM-corruptions-fix.patch 17586 SHA256 5309c0f1ed0fc54799537b6d0a51b9682f52b4b40cc76e6fa71afc7273120e40 SHA512 4367974513b230d0395d0d0ebff5007255c257126309b614c37e8297981b833b397792fe9dede1960e0027a87d3fbc5eb252253a7ed73f4f9383531ea39cc874 WHIRLPOOL 8eded4f95d00f2ce572cf1956745d5a06e07f54a6ed6e67578914c0d2c9be63994cbf9177212d25c3c2678bf7328b2364b5977ebb8e8d7b8e4ad79009be6a7ae
7
AUX qtcore-4.8.7-fix-socklent-for-musl.patch 3982 SHA256 2d3065b3a372ae03a58ee76a4a24e676abc36a16f5c564b4b25c537d2520700d SHA512 d578fa49270ae8d18ff4de3a15b6f4c485503c1de61e9732e6e55d0bd3db5a0c2e68d37327e500b71a85efe05b187f435d2e4c62f23481c73a9d593803ca345c WHIRLPOOL e95016f372dc7cfff32609b838774a339320073fde9c90aa92b0ee8003bbf740a545cb500518bdd611553016bc8d9f21ea060b97742478105474561d6f3ae3d4
8
DIST qt-everywhere-opensource-src-4.8.7.tar.gz 241075567 SHA256 e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0 SHA512 f9f81a2e7205e1fd05c8d923dc73244f29aa33f951fa6b7c5c8193449328b37084796b9b71ad0c317e4e6fd00017c10ea5d67b1b2032551cde00548522218125 WHIRLPOOL ad8f01172f5bdb3a3a69fe7b03862c4c411bc8d95211053ad66ed1d60a3c0577d073d1075a1e0a80b25d9b2721addda55a2967e6ccf5e194cec8d08770ac5fc2
9
EBUILD qtcore-4.8.7-r99.ebuild 2987 SHA256 f0499c2b754b3a9d8635f8f27883fb78edc07452a594a03e82491e6611ec0f89 SHA512 78d6b370f0039cd0905926109bee181f24d8c006b08f6d606e40ac89120a8fa0012e8457dea68ab2aa174bae2484e6f69d36a7f75cd171bbb073d881dc0fb189 WHIRLPOOL 4664e9cfe1e3d0e962328f70b6f75c244cbdac1711f57d6142fb8fa3681002c7d45cdd58a10a101ab4ec8428ed30e00d8123d23db46fb0bc6e6e7af172b31067
10
MISC ChangeLog 39458 SHA256 538ab612e6a4236bdc8c54ead41013e9900532150871c00704179a997ebb102f SHA512 858615bf43caf12eeca50b45c1b61696291762f43bd96cd8949ba6d263a6c52e6e527289c4abc22d988e2f41420de52a919ab28bb889f6cc7c21c4e2a82a6a68 WHIRLPOOL 7355b16095460360dba36c8cfd0d917c34192013d1f43136d70f3f7547f406eab125815bc4cfc0b4d459eda70dc8fc275afcdaee642b1834b5f4461bca6ba543
11
MISC metadata.xml 633 SHA256 b8a9342f8b5306a23b156316bb8f6cbf6efc162d678d41a8e13e46916f12cf7d SHA512 3adcde8bf745bf21b85c8dd7b4b9d420d427053ed7fcbc110057aed87ce3a786e72d942c11d81de87bda04c5e2484ff410641ea147a2748867e969da828e6957 WHIRLPOOL 30fce13f3de4d40391ca081df75d94b6e88e352d0c0b0c10b2e2942462e0df6491b1bd15074dce27bf6cebf7f9d0381ca17cf22cfc982e06bfae4e2d278fc1ef
(-)a/dev-qt/qtcore/files/CVE-2013-4549-01-disallow-deep-or-widely-nested-entity-refs.patch (+114 lines)
Line 0 Link Here
1
From 512a1ce0698d370c313bb561bbf078935fa0342e Mon Sep 17 00:00:00 2001
2
From: Mitch Curtis <mitch.curtis@digia.com>
3
Date: Thu, 7 Nov 2013 09:36:29 +0100
4
Subject: Disallow deep or widely nested entity references.
5
6
Nested references with a depth of 2 or greater will fail. References
7
that partially expand to greater than 1024 characters will also fail.
8
9
This is a backport of 46a8885ae486e238a39efa5119c2714f328b08e4.
10
11
Change-Id: I0c2e1fa13d6ccb5f88641dae2ed3f28bfdeaf609
12
Reviewed-by: Richard J. Moore <rich@kde.org>
13
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
14
15
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
16
index a1777c5..3904632 100644
17
--- a/src/xml/sax/qxml.cpp
18
+++ b/src/xml/sax/qxml.cpp
19
@@ -424,6 +424,10 @@ private:
20
     int     stringValueLen;
21
     QString emptyStr;
22
 
23
+    // The limit to the amount of times the DTD parsing functions can be called
24
+    // for the DTD currently being parsed.
25
+    int dtdRecursionLimit;
26
+
27
     const QString &string();
28
     void stringClear();
29
     void stringAddC(QChar);
30
@@ -492,6 +496,7 @@ private:
31
     void unexpectedEof(ParseFunction where, int state);
32
     void parseFailed(ParseFunction where, int state);
33
     void pushParseState(ParseFunction function, int state);
34
+    bool isPartiallyExpandedEntityValueTooLarge(QString *errorMessage);
35
 
36
     Q_DECLARE_PUBLIC(QXmlSimpleReader)
37
     QXmlSimpleReader *q_ptr;
38
@@ -2759,6 +2764,7 @@ QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader)
39
     useNamespacePrefixes = false;
40
     reportWhitespaceCharData = true;
41
     reportEntities = false;
42
+    dtdRecursionLimit = 2;
43
 }
44
 
45
 QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate()
46
@@ -5018,6 +5024,11 @@ bool QXmlSimpleReaderPrivate::parseDoctype()
47
                 }
48
                 break;
49
             case Mup:
50
+                if (dtdRecursionLimit > 0 && parameterEntities.size() > dtdRecursionLimit) {
51
+                    reportParseError(QString::fromLatin1(
52
+                        "DTD parsing exceeded recursion limit of %1.").arg(dtdRecursionLimit));
53
+                    return false;
54
+                }
55
                 if (!parseMarkupdecl()) {
56
                     parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);
57
                     return false;
58
@@ -6627,6 +6638,37 @@ bool QXmlSimpleReaderPrivate::parseChoiceSeq()
59
     return false;
60
 }
61
 
62
+bool QXmlSimpleReaderPrivate::isPartiallyExpandedEntityValueTooLarge(QString *errorMessage)
63
+{
64
+    const QString value = string();
65
+    QMap<QString, int> referencedEntityCounts;
66
+    foreach (QString entityName, entities.keys()) {
67
+        for (int i = 0; i < value.size() && i != -1; ) {
68
+            i = value.indexOf(entityName, i);
69
+            if (i != -1) {
70
+                // The entityName we're currently trying to find
71
+                // was matched in this string; increase our count.
72
+                ++referencedEntityCounts[entityName];
73
+                i += entityName.size();
74
+            }
75
+        }
76
+    }
77
+
78
+    foreach (QString entityName, referencedEntityCounts.keys()) {
79
+        const int timesReferenced = referencedEntityCounts[entityName];
80
+        const QString entityValue = entities[entityName];
81
+        if (entityValue.size() * timesReferenced > 1024) {
82
+            if (errorMessage) {
83
+                *errorMessage = QString::fromLatin1("The XML entity \"%1\""
84
+                    "expands too a string that is too large to process when "
85
+                    "referencing \"%2\" %3 times.").arg(entityName).arg(entityName).arg(timesReferenced);
86
+            }
87
+            return true;
88
+        }
89
+    }
90
+    return false;
91
+}
92
+
93
 /*
94
   Parse a EntityDecl [70].
95
 
96
@@ -6721,6 +6763,15 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl()
97
         switch (state) {
98
             case EValue:
99
                 if ( !entityExist(name())) {
100
+                    QString errorMessage;
101
+                    if (isPartiallyExpandedEntityValueTooLarge(&errorMessage)) {
102
+                        // The entity at entityName is entityValue.size() characters
103
+                        // long in its unexpanded form, and was mentioned timesReferenced times,
104
+                        // resulting in a string that would be greater than 1024 characters.
105
+                        reportParseError(errorMessage);
106
+                        return false;
107
+                    }
108
+
109
                     entities.insert(name(), string());
110
                     if (declHnd) {
111
                         if (!declHnd->internalEntityDecl(name(), string())) {
112
-- 
113
1.8.5.2
114
(-)a/dev-qt/qtcore/files/CVE-2013-4549-02-fully-expand-entities.patch (+124 lines)
Line 0 Link Here
1
From cecceb0cdd87482124a73ecf537f3445d68be13e Mon Sep 17 00:00:00 2001
2
From: Mitch Curtis <mitch.curtis@digia.com>
3
Date: Tue, 12 Nov 2013 13:44:56 +0100
4
Subject: Fully expand entities to ensure deep or widely nested ones fail
5
 parsing
6
7
With 512a1ce0698d370c313bb561bbf078935fa0342e, we failed when parsing
8
entities whose partially expanded size was greater than 1024
9
characters. That was not enough, so now we fully expand all entities.
10
11
This is a backport of f1053d94f59f053ce4acad9320df14f1fbe4faac.
12
13
Change-Id: I41dd6f4525c63e82fd320a22d19248169627f7e0
14
Reviewed-by: Richard J. Moore <rich@kde.org>
15
16
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
17
index 3904632..befa801 100644
18
--- a/src/xml/sax/qxml.cpp
19
+++ b/src/xml/sax/qxml.cpp
20
@@ -426,7 +426,9 @@ private:
21
 
22
     // The limit to the amount of times the DTD parsing functions can be called
23
     // for the DTD currently being parsed.
24
-    int dtdRecursionLimit;
25
+    static const int dtdRecursionLimit = 2;
26
+    // The maximum amount of characters an entity value may contain, after expansion.
27
+    static const int entityCharacterLimit = 1024;
28
 
29
     const QString &string();
30
     void stringClear();
31
@@ -496,7 +498,7 @@ private:
32
     void unexpectedEof(ParseFunction where, int state);
33
     void parseFailed(ParseFunction where, int state);
34
     void pushParseState(ParseFunction function, int state);
35
-    bool isPartiallyExpandedEntityValueTooLarge(QString *errorMessage);
36
+    bool isExpandedEntityValueTooLarge(QString *errorMessage);
37
 
38
     Q_DECLARE_PUBLIC(QXmlSimpleReader)
39
     QXmlSimpleReader *q_ptr;
40
@@ -2764,7 +2766,6 @@ QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader)
41
     useNamespacePrefixes = false;
42
     reportWhitespaceCharData = true;
43
     reportEntities = false;
44
-    dtdRecursionLimit = 2;
45
 }
46
 
47
 QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate()
48
@@ -6638,30 +6639,43 @@ bool QXmlSimpleReaderPrivate::parseChoiceSeq()
49
     return false;
50
 }
51
 
52
-bool QXmlSimpleReaderPrivate::isPartiallyExpandedEntityValueTooLarge(QString *errorMessage)
53
+bool QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(QString *errorMessage)
54
 {
55
-    const QString value = string();
56
-    QMap<QString, int> referencedEntityCounts;
57
-    foreach (QString entityName, entities.keys()) {
58
-        for (int i = 0; i < value.size() && i != -1; ) {
59
-            i = value.indexOf(entityName, i);
60
-            if (i != -1) {
61
-                // The entityName we're currently trying to find
62
-                // was matched in this string; increase our count.
63
-                ++referencedEntityCounts[entityName];
64
-                i += entityName.size();
65
+    QMap<QString, int> literalEntitySizes;
66
+    // The entity at (QMap<QString,) referenced the entities at (QMap<QString,) (int>) times.
67
+    QMap<QString, QMap<QString, int> > referencesToOtherEntities;
68
+    QMap<QString, int> expandedSizes;
69
+
70
+    // For every entity, check how many times all entity names were referenced in its value.
71
+    foreach (QString toSearch, entities.keys()) {
72
+        // The amount of characters that weren't entity names, but literals, like 'X'.
73
+        QString leftOvers = entities.value(toSearch);
74
+        // How many times was entityName referenced by toSearch?
75
+        foreach (QString entityName, entities.keys()) {
76
+            for (int i = 0; i < leftOvers.size() && i != -1; ) {
77
+                i = leftOvers.indexOf(QString::fromLatin1("&%1;").arg(entityName), i);
78
+                if (i != -1) {
79
+                    leftOvers.remove(i, entityName.size() + 2);
80
+                    // The entityName we're currently trying to find was matched in this string; increase our count.
81
+                    ++referencesToOtherEntities[toSearch][entityName];
82
+                }
83
             }
84
         }
85
+        literalEntitySizes[toSearch] = leftOvers.size();
86
     }
87
 
88
-    foreach (QString entityName, referencedEntityCounts.keys()) {
89
-        const int timesReferenced = referencedEntityCounts[entityName];
90
-        const QString entityValue = entities[entityName];
91
-        if (entityValue.size() * timesReferenced > 1024) {
92
+    foreach (QString entity, referencesToOtherEntities.keys()) {
93
+        expandedSizes[entity] = literalEntitySizes[entity];
94
+        foreach (QString referenceTo, referencesToOtherEntities.value(entity).keys()) {
95
+            const int references = referencesToOtherEntities.value(entity).value(referenceTo);
96
+            // The total size of an entity's value is the expanded size of all of its referenced entities, plus its literal size.
97
+            expandedSizes[entity] += expandedSizes[referenceTo] * references + literalEntitySizes[referenceTo] * references;
98
+        }
99
+
100
+        if (expandedSizes[entity] > entityCharacterLimit) {
101
             if (errorMessage) {
102
-                *errorMessage = QString::fromLatin1("The XML entity \"%1\""
103
-                    "expands too a string that is too large to process when "
104
-                    "referencing \"%2\" %3 times.").arg(entityName).arg(entityName).arg(timesReferenced);
105
+                *errorMessage = QString::fromLatin1("The XML entity \"%1\" expands too a string that is too large to process (%2 characters > %3).");
106
+                *errorMessage = (*errorMessage).arg(entity).arg(expandedSizes[entity]).arg(entityCharacterLimit);
107
             }
108
             return true;
109
         }
110
@@ -6764,10 +6778,7 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl()
111
             case EValue:
112
                 if ( !entityExist(name())) {
113
                     QString errorMessage;
114
-                    if (isPartiallyExpandedEntityValueTooLarge(&errorMessage)) {
115
-                        // The entity at entityName is entityValue.size() characters
116
-                        // long in its unexpanded form, and was mentioned timesReferenced times,
117
-                        // resulting in a string that would be greater than 1024 characters.
118
+                    if (isExpandedEntityValueTooLarge(&errorMessage)) {
119
                         reportParseError(errorMessage);
120
                         return false;
121
                     }
122
-- 
123
1.8.5.2
124
(-)a/dev-qt/qtcore/files/qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch (+81 lines)
Line 0 Link Here
1
From 267feb2de49eed0823ca0c29f1cd5238537c7116 Mon Sep 17 00:00:00 2001
2
From: Jan-Marek Glogowski <glogow@fbihome.de>
3
Date: Thu, 6 Mar 2014 18:44:43 +0100
4
Subject: Honor ExcludeSocketNotifiers in glib event loop
5
6
Implements QEventLoop::ExcludeSocketNotifiers in the same way
7
QEventLoop::X11ExcludeTimers is already implemented for the glib
8
event loop.
9
10
This prevents crashes when QClipboard checks for clipboard events
11
and
12
  qApp->clipboard()->setProperty( "useEventLoopWhenWaiting", true );
13
is set.
14
15
Task-number: QTBUG-34614
16
Task-number: QTBUG-37380
17
18
Change-Id: Id4e2a74c6bdf8c3b439a4e3813d24d11368b607d
19
---
20
 src/corelib/kernel/qeventdispatcher_glib.cpp | 10 ++++++++++
21
 1 file changed, 10 insertions(+)
22
23
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
24
index 0b0e308..ba522fa 100644
25
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
26
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
27
@@ -65,6 +65,7 @@ struct GPollFDWithQSocketNotifier
28
 struct GSocketNotifierSource
29
 {
30
     GSource source;
31
+    QEventLoop::ProcessEventsFlags processEventsFlags;
32
     QList<GPollFDWithQSocketNotifier *> pollfds;
33
 };
34
 
35
@@ -80,6 +81,9 @@ static gboolean socketNotifierSourceCheck(GSource *source)
36
     GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source);
37
 
38
     bool pending = false;
39
+    if (src->processEventsFlags & QEventLoop::ExcludeSocketNotifiers)
40
+        return pending;
41
+
42
     for (int i = 0; !pending && i < src->pollfds.count(); ++i) {
43
         GPollFDWithQSocketNotifier *p = src->pollfds.at(i);
44
 
45
@@ -103,6 +107,9 @@ static gboolean socketNotifierSourceDispatch(GSource *source, GSourceFunc, gpoin
46
     QEvent event(QEvent::SockAct);
47
 
48
     GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source);
49
+    if (src->processEventsFlags & QEventLoop::ExcludeSocketNotifiers)
50
+        return true;
51
+
52
     for (int i = 0; i < src->pollfds.count(); ++i) {
53
         GPollFDWithQSocketNotifier *p = src->pollfds.at(i);
54
 
55
@@ -331,6 +338,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
56
         reinterpret_cast<GSocketNotifierSource *>(g_source_new(&socketNotifierSourceFuncs,
57
                                                                sizeof(GSocketNotifierSource)));
58
     (void) new (&socketNotifierSource->pollfds) QList<GPollFDWithQSocketNotifier *>();
59
+    socketNotifierSource->processEventsFlags = QEventLoop::AllEvents;
60
     g_source_set_can_recurse(&socketNotifierSource->source, true);
61
     g_source_attach(&socketNotifierSource->source, mainContext);
62
 
63
@@ -416,6 +424,7 @@ bool QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
64
     // tell postEventSourcePrepare() and timerSource about any new flags
65
     QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags;
66
     d->timerSource->processEventsFlags = flags;
67
+    d->socketNotifierSource->processEventsFlags = flags;
68
 
69
     if (!(flags & QEventLoop::EventLoopExec)) {
70
         // force timers to be sent at normal priority
71
@@ -427,6 +436,7 @@ bool QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
72
         result = g_main_context_iteration(d->mainContext, canWait);
73
 
74
     d->timerSource->processEventsFlags = savedFlags;
75
+    d->socketNotifierSource->processEventsFlags = savedFlags;
76
 
77
     if (canWait)
78
         emit awake();
79
-- 
80
2.0.0
81
(-)a/dev-qt/qtcore/files/qtcore-4.8.5-moc-boost-lexical-cast.patch (+12 lines)
Line 0 Link Here
1
Index: qt-everywhere-opensource-src-4.8.9999/src/tools/moc/main.cpp
2
===================================================================
3
--- qt-everywhere-opensource-src-4.8.9999.orig/src/tools/moc/main.cpp
4
+++ qt-everywhere-opensource-src-4.8.9999/src/tools/moc/main.cpp
5
@@ -190,6 +190,7 @@ int runMoc(int _argc, char **_argv)
6
 
7
     // Workaround a bug while parsing the boost/type_traits/has_operator.hpp header. See QTBUG-22829
8
     pp.macros["BOOST_TT_HAS_OPERATOR_HPP_INCLUDED"];
9
+    pp.macros["BOOST_LEXICAL_CAST_INCLUDED"];
10
 
11
     QByteArray filename;
12
     QByteArray output;
(-)a/dev-qt/qtcore/files/qtcore-4.8.6-QNAM-corruptions-fix.patch (+432 lines)
Line 0 Link Here
1
--- src/corelib/kernel/qeventdispatcher_glib.cpp.sav	2014-03-28 15:26:37.000000000 +0100
Line 0 Link Here
1
From fa81aa6d027049e855b76f5408586a288f160575 Mon Sep 17 00:00:00 2001
2
From: Markus Goetz <markus@woboq.com>
3
Date: Tue, 28 Apr 2015 11:57:36 +0200
4
Subject: QNAM: Fix upload corruptions when server closes connection
5
6
This patch fixes several upload corruptions if the server closes the connection
7
while/before we send data into it. They happen inside multiple places in the HTTP
8
layer and are explained in the comments.
9
Corruptions are:
10
* The upload byte device has an in-flight signal with pending upload data, if
11
it gets reset (because server closes the connection) then the re-send of the
12
request was sometimes taking this stale in-flight pending upload data.
13
* Because some signals were DirectConnection and some were QueuedConnection, there
14
was a chance that a direct signal overtakes a queued signal. The state machine
15
then sent data down the socket which was buffered there (and sent later) although
16
it did not match the current state of the state machine when it was actually sent.
17
* A socket was seen as being able to have requests sent even though it was not
18
encrypted yet. This relates to the previous corruption where data is stored inside
19
the socket's buffer and then sent later.
20
21
The included auto test produces all fixed corruptions, I detected no regressions
22
via the other tests.
23
This code also adds a bit of sanity checking to protect from possible further
24
problems.
25
26
[ChangeLog][QtNetwork] Fix HTTP(s) upload corruption when server closes connection
27
28
(cherry picked from commit qtbase/cff39fba10ffc10ee4dcfdc66ff6528eb26462d3)
29
Change-Id: I9793297be6cf3edfb75b65ba03b65f7a133ef194
30
Reviewed-by: Richard J. Moore <rich@kde.org>
31
---
32
 src/corelib/io/qnoncontiguousbytedevice.cpp        |  19 +++
33
 src/corelib/io/qnoncontiguousbytedevice_p.h        |   4 +
34
 .../access/qhttpnetworkconnectionchannel.cpp       |  47 +++++-
35
 src/network/access/qhttpthreaddelegate_p.h         |  36 ++++-
36
 src/network/access/qnetworkaccesshttpbackend.cpp   |  24 ++-
37
 src/network/access/qnetworkaccesshttpbackend_p.h   |   5 +-
38
 tests/auto/qnetworkreply/tst_qnetworkreply.cpp     | 174 ++++++++++++++++++++-
39
 7 files changed, 280 insertions(+), 29 deletions(-)
40
41
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
42
index bf58eee..1a0591e 100644
43
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
44
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
45
@@ -245,6 +245,12 @@ qint64 QNonContiguousByteDeviceByteArrayImpl::size()
46
     return byteArray->size();
47
 }
48
49
+qint64 QNonContiguousByteDeviceByteArrayImpl::pos()
50
+{
51
+    return currentPosition;
52
+}
53
+
54
+
55
 QNonContiguousByteDeviceRingBufferImpl::QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb)
56
     : QNonContiguousByteDevice(), currentPosition(0)
57
 {
58
@@ -296,6 +302,11 @@ qint64 QNonContiguousByteDeviceRingBufferImpl::size()
59
     return ringBuffer->size();
60
 }
61
62
+qint64 QNonContiguousByteDeviceRingBufferImpl::pos()
63
+{
64
+    return currentPosition;
65
+}
66
+
67
 QNonContiguousByteDeviceIoDeviceImpl::QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d)
68
     : QNonContiguousByteDevice(),
69
     currentReadBuffer(0), currentReadBufferSize(16*1024),
70
@@ -415,6 +426,14 @@ qint64 QNonContiguousByteDeviceIoDeviceImpl::size()
71
     return device->size() - initialPosition;
72
 }
73
74
+qint64 QNonContiguousByteDeviceIoDeviceImpl::pos()
75
+{
76
+    if (device->isSequential())
77
+        return -1;
78
+
79
+    return device->pos();
80
+}
81
+
82
 QByteDeviceWrappingIoDevice::QByteDeviceWrappingIoDevice(QNonContiguousByteDevice *bd) : QIODevice((QObject*)0)
83
 {
84
     byteDevice = bd;
85
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h
86
index b6966eb..d1a99a1 100644
87
--- a/src/corelib/io/qnoncontiguousbytedevice_p.h
88
+++ b/src/corelib/io/qnoncontiguousbytedevice_p.h
89
@@ -69,6 +69,7 @@ public:
90
     virtual const char* readPointer(qint64 maximumLength, qint64 &len) = 0;
91
     virtual bool advanceReadPointer(qint64 amount) = 0;
92
     virtual bool atEnd() = 0;
93
+    virtual qint64 pos() { return -1; }
94
     virtual bool reset() = 0;
95
     void disableReset();
96
     bool isResetDisabled() { return resetDisabled; }
97
@@ -108,6 +109,7 @@ public:
98
     bool atEnd();
99
     bool reset();
100
     qint64 size();
101
+    qint64 pos();
102
 protected:
103
     QByteArray* byteArray;
104
     qint64 currentPosition;
105
@@ -123,6 +125,7 @@ public:
106
     bool atEnd();
107
     bool reset();
108
     qint64 size();
109
+    qint64 pos();
110
 protected:
111
     QSharedPointer<QRingBuffer> ringBuffer;
112
     qint64 currentPosition;
113
@@ -140,6 +143,7 @@ public:
114
     bool atEnd();
115
     bool reset();
116
     qint64 size();
117
+    qint64 pos();
118
 protected:
119
     QIODevice* device;
120
     QByteArray* currentReadBuffer;
121
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
122
index 550e090..db2f712 100644
123
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
124
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
125
@@ -107,15 +107,19 @@ void QHttpNetworkConnectionChannel::init()
126
     socket->setProxy(QNetworkProxy::NoProxy);
127
 #endif
128
129
+    // We want all signals (except the interactive ones) be connected as QueuedConnection
130
+    // because else we're falling into cases where we recurse back into the socket code
131
+    // and mess up the state. Always going to the event loop (and expecting that when reading/writing)
132
+    // is safer.
133
     QObject::connect(socket, SIGNAL(bytesWritten(qint64)),
134
                      this, SLOT(_q_bytesWritten(qint64)),
135
-                     Qt::DirectConnection);
136
+                     Qt::QueuedConnection);
137
     QObject::connect(socket, SIGNAL(connected()),
138
                      this, SLOT(_q_connected()),
139
-                     Qt::DirectConnection);
140
+                     Qt::QueuedConnection);
141
     QObject::connect(socket, SIGNAL(readyRead()),
142
                      this, SLOT(_q_readyRead()),
143
-                     Qt::DirectConnection);
144
+                     Qt::QueuedConnection);
145
146
     // The disconnected() and error() signals may already come
147
     // while calling connectToHost().
148
@@ -144,13 +148,13 @@ void QHttpNetworkConnectionChannel::init()
149
         // won't be a sslSocket if encrypt is false
150
         QObject::connect(sslSocket, SIGNAL(encrypted()),
151
                          this, SLOT(_q_encrypted()),
152
-                         Qt::DirectConnection);
153
+                         Qt::QueuedConnection);
154
         QObject::connect(sslSocket, SIGNAL(sslErrors(QList<QSslError>)),
155
                          this, SLOT(_q_sslErrors(QList<QSslError>)),
156
                          Qt::DirectConnection);
157
         QObject::connect(sslSocket, SIGNAL(encryptedBytesWritten(qint64)),
158
                          this, SLOT(_q_encryptedBytesWritten(qint64)),
159
-                         Qt::DirectConnection);
160
+                         Qt::QueuedConnection);
161
     }
162
 #endif
163
 }
164
@@ -163,7 +167,8 @@ void QHttpNetworkConnectionChannel::close()
165
     else
166
         state = QHttpNetworkConnectionChannel::ClosingState;
167
168
-    socket->close();
169
+    if (socket)
170
+        socket->close();
171
 }
172
173
174
@@ -280,6 +285,14 @@ bool QHttpNetworkConnectionChannel::sendRequest()
175
                 // nothing to read currently, break the loop
176
                 break;
177
             } else {
178
+                if (written != uploadByteDevice->pos()) {
179
+                    // Sanity check. This was useful in tracking down an upload corruption.
180
+                    qWarning() << "QHttpProtocolHandler: Internal error in sendRequest. Expected to write at position" << written << "but read device is at" << uploadByteDevice->pos();
181
+                    Q_ASSERT(written == uploadByteDevice->pos());
182
+                    connection->d_func()->emitReplyError(socket, reply, QNetworkReply::ProtocolFailure);
183
+                    return false;
184
+                }
185
+
186
                 qint64 currentWriteSize = socket->write(readPointer, currentReadSize);
187
                 if (currentWriteSize == -1 || currentWriteSize != currentReadSize) {
188
                     // socket broke down
189
@@ -639,6 +652,14 @@ bool QHttpNetworkConnectionChannel::ensureConnection()
190
         }
191
         return false;
192
     }
193
+
194
+    // This code path for ConnectedState
195
+    if (pendingEncrypt) {
196
+        // Let's only be really connected when we have received the encrypted() signal. Else the state machine seems to mess up
197
+        // and corrupt the things sent to the server.
198
+        return false;
199
+    }
200
+
201
     return true;
202
 }
203
204
@@ -980,6 +1001,13 @@ void QHttpNetworkConnectionChannel::_q_readyRead()
205
 void QHttpNetworkConnectionChannel::_q_bytesWritten(qint64 bytes)
206
 {
207
     Q_UNUSED(bytes);
208
+
209
+    if (ssl) {
210
+        // In the SSL case we want to send data from encryptedBytesWritten signal since that one
211
+        // is the one going down to the actual network, not only into some SSL buffer.
212
+        return;
213
+    }
214
+
215
     // bytes have been written to the socket. write even more of them :)
216
     if (isSocketWriting())
217
         sendRequest();
218
@@ -1029,7 +1057,7 @@ void QHttpNetworkConnectionChannel::_q_connected()
219
220
     // ### FIXME: if the server closes the connection unexpectedly, we shouldn't send the same broken request again!
221
     //channels[i].reconnectAttempts = 2;
222
-    if (!pendingEncrypt) {
223
+    if (!pendingEncrypt && !ssl) { // FIXME: Didn't work properly with pendingEncrypt only, we should refactor this into an EncrypingState
224
         state = QHttpNetworkConnectionChannel::IdleState;
225
         if (!reply)
226
             connection->d_func()->dequeueRequest(socket);
227
@@ -1157,7 +1185,10 @@ void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetwor
228
229
 void QHttpNetworkConnectionChannel::_q_uploadDataReadyRead()
230
 {
231
-    sendRequest();
232
+    if (reply && state == QHttpNetworkConnectionChannel::WritingState) {
233
+        // There might be timing issues, make sure to only send upload data if really in that state
234
+        sendRequest();
235
+    }
236
 }
237
238
 #ifndef QT_NO_OPENSSL
239
diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h
240
index 7648325..9dd0deb 100644
241
--- a/src/network/access/qhttpthreaddelegate_p.h
242
+++ b/src/network/access/qhttpthreaddelegate_p.h
243
@@ -190,6 +190,7 @@ protected:
244
     QByteArray m_dataArray;
245
     bool m_atEnd;
246
     qint64 m_size;
247
+    qint64 m_pos; // to match calls of haveDataSlot with the expected position
248
 public:
249
     QNonContiguousByteDeviceThreadForwardImpl(bool aE, qint64 s)
250
         : QNonContiguousByteDevice(),
251
@@ -197,7 +198,8 @@ public:
252
           m_amount(0),
253
           m_data(0),
254
           m_atEnd(aE),
255
-          m_size(s)
256
+          m_size(s),
257
+          m_pos(0)
258
     {
259
     }
260
261
@@ -205,6 +207,11 @@ public:
262
     {
263
     }
264
265
+    qint64 pos()
266
+    {
267
+        return m_pos;
268
+    }
269
+
270
     const char* readPointer(qint64 maximumLength, qint64 &len)
271
     {
272
         if (m_amount > 0) {
273
@@ -232,11 +239,10 @@ public:
274
275
         m_amount -= a;
276
         m_data += a;
277
+        m_pos += a;
278
279
-        // To main thread to inform about our state
280
-        emit processedData(a);
281
-
282
-        // FIXME possible optimization, already ask user thread for some data
283
+        // To main thread to inform about our state. The m_pos will be sent as a sanity check.
284
+        emit processedData(m_pos, a);
285
286
         return true;
287
     }
288
@@ -253,10 +259,21 @@ public:
289
     {
290
         m_amount = 0;
291
         m_data = 0;
292
+        m_dataArray.clear();
293
+
294
+        if (wantDataPending) {
295
+            // had requested the user thread to send some data (only 1 in-flight at any moment)
296
+            wantDataPending = false;
297
+        }
298
299
         // Communicate as BlockingQueuedConnection
300
         bool b = false;
301
         emit resetData(&b);
302
+        if (b) {
303
+            // the reset succeeded, we're at pos 0 again
304
+            m_pos = 0;
305
+            // the HTTP code will anyway abort the request if !b.
306
+        }
307
         return b;
308
     }
309
310
@@ -267,8 +284,13 @@ public:
311
312
 public slots:
313
     // From user thread:
314
-    void haveDataSlot(QByteArray dataArray, bool dataAtEnd, qint64 dataSize)
315
+    void haveDataSlot(qint64 pos, QByteArray dataArray, bool dataAtEnd, qint64 dataSize)
316
     {
317
+        if (pos != m_pos) {
318
+            // Sometimes when re-sending a request in the qhttpnetwork* layer there is a pending haveData from the
319
+            // user thread on the way to us. We need to ignore it since it is the data for the wrong(later) chunk.
320
+            return;
321
+        }
322
         wantDataPending = false;
323
324
         m_dataArray = dataArray;
325
@@ -288,7 +310,7 @@ signals:
326
327
     // to main thread:
328
     void wantData(qint64);
329
-    void processedData(qint64);
330
+    void processedData(qint64 pos, qint64 amount);
331
     void resetData(bool *b);
332
 };
333
334
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
335
index cc67258..fe2f627 100644
336
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
337
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
338
@@ -193,6 +193,7 @@ QNetworkAccessHttpBackendFactory::create(QNetworkAccessManager::Operation op,
339
 QNetworkAccessHttpBackend::QNetworkAccessHttpBackend()
340
     : QNetworkAccessBackend()
341
     , statusCode(0)
342
+    , uploadByteDevicePosition(false)
343
     , pendingDownloadDataEmissions(new QAtomicInt())
344
     , pendingDownloadProgressEmissions(new QAtomicInt())
345
     , loadingFromCache(false)
346
@@ -610,9 +611,9 @@ void QNetworkAccessHttpBackend::postRequest()
347
             forwardUploadDevice->setParent(delegate); // needed to make sure it is moved on moveToThread()
348
             delegate->httpRequest.setUploadByteDevice(forwardUploadDevice);
349
350
-            // From main thread to user thread:
351
-            QObject::connect(this, SIGNAL(haveUploadData(QByteArray, bool, qint64)),
352
-                             forwardUploadDevice, SLOT(haveDataSlot(QByteArray, bool, qint64)), Qt::QueuedConnection);
353
+            // From user thread to http thread:
354
+            QObject::connect(this, SIGNAL(haveUploadData(qint64,QByteArray,bool,qint64)),
355
+                forwardUploadDevice, SLOT(haveDataSlot(qint64,QByteArray,bool,qint64)), Qt::QueuedConnection);
356
             QObject::connect(uploadByteDevice.data(), SIGNAL(readyRead()),
357
                              forwardUploadDevice, SIGNAL(readyRead()),
358
                              Qt::QueuedConnection);
359
@@ -620,8 +621,8 @@ void QNetworkAccessHttpBackend::postRequest()
360
             // From http thread to user thread:
361
             QObject::connect(forwardUploadDevice, SIGNAL(wantData(qint64)),
362
                              this, SLOT(wantUploadDataSlot(qint64)));
363
-            QObject::connect(forwardUploadDevice, SIGNAL(processedData(qint64)),
364
-                             this, SLOT(sentUploadDataSlot(qint64)));
365
+            QObject::connect(forwardUploadDevice,SIGNAL(processedData(qint64, qint64)),
366
+                             this, SLOT(sentUploadDataSlot(qint64,qint64)));
367
             connect(forwardUploadDevice, SIGNAL(resetData(bool*)),
368
                     this, SLOT(resetUploadDataSlot(bool*)),
369
                     Qt::BlockingQueuedConnection); // this is the only one with BlockingQueued!
370
@@ -915,12 +916,21 @@ void QNetworkAccessHttpBackend::replySslConfigurationChanged(const QSslConfigura
371
 void QNetworkAccessHttpBackend::resetUploadDataSlot(bool *r)
372
 {
373
     *r = uploadByteDevice->reset();
374
+    if (*r) {
375
+        // reset our own position which is used for the inter-thread communication
376
+        uploadByteDevicePosition = 0;
377
+    }
378
 }
379
380
 // Coming from QNonContiguousByteDeviceThreadForwardImpl in HTTP thread
381
-void QNetworkAccessHttpBackend::sentUploadDataSlot(qint64 amount)
382
+void QNetworkAccessHttpBackend::sentUploadDataSlot(qint64 pos, qint64 amount)
383
 {
384
+    if (uploadByteDevicePosition + amount != pos) {
385
+        // Sanity check, should not happen.
386
+        error(QNetworkReply::UnknownNetworkError, "");
387
+    }
388
     uploadByteDevice->advanceReadPointer(amount);
389
+    uploadByteDevicePosition += amount;
390
 }
391
392
 // Coming from QNonContiguousByteDeviceThreadForwardImpl in HTTP thread
393
@@ -933,7 +943,7 @@ void QNetworkAccessHttpBackend::wantUploadDataSlot(qint64 maxSize)
394
     QByteArray dataArray(data, currentUploadDataLength);
395
396
     // Communicate back to HTTP thread
397
-    emit haveUploadData(dataArray, uploadByteDevice->atEnd(), uploadByteDevice->size());
398
+    emit haveUploadData(uploadByteDevicePosition, dataArray, uploadByteDevice->atEnd(), uploadByteDevice->size());
399
 }
400
401
 /*
402
diff --git a/src/network/access/qnetworkaccesshttpbackend_p.h b/src/network/access/qnetworkaccesshttpbackend_p.h
403
index 13519c6..b4ed67c 100644
404
--- a/src/network/access/qnetworkaccesshttpbackend_p.h
405
+++ b/src/network/access/qnetworkaccesshttpbackend_p.h
406
@@ -112,7 +112,7 @@ signals:
407
408
     void startHttpRequestSynchronously();
409
410
-    void haveUploadData(QByteArray dataArray, bool dataAtEnd, qint64 dataSize);
411
+    void haveUploadData(const qint64 pos, QByteArray dataArray, bool dataAtEnd, qint64 dataSize);
412
 private slots:
413
     // From HTTP thread:
414
     void replyDownloadData(QByteArray);
415
@@ -129,13 +129,14 @@ private slots:
416
     // From QNonContiguousByteDeviceThreadForwardImpl in HTTP thread:
417
     void resetUploadDataSlot(bool *r);
418
     void wantUploadDataSlot(qint64);
419
-    void sentUploadDataSlot(qint64);
420
+    void sentUploadDataSlot(qint64, qint64);
421
422
     bool sendCacheContents(const QNetworkCacheMetaData &metaData);
423
424
 private:
425
     QHttpNetworkRequest httpRequest; // There is also a copy in the HTTP thread
426
     int statusCode;
427
+    qint64 uploadByteDevicePosition;
428
     QString reasonPhrase;
429
     // Will be increased by HTTP thread:
430
     QSharedPointer<QAtomicInt> pendingDownloadDataEmissions;
431
(-)a/dev-qt/qtcore/metadata.xml (+18 lines)
Line 0 Link Here
1
diff -ru a/mkspecs/linux-cxx/qplatformdefs.h b/mkspecs/linux-cxx/qplatformdefs.h
2
--- a/mkspecs/linux-cxx/qplatformdefs.h	2015-05-07 14:14:41.000000000 +0000
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
	<herd>qt</herd>
5
	<use>
6
		<flag name="exceptions">Add support for exceptions - like catching them
7
			inside the event loop (recommended by upstream)</flag>
8
		<flag name="glib">Enable <pkg>dev-libs/glib</pkg> eventloop support</flag>
9
		<flag name="qt3support">Enable the Qt3Support libraries for Qt4. Note that
10
			this does not mean you can compile pure Qt3 programs with Qt4.</flag>
11
	</use>
12
	<upstream>
13
		<bugs-to>https://bugreports.qt.io/</bugs-to>
14
		<doc>http://doc.qt.io/</doc>
15
	</upstream>
16
</pkgmetadata>
(-)a/dev-qt/qtcore/qtcore-4.8.7-r99.ebuild (-1 / +90 lines)
Line 0 Link Here
0
- 
1
# Copyright 1999-2015 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/dev-qt/qtcore/qtcore-4.8.7.ebuild,v 1.1 2015/05/26 18:14:28 pesa Exp $
4
5
EAPI=5
6
inherit qt4-build-multilib
7
8
DESCRIPTION="Cross-platform application development framework"
9
10
if [[ ${QT4_BUILD_TYPE} == release ]]; then
11
	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
12
fi
13
14
IUSE="+glib iconv icu qt3support ssl"
15
16
DEPEND="
17
	>=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
18
	glib? ( dev-libs/glib:2[${MULTILIB_USEDEP}] )
19
	iconv? ( >=virtual/libiconv-0-r2[${MULTILIB_USEDEP}] )
20
	icu? ( dev-libs/icu:=[${MULTILIB_USEDEP}] )
21
	ssl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
22
"
23
RDEPEND="${DEPEND}"
24
PDEPEND="
25
	~dev-qt/qttranslations-${PV}
26
	qt3support? ( ~dev-qt/qtgui-${PV}[aqua=,debug=,glib=,qt3support,${MULTILIB_USEDEP}] )
27
"
28
29
MULTILIB_WRAPPED_HEADERS=(
30
	/usr/include/qt4/Qt/qconfig.h
31
	/usr/include/qt4/QtCore/qconfig.h
32
)
33
34
PATCHES=(
35
	"${FILESDIR}/${PN}-4.8.5-moc-boost-lexical-cast.patch"
36
	"${FILESDIR}/${PN}-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch" # bug 514968
37
	"${FILESDIR}/${PN}-4.8.5-qeventdispatcher-recursive.patch" # bug 514968
38
	"${FILESDIR}/${PN}-4.8.7-fix-socklent-for-musl.patch"
39
)
40
41
QT4_TARGET_DIRECTORIES="
42
	src/tools/bootstrap
43
	src/tools/moc
44
	src/tools/rcc
45
	src/tools/uic
46
	src/corelib
47
	src/network
48
	src/xml
49
	src/plugins/codecs/cn
50
	src/plugins/codecs/jp
51
	src/plugins/codecs/kr
52
	src/plugins/codecs/tw
53
	tools/linguist/lconvert
54
	tools/linguist/lrelease
55
	tools/linguist/lupdate"
56
57
QCONFIG_DEFINE="QT_ZLIB"
58
59
src_prepare() {
60
	qt4-build-multilib_src_prepare
61
62
	# bug 172219
63
	sed -i -e "s:CXXFLAGS.*=:CXXFLAGS=${CXXFLAGS} :" \
64
		-e "s:LFLAGS.*=:LFLAGS=${LDFLAGS} :" \
65
		qmake/Makefile.unix || die "sed qmake/Makefile.unix failed"
66
67
	# bug 427782
68
	sed -i -e '/^CPPFLAGS\s*=/ s/-g //' \
69
		qmake/Makefile.unix || die "sed CPPFLAGS in qmake/Makefile.unix failed"
70
	sed -i -e 's/setBootstrapVariable QMAKE_CFLAGS_RELEASE/QMakeVar set QMAKE_CFLAGS_RELEASE/' \
71
		-e 's/setBootstrapVariable QMAKE_CXXFLAGS_RELEASE/QMakeVar set QMAKE_CXXFLAGS_RELEASE/' \
72
		configure || die "sed configure setBootstrapVariable failed"
73
}
74
75
multilib_src_configure() {
76
	local myconf=(
77
		-no-accessibility -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon
78
		-no-phonon-backend -no-svg -no-webkit -no-script -no-scripttools -no-declarative
79
		-system-zlib -no-gif -no-libtiff -no-libpng -no-libmng -no-libjpeg
80
		-no-cups -no-dbus -no-gtkstyle -no-nas-sound -no-opengl -no-openvg
81
		-no-sm -no-xshape -no-xvideo -no-xsync -no-xinerama -no-xcursor -no-xfixes
82
		-no-xrandr -no-xrender -no-mitshm -no-fontconfig -no-freetype -no-xinput -no-xkb
83
		$(qt_use glib)
84
		$(qt_use iconv)
85
		$(qt_use icu)
86
		$(use ssl && echo -openssl-linked || echo -no-openssl)
87
		$(qt_use qt3support)
88
	)
89
	qt4_multilib_src_configure
90
}

Return to bug 551640