diff --git a/.gitignore b/.gitignore index bd9cb5a..bc201bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ accounts-qt-0.31.tar.gz /accounts-qt-1.6.tar.bz2 /accounts-qt-1.11.tar.bz2 +/libaccounts-qt-1.13-2a9cc22ff7b0b62b60541423763cb3dd992c0f40.tar.gz diff --git a/0002-Fix-memory-leaks-found-by-valgrind.patch b/0002-Fix-memory-leaks-found-by-valgrind.patch new file mode 100644 index 0000000..fa2936c --- /dev/null +++ b/0002-Fix-memory-leaks-found-by-valgrind.patch @@ -0,0 +1,60 @@ +From 533aa917f2de9030a05e745a0e49a53a7fb4b36e Mon Sep 17 00:00:00 2001 +From: Vyacheslav Monich +Date: Fri, 5 Sep 2014 16:23:44 +0300 +Subject: [PATCH 2/6] Fix memory leaks found by valgrind + +Fixes: https://code.google.com/p/accounts-sso/issues/detail?id=239 +--- + Accounts/account-service.cpp | 4 +++- + Accounts/auth-data.cpp | 1 + + Accounts/utils.cpp | 4 +++- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/Accounts/account-service.cpp b/Accounts/account-service.cpp +index 9da8f8c..6661685 100644 +--- a/Accounts/account-service.cpp ++++ b/Accounts/account-service.cpp +@@ -504,5 +504,7 @@ AuthData AccountService::authData() const + + AgAuthData *agAuthData = + ag_account_service_get_auth_data(d->m_accountService); +- return AuthData(agAuthData); ++ AuthData authData(agAuthData); ++ ag_auth_data_unref(agAuthData); ++ return authData; + } +diff --git a/Accounts/auth-data.cpp b/Accounts/auth-data.cpp +index ef4b8d9..ed30396 100644 +--- a/Accounts/auth-data.cpp ++++ b/Accounts/auth-data.cpp +@@ -109,6 +109,7 @@ QVariantMap AuthData::parameters() const + if (glibParameters == 0) return QVariantMap(); + + QVariant variant = gVariantToQVariant(glibParameters); ++ g_variant_unref(glibParameters); + if (!variant.isValid()) return QVariantMap(); + + return variant.toMap(); +diff --git a/Accounts/utils.cpp b/Accounts/utils.cpp +index 71e24b6..dd0c7e1 100644 +--- a/Accounts/utils.cpp ++++ b/Accounts/utils.cpp +@@ -32,12 +32,14 @@ static QVariantMap gVariantToQVariantMap(GVariant *variant) + { + QVariantMap ret; + GVariantIter iter; +- const gchar *key; ++ gchar *key; + GVariant *value; + + g_variant_iter_init (&iter, variant); + while (g_variant_iter_next (&iter, "{sv}", &key, &value)) { + ret.insert(UTF8(key), gVariantToQVariant(value)); ++ g_variant_unref(value); ++ g_free(key); + } + + return ret; +-- +2.5.0 + diff --git a/0005-Use-gboolean-instead-of-bool.patch b/0005-Use-gboolean-instead-of-bool.patch new file mode 100644 index 0000000..2d52b19 --- /dev/null +++ b/0005-Use-gboolean-instead-of-bool.patch @@ -0,0 +1,34 @@ +From 207139e65e6707100d2e92d96b1a4c3bfaa88a5f Mon Sep 17 00:00:00 2001 +From: Mikko Harju +Date: Thu, 13 Aug 2015 03:09:07 -0400 +Subject: [PATCH 5/6] Use gboolean instead of bool + +The "use-dbus" is a boolean g_object property, with actual type of +gboolean, and gboolean is typedef int. g_object_get is a variadic +function (no static type checking), and stores the queried value +through pointer-to-int. If sizeof(bool) happens to be less than +sizeof(int) and the stack variable useDBus is packed tightly, +this can lead to stack corruption. + +Compiling the lib with -fstack-protector immediately pointed out +the problem. +--- + Accounts/manager.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Accounts/manager.cpp b/Accounts/manager.cpp +index 2eb077f..1ac78d0 100644 +--- a/Accounts/manager.cpp ++++ b/Accounts/manager.cpp +@@ -530,7 +530,7 @@ bool Manager::abortOnTimeout() const + */ + Manager::Options Manager::options() const + { +- bool useDBus = true; ++ gboolean useDBus = true; + g_object_get(d->m_manager, + "use-dbus", &useDBus, + NULL); +-- +2.5.0 + diff --git a/libaccounts-qt.spec b/libaccounts-qt.spec index c04638b..9ba5fb1 100644 --- a/libaccounts-qt.spec +++ b/libaccounts-qt.spec @@ -1,67 +1,87 @@ -Name: libaccounts-qt -Version: 1.11 -Release: 7%{?dist} -Summary: Accounts framework Qt bindings -Group: System Environment/Libraries -License: LGPLv2 -URL: http://code.google.com/p/accounts-sso/ -Source0: http://accounts-sso.googlecode.com/files/accounts-qt-%{version}.tar.bz2 -Patch1: libaccounts-qt-64bitarchs.patch -BuildRequires: qt-devel libaccounts-glib-devel -BuildRequires: doxygen graphviz + +%global commit0 2a9cc22ff7b0b62b60541423763cb3dd992c0f40 + +Name: libaccounts-qt +Summary: Accounts framework Qt bindings +Version: 1.13 +Release: 1%{?dist} + +License: LGPLv2 +URL: https://gitlab.com/accounts-sso/libaccounts-qt + +Source0: https://gitlab.com/accounts-sso/libaccounts-qt/repository/archive.tar.gz?ref=%{version}#/libaccounts-qt-%{version}-%{commit0}.tar.gz + +Patch1: libaccounts-qt-64bitarchs.patch + +## upstream patches +Patch102: 0002-Fix-memory-leaks-found-by-valgrind.patch +patch105: 0005-Use-gboolean-instead-of-bool.patch + +BuildRequires: pkgconfig(QtGui) +BuildRequires: pkgconfig(libaccounts-glib) +BuildRequires: doxygen +BuildRequires: graphviz %description -Framework to provide accounts for Qt. +%{summary}. -%package devel -Summary: Development files for accounts-qt -Group: Development/Libraries -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: qt4-devel%{?_isa} +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +%description devel +%{summary}. -%description devel -Headers, development libraries and documentation for accounts-qt. %prep -%setup -q -n accounts-qt-%{version} +%setup -q -n libaccounts-qt-%{version}-%{commit0} + %patch1 -p1 -b .64bitarchs +%patch102 -p1 -b .0002 +%patch105 -p1 -b .0005 + %build -export PATH=%{_qt4_bindir}:$PATH -%{_qt4_qmake} QMF_INSTALL_ROOT=%{_prefix} \ - CONFIG+=release accounts-qt.pro +%{qmake_qt4} \ + QMF_INSTALL_ROOT=%{_prefix} \ + CONFIG+=release \ + accounts-qt.pro make %{?_smp_mflags} + %install make install INSTALL_ROOT=%{buildroot} -rm -f %{buildroot}/%{_datadir}/doc/accounts-qt/html/installdox +rm -fv %{buildroot}%{_datadir}/doc/accounts-qt/html/installdox #remove tests for now -rm -rf %{buildroot}%{_datadir}/%{name}-tests -rm -f %{buildroot}%{_bindir}/accountstest +rm -rfv %{buildroot}%{_datadir}/libaccounts-qt-tests +rm -fv %{buildroot}%{_bindir}/accountstest # move installed docs to include them in subpackage via %%doc magic rm -rf __tmp_doc ; mkdir __tmp_doc mv %{buildroot}%{_docdir}/accounts-qt __tmp_doc -%post -p /sbin/ldconfig +%post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -%doc COPYING -%{_libdir}/lib*.so.* +%license COPYING +%{_libdir}/libaccounts-qt.so.* %files devel -%{_libdir}/lib*.so +%{_libdir}/libaccounts-qt.so %{_includedir}/accounts-qt/ %{_libdir}/pkgconfig/accounts-qt.pc -%{_libdir}/cmake/AccountsQt +%{_libdir}/cmake/AccountsQt/ %doc __tmp_doc/accounts-qt/* + %changelog +* Mon Sep 28 2015 Rex Dieter 1.13-1 +- libaccounts-qt-1.13, merge improvements from libaccounts-qt5 + * Wed Jun 17 2015 Fedora Release Engineering - 1.11-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild @@ -92,38 +112,10 @@ mv %{buildroot}%{_docdir}/accounts-qt __tmp_doc - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Wed Mar 06 2013 Karsten Hopp 1.6-2 -- add s390x and ppc64 to 64bit archs using lib64 +- add s390x and ppc64 to 64bit archs using lib64 * Mon Mar 04 2013 Jaroslav Reznik - 1.6-1 - Update to 1.6 - Fix rebuild issues with GCC 4.8 - Remove accounts-tool - Cleanup - -* Thu Feb 14 2013 Fedora Release Engineering - 0.31-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Thu Jul 19 2012 Fedora Release Engineering - 0.31-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Fri Jan 13 2012 Fedora Release Engineering - 0.31-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Mon Feb 07 2011 Fedora Release Engineering - 0.31-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Fri Aug 06 2010 Chen Lei - 0.31-3 -- Fix doc path - -* Fri Aug 06 2010 Chen Lei - 0.31-2 -- Small fix for description - -* Fri Aug 06 2010 Chen Lei - 0.31-1 -- New upstream release -- Several changes against package review - -* Fri Jul 23 2010 Chen Lei - 0.28-1 -- Initial packaging for Fedora - -* Mon Jun 14 2010 Bernd Wachter - 0.28 -- Update to latest version diff --git a/sources b/sources index 2b79c0a..f7ea83e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a76f26849603f229399dc46eb83ed5a8 accounts-qt-1.11.tar.bz2 +308ca7df89c05c71978b62910315867f libaccounts-qt-1.13-2a9cc22ff7b0b62b60541423763cb3dd992c0f40.tar.gz