From 8acc3d6ce7909eb1ed0cfb575bc59cef48703340 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Oct 31 2014 13:02:57 +0000 Subject: latest 1.13 branch fixes --- diff --git a/0005-Fix-buffer-overflow-in-AKTEST_FAKESERVER_MAIN.patch b/0005-Fix-buffer-overflow-in-AKTEST_FAKESERVER_MAIN.patch index 8cfaaae..79ca35f 100644 --- a/0005-Fix-buffer-overflow-in-AKTEST_FAKESERVER_MAIN.patch +++ b/0005-Fix-buffer-overflow-in-AKTEST_FAKESERVER_MAIN.patch @@ -1,7 +1,7 @@ From 01c86229f9e26d9e036f6f2ab405659ed836b5c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Mon, 8 Sep 2014 15:36:18 +0200 -Subject: [PATCH 5/5] Fix buffer overflow in AKTEST_FAKESERVER_MAIN() +Subject: [PATCH 5/9] Fix buffer overflow in AKTEST_FAKESERVER_MAIN() --- shared/aktest.h | 2 +- diff --git a/0006-Don-t-crash-when-setmntent-returns-NULL.patch b/0006-Don-t-crash-when-setmntent-returns-NULL.patch new file mode 100644 index 0000000..892b402 --- /dev/null +++ b/0006-Don-t-crash-when-setmntent-returns-NULL.patch @@ -0,0 +1,29 @@ +From ca59eb345cfef368242929ea33beca4bff837e9d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Vr=C3=A1til?= +Date: Thu, 18 Sep 2014 16:54:26 +0200 +Subject: [PATCH 6/9] Don't crash when setmntent returns NULL + +setmntent can fail when there's no /etc/mtab file for instance and +passing NULL pointer to getmntent crashes, so we need to return when +this happens. +--- + server/src/utils.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/server/src/utils.cpp b/server/src/utils.cpp +index b04a812..b51c330 100644 +--- a/server/src/utils.cpp ++++ b/server/src/utils.cpp +@@ -179,6 +179,9 @@ QString Utils::getDirectoryFileSystem(const QString &directory) + QString bestMatchFS; + + FILE *mtab = setmntent("/etc/mtab", "r"); ++ if (!mtab) { ++ return QString(); ++ } + while (mntent *mnt = getmntent(mtab)) { + if (qstrcmp(mnt->mnt_type, MNTTYPE_IGNORE) == 0) { + continue; +-- +1.9.3 + diff --git a/0007-Don-t-call-insert-from-Q_ASSERT-breaks-unit-tests-in.patch b/0007-Don-t-call-insert-from-Q_ASSERT-breaks-unit-tests-in.patch new file mode 100644 index 0000000..5335649 --- /dev/null +++ b/0007-Don-t-call-insert-from-Q_ASSERT-breaks-unit-tests-in.patch @@ -0,0 +1,37 @@ +From c516ec5c28d603aea0df6165f66a3a5d0a0191c4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Vr=C3=A1til?= +Date: Fri, 19 Sep 2014 10:50:23 +0200 +Subject: [PATCH 7/9] Don't call insert() from Q_ASSERT - breaks unit-tests in + Release mode + +--- + server/tests/unittest/collectionreferencetest.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/server/tests/unittest/collectionreferencetest.cpp b/server/tests/unittest/collectionreferencetest.cpp +index 1700c75..1b10c55 100644 +--- a/server/tests/unittest/collectionreferencetest.cpp ++++ b/server/tests/unittest/collectionreferencetest.cpp +@@ -45,7 +45,8 @@ public: + Resource res; + res.setId(1); + res.setName(QLatin1String(name)); +- Q_ASSERT(res.insert()); ++ const bool success = res.insert(); ++ Q_ASSERT(success); + mResource = res; + return res; + } +@@ -57,7 +58,8 @@ public: + col.setName(QLatin1String(name)); + col.setRemoteId(QLatin1String(name)); + col.setResource(mResource); +- Q_ASSERT(col.insert()); ++ const bool success = col.insert(); ++ Q_ASSERT(success); + return col; + } + +-- +1.9.3 + diff --git a/0008-Suppress-unused-variable-warnings-in-release-mode.patch b/0008-Suppress-unused-variable-warnings-in-release-mode.patch new file mode 100644 index 0000000..91fe98a --- /dev/null +++ b/0008-Suppress-unused-variable-warnings-in-release-mode.patch @@ -0,0 +1,32 @@ +From b35fcb64c3ba3df95f62d0d129adb791ce2bad15 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Vr=C3=A1til?= +Date: Fri, 19 Sep 2014 11:10:13 +0200 +Subject: [PATCH 8/9] Suppress unused variable warnings in release mode + +--- + server/tests/unittest/collectionreferencetest.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/server/tests/unittest/collectionreferencetest.cpp b/server/tests/unittest/collectionreferencetest.cpp +index 1b10c55..9c98f28 100644 +--- a/server/tests/unittest/collectionreferencetest.cpp ++++ b/server/tests/unittest/collectionreferencetest.cpp +@@ -47,6 +47,7 @@ public: + res.setName(QLatin1String(name)); + const bool success = res.insert(); + Q_ASSERT(success); ++ Q_UNUSED(success); + mResource = res; + return res; + } +@@ -60,6 +61,7 @@ public: + col.setResource(mResource); + const bool success = col.insert(); + Q_ASSERT(success); ++ Q_UNUSED(success); + return col; + } + +-- +1.9.3 + diff --git a/0009-Test-whether-compiler-supports-all-required-C-11-fea.patch b/0009-Test-whether-compiler-supports-all-required-C-11-fea.patch new file mode 100644 index 0000000..f965f37 --- /dev/null +++ b/0009-Test-whether-compiler-supports-all-required-C-11-fea.patch @@ -0,0 +1,45 @@ +From e1c69c277ea6005cc358434679b83fa1cb752756 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Vr=C3=A1til?= +Date: Tue, 23 Sep 2014 18:00:34 +0200 +Subject: [PATCH 9/9] Test whether compiler supports all required C++11 + features at configure time + +To prevent ugly compilation errors when someone tries to compile Akonadi +with a compiler that does not support all C++11 features we use, we run +a try_compile check in CMakeLists.txt. +--- + CMakeLists.txt | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e081d23..2d790c9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -216,6 +216,24 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER MATCHES "icc" OR (CMAKE_CXX_COMP + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wnon-virtual-dtor -Wundef -Wcast-align -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wformat-security -fno-common") + ++ file(WRITE ${CMAKE_BINARY_DIR}/cxx11_check.cpp ++ "enum Enum { Value = 1 }; ++ struct Class { ++ Class(int val) { (void)val; }; ++ // Delegating constructor ++ Class(): Class(42) {}; ++ // New-style enumerator ++ Class(Enum e = Enum::Value) { (void)e; }; ++ }; ++ int main() {} ++ ") ++ try_compile(CXX11_SUPPORTED ++ ${CMAKE_BINARY_DIR}/cxx11_check ++ ${CMAKE_BINARY_DIR}/cxx11_check.cpp) ++ if (NOT CXX11_SUPPORTED) ++ message(FATAL_ERROR "Compiler does not support all required C++11 features") ++ endif() ++ + # debugfull target + set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline" CACHE STRING "Flags used by the C++ compiler during debugfull builds." FORCE) + set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline" CACHE STRING "Flags used by the C compiler during debugfull builds." FORCE) +-- +1.9.3 + diff --git a/akonadi.spec b/akonadi.spec index 7e0dffb..b0e4f12 100644 --- a/akonadi.spec +++ b/akonadi.spec @@ -24,7 +24,7 @@ Summary: PIM Storage Service Name: akonadi Version: 1.13.0 -Release: 4%{?dist} +Release: 5%{?dist} License: LGPLv2+ URL: http://community.kde.org/KDE_PIM/Akonadi @@ -48,6 +48,11 @@ Patch2: 0002-Do-not-enter-the-test-directories-if-AKONADI_BUILD_T.patch Patch3: 0003-STORE-Allow-modifying-items-tags-via-Tag-RID-or-GID.patch Patch4: 0004-Fix-typo-in-if-condition.patch Patch5: 0005-Fix-buffer-overflow-in-AKTEST_FAKESERVER_MAIN.patch +Patch6: 0006-Don-t-crash-when-setmntent-returns-NULL.patch +Patch7: 0007-Don-t-call-insert-from-Q_ASSERT-breaks-unit-tests-in.patch +Patch8: 0008-Suppress-unused-variable-warnings-in-release-mode.patch +Patch9: 0009-Test-whether-compiler-supports-all-required-C-11-fea.patch + %define mysql_conf_timestamp 20140709 @@ -211,6 +216,9 @@ fi %changelog +* Fri Oct 31 2014 Rex Dieter 1.13.0-5 +- latest 1.13 branch fixes + * Sat Sep 27 2014 Rex Dieter 1.13.0-4 - explicitly Requires: mariadb-server/mysql-server as appropriate