diff options
Diffstat (limited to '')
-rw-r--r-- | kde/patch/kdelibs.patch | 13 | ||||
-rw-r--r-- | kde/patch/kdelibs/kdelibs.docbook.patch.gz (renamed from kde/kdelibs/kdelibs.docbook.patch.gz) | bin | 361 -> 361 bytes | |||
-rw-r--r-- | kde/patch/kdelibs/kdelibs.klocale.numberfix.patch | 130 | ||||
-rw-r--r-- | kde/patch/kdelibs/kdelibs.kssl.CVE-2011-3365.patch (renamed from kde/kdelibs/kdelibs.kssl.CVE-2011-3365.patch) | 4 | ||||
-rw-r--r-- | kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch | 65 |
5 files changed, 210 insertions, 2 deletions
diff --git a/kde/patch/kdelibs.patch b/kde/patch/kdelibs.patch new file mode 100644 index 0000000..1b0fd96 --- /dev/null +++ b/kde/patch/kdelibs.patch @@ -0,0 +1,13 @@ +# Slackware ships a different version of XML DTDs: +zcat $CWD/patch/kdelibs/kdelibs.docbook.patch.gz | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + +# Fix for CVE-2011-3365 (not needed for KDE >= 4.7.2): +#cat $CWD/patch/kdelibs/kdelibs.kssl.CVE-2011-3365.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + +# Fix a bug introduced in kdelibs-4.7.2 which was intended as a fix but +# prevents any query which does NOT use wide unicode characters to fail: +#cat $CWD/patch/kdelibs/kdelibs.nepomuk.unicode.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + +# Fix broken number entry (fixed in KDE >= 4.7.5) +cat $CWD/patch/kdelibs/kdelibs.klocale.numberfix.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/kdelibs/kdelibs.docbook.patch.gz b/kde/patch/kdelibs/kdelibs.docbook.patch.gz Binary files differindex 2de9a66..2de9a66 100644 --- a/kde/kdelibs/kdelibs.docbook.patch.gz +++ b/kde/patch/kdelibs/kdelibs.docbook.patch.gz diff --git a/kde/patch/kdelibs/kdelibs.klocale.numberfix.patch b/kde/patch/kdelibs/kdelibs.klocale.numberfix.patch new file mode 100644 index 0000000..d27c2a3 --- /dev/null +++ b/kde/patch/kdelibs/kdelibs.klocale.numberfix.patch @@ -0,0 +1,130 @@ +commit 2993b24bc21a340695ad35b4f014a684f4d0c651 +Author: John Layt <jlayt@kde.org> +Date: Sat Dec 17 16:27:51 2011 +0000 + + KLocale: Fix readNumber() and readMoney() for lenient group parsing + + Restore the old pre-4.7 behaviour of accepting as valid any numbers + that do not contain any group separators but strictly enforce group + rules when the number contains 1 or more group separators. + + Distro's will really want to backport this fix to all versions of 4.7 + as previously number entry for all KDE apps would have been seriously + broken. + + I'm amazed I wasn't beaten up for this earlier! + + BUG: 288963 + FIXED-IN: 4.7.5 + CCMAIL: kde-packager@kde.org + +diff --git a/kdecore/localization/klocale_kde.cpp b/kdecore/localization/klocale_kde.cpp +index 6cf85f9..6690f4a 100644 +--- a/kdecore/localization/klocale_kde.cpp ++++ b/kdecore/localization/klocale_kde.cpp +@@ -1894,7 +1894,10 @@ double KLocalePrivate::readNumber(const QString &_str, bool * ok) const + + // Remove group separators + bool groupOk = true; +- str = parseDigitGroup(str, thousandsSeparator(), decimalSymbol(), numericDigitGrouping(), &groupOk); ++ if(str.contains(thousandsSeparator())) { ++ str = parseDigitGroup(str, thousandsSeparator(), decimalSymbol(), ++ numericDigitGrouping(), &groupOk); ++ } + + if (!groupOk) { + if (ok) { +@@ -2013,7 +2016,10 @@ double KLocalePrivate::readMoney(const QString &_str, bool *ok) const + + // Remove group separators + bool groupOk = true; +- str = parseDigitGroup(str, monetaryThousandsSeparator(), monetaryDecimalSymbol(), monetaryDigitGrouping(), &groupOk); ++ if(str.contains(monetaryThousandsSeparator())) { ++ str = parseDigitGroup(str, monetaryThousandsSeparator(), monetaryDecimalSymbol(), ++ monetaryDigitGrouping(), &groupOk); ++ } + + if (!groupOk) { + if (ok) { +diff --git a/kdecore/tests/klocaletest.cpp b/kdecore/tests/klocaletest.cpp +index 97a3bce..f80de85 100644 +--- a/kdecore/tests/klocaletest.cpp ++++ b/kdecore/tests/klocaletest.cpp +@@ -180,9 +180,13 @@ KLocaleTest::readNumber() + QVERIFY(!ok); + QCOMPARE(locale.readNumber(QString("123,456,789.01"), &ok), 0.0); + QVERIFY(!ok); +- QCOMPARE(locale.readNumber(QString("123456789"), &ok), 0.0); ++ QCOMPARE(locale.readNumber(QString("123456789"), &ok), 123456789.0); ++ QVERIFY(ok); ++ QCOMPARE(locale.readNumber(QString("123456789.01"), &ok), 123456789.01); ++ QVERIFY(ok); ++ QCOMPARE(locale.readNumber(QString("123456,789"), &ok), 0.0); + QVERIFY(!ok); +- QCOMPARE(locale.readNumber(QString("123456789.01"), &ok), 0.0); ++ QCOMPARE(locale.readNumber(QString("123456,789.01"), &ok), 0.0); + QVERIFY(!ok); + + //Test it parses correctly with an empty separator. +@@ -204,6 +208,14 @@ KLocaleTest::readNumber() + QVERIFY(ok); + QCOMPARE(locale.readNumber(QString("123 456 789.01"), &ok), 123456789.01); + QVERIFY(ok); ++ QCOMPARE(locale.readNumber(QString("123456789"), &ok), 123456789.0); ++ QVERIFY(ok); ++ QCOMPARE(locale.readNumber(QString("123456789.01"), &ok), 123456789.01); ++ QVERIFY(ok); ++ QCOMPARE(locale.readNumber(QString("123456 789"), &ok), 0.0); ++ QVERIFY(!ok); ++ QCOMPARE(locale.readNumber(QString("123456 789.01"), &ok), 0.0); ++ QVERIFY(!ok); + QCOMPARE(locale.readNumber(QString("123,456,789"), &ok), 0.0); + QVERIFY(!ok); + QCOMPARE(locale.readNumber(QString("123,456,789.01"), &ok), 0.0); +@@ -479,6 +491,10 @@ void KLocaleTest::readMoney() + QVERIFY(ok); + QCOMPARE(locale.readMoney("$ 987,654,321.12", &ok), 987654321.12); + QVERIFY(ok); ++ QCOMPARE(locale.readMoney("$ 987654321.12", &ok), 987654321.12); ++ QVERIFY(ok); ++ QCOMPARE(locale.readMoney("$ 987654,321.12", &ok), 0.0); ++ QVERIFY(!ok); + + QCOMPARE(locale.readMoney( "$ -1.12", &ok), -1.12); + QVERIFY(ok); +@@ -498,6 +514,10 @@ void KLocaleTest::readMoney() + QVERIFY(ok); + QCOMPARE(locale.readMoney("$ -987,654,321.12", &ok), -987654321.12); + QVERIFY(ok); ++ QCOMPARE(locale.readMoney("$ -987654321.12", &ok), -987654321.12); ++ QVERIFY(ok); ++ QCOMPARE(locale.readMoney("$ -987654,321.12", &ok), 0.0); ++ QVERIFY(!ok); + + // Test incomplete formats + QCOMPARE(locale.readMoney( "$ 1", &ok), 1.00); +@@ -521,17 +541,21 @@ void KLocaleTest::readMoney() + + // Test Grouping + locale.d->setMonetaryDigitGrouping(QList<int>()); +- QCOMPARE(locale.readMoney( "$ 987654321.12", &ok), 987654321.12); ++ QCOMPARE(locale.readMoney("$ 987654321.12", &ok), 987654321.12); + QVERIFY(ok); + QCOMPARE(locale.readMoney("$ -987654321.12", &ok), -987654321.12); + QVERIFY(ok); + locale.d->setMonetaryDigitGrouping(QList<int>() << 3 << 2); +- QCOMPARE(locale.readMoney( "$ 98,76,54,321.12", &ok), 987654321.12); ++ QCOMPARE(locale.readMoney("$ 98,76,54,321.12", &ok), 987654321.12); + QVERIFY(ok); + QCOMPARE(locale.readMoney("$ -98,76,54,321.12", &ok), -987654321.12); + QVERIFY(ok); ++ QCOMPARE(locale.readMoney("$ 987654321.12", &ok), 987654321.12); ++ QVERIFY(ok); ++ QCOMPARE(locale.readMoney("$ -987654321.12", &ok), -987654321.12); ++ QVERIFY(ok); + locale.d->setMonetaryDigitGrouping(QList<int>() << 3 << -1); +- QCOMPARE(locale.readMoney( "$ 987654,321.12", &ok), 987654321.12); ++ QCOMPARE(locale.readMoney("$ 987654,321.12", &ok), 987654321.12); + QVERIFY(ok); + QCOMPARE(locale.readMoney("$ -987654,321.12", &ok), -987654321.12); + QVERIFY(ok); diff --git a/kde/kdelibs/kdelibs.kssl.CVE-2011-3365.patch b/kde/patch/kdelibs/kdelibs.kssl.CVE-2011-3365.patch index d05e44b..b44b865 100644 --- a/kde/kdelibs/kdelibs.kssl.CVE-2011-3365.patch +++ b/kde/patch/kdelibs/kdelibs.kssl.CVE-2011-3365.patch @@ -1,11 +1,10 @@ -commit 9ca2b26fc67c3f921e1943c1725fca623e395854 +commit bd70d4e589711fda9ab07738c46e37eee8376214 Author: David Faure <faure@kde.org> Date: Thu Jun 30 23:43:45 2011 +0200 Security fix: don't interpret html tags Credits to Tim Brown for the find. - (cherry picked from commit bd70d4e589711fda9ab07738c46e37eee8376214) diff --git a/kio/kssl/ksslcertificatebox.cpp b/kio/kssl/ksslcertificatebox.cpp index 4ffc613..094787a 100644 @@ -22,3 +21,4 @@ index 4ffc613..094787a 100644 } + diff --git a/kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch b/kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch new file mode 100644 index 0000000..819a429 --- /dev/null +++ b/kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch @@ -0,0 +1,65 @@ +diff --git a/nepomuk/query/querybuilderdata_p.h b/nepomuk/query/querybuilderdata_p.h +index 055482e..3880e13 100644 +--- a/nepomuk/query/querybuilderdata_p.h ++++ b/nepomuk/query/querybuilderdata_p.h +@@ -32,6 +32,28 @@ + #include "query_p.h" + #include "groupterm_p.h" + ++namespace { ++/// A hack to avoid passing extended chars to the bif:search_excerpts method which cannot handle ++/// utf8 chars which use more than one char, ie. wide chars. ++/// Thus, we simply truncate each term at the first wide char. ++QStringList stripExtendedCharsHack(const QStringList& terms) { ++ QStringList newTerms; ++ foreach(const QString& term, terms) { ++ int i = 0; ++ while(i < term.length()) { ++ if(term[i].unicode() > 0x7f) { ++ break; ++ } ++ ++i; ++ } ++ if(i > 0) { ++ newTerms.append(term.left(i)); ++ } ++ } ++ return newTerms; ++} ++} ++ + namespace Nepomuk { + namespace Query { + class QueryBuilderData +@@ -246,16 +268,23 @@ namespace Nepomuk { + for( QHash<QString, QStringList>::const_iterator it = m_fullTextSearchTerms.constBegin(); + it != m_fullTextSearchTerms.constEnd(); ++it ) { + const QString& varName = it.key(); +- const QStringList& terms = it.value(); +- // bif:search_excerpt wants a vector of all search terms +- excerptParts +- << QString::fromLatin1("bif:search_excerpt(bif:vector(bif:charset_recode('%1', '_WIDE_', 'UTF-8')), %2)") +- .arg( terms.join(QLatin1String("','")), +- varName ); ++ const QStringList terms = stripExtendedCharsHack(it.value()); ++ if(terms.count()) { ++ // bif:search_excerpt wants a vector of all search terms ++ excerptParts ++ << QString::fromLatin1("bif:search_excerpt(bif:vector('%1'), %2)") ++ .arg( terms.join(QLatin1String("','")), ++ varName ); ++ } + } + +- return QString::fromLatin1("(bif:concat(%1)) as ?_n_f_t_m_ex_") +- .arg(excerptParts.join(QLatin1String(","))); ++ if(excerptParts.count()) { ++ return QString::fromLatin1("(bif:concat(%1)) as ?_n_f_t_m_ex_") ++ .arg(excerptParts.join(QLatin1String(","))); ++ } ++ else { ++ return QString(); ++ } + } + else { + return QString(); |