From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6910B13835A for ; Fri, 5 Jun 2020 00:39:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 74FBAE0942; Fri, 5 Jun 2020 00:39:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4A5C9E0942 for ; Fri, 5 Jun 2020 00:39:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5C4CD34F270 for ; Fri, 5 Jun 2020 00:39:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 53413268 for ; Fri, 5 Jun 2020 00:39:50 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1591317505.eb77bf011bd6d6a7c81fb6ed27d0bc23b7782c71.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/signond/, net-libs/signond/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-libs/signond/files/signond-8.60-crashfix.patch net-libs/signond/signond-8.60-r2.ebuild X-VCS-Directories: net-libs/signond/ net-libs/signond/files/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: eb77bf011bd6d6a7c81fb6ed27d0bc23b7782c71 X-VCS-Branch: master Date: Fri, 5 Jun 2020 00:39:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0fbfdda8-e1f1-4a6a-a67b-b2661c65bd48 X-Archives-Hash: 47c4b87e8e3ab3daa3bad0407af904a7 commit: eb77bf011bd6d6a7c81fb6ed27d0bc23b7782c71 Author: Andreas Sturmlechner gentoo org> AuthorDate: Fri Jun 5 00:24:41 2020 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Fri Jun 5 00:38:25 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb77bf01 net-libs/signond: Fix runtime crashes Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Andreas Sturmlechner gentoo.org> net-libs/signond/files/signond-8.60-crashfix.patch | 160 +++++++++++++++++++++ net-libs/signond/signond-8.60-r2.ebuild | 76 ++++++++++ 2 files changed, 236 insertions(+) diff --git a/net-libs/signond/files/signond-8.60-crashfix.patch b/net-libs/signond/files/signond-8.60-crashfix.patch new file mode 100644 index 00000000000..8cfc79ac431 --- /dev/null +++ b/net-libs/signond/files/signond-8.60-crashfix.patch @@ -0,0 +1,160 @@ +From ab9fab9763277783363f8c6d4b62405c3b0b0413 Mon Sep 17 00:00:00 2001 +From: Chris Adams +Date: Wed, 31 Jul 2019 12:45:14 +1000 +Subject: [PATCH] Don't emit QObject::destroyed() within Identity::destroy() + +QObject::destroyed() should not be emitted manually, as that can +cause unwanted side effects. + +Specifically, in this case, the +QDBusConnectionPrivate::objectDestroyed() slot was invoked with +invalidated object parameter (perhaps due to duplicate invocation) +resulting in a warning in QObject::disconnect(). + +Instead, ensure the object is unregistered from DBus immediately. +--- + src/signond/signondaemonadaptor.cpp | 29 ++++++++++++++++++++++++++++- + src/signond/signondaemonadaptor.h | 3 +++ + src/signond/signonidentity.cpp | 13 ++++++++----- + src/signond/signonidentity.h | 1 + + 4 files changed, 40 insertions(+), 6 deletions(-) + +diff --git a/src/signond/signondaemonadaptor.cpp b/src/signond/signondaemonadaptor.cpp +index 8b35e4bd..abd8fd3a 100644 +--- a/src/signond/signondaemonadaptor.cpp ++++ b/src/signond/signondaemonadaptor.cpp +@@ -29,6 +29,13 @@ + + namespace SignonDaemonNS { + ++struct RegisteredIdentity { ++ RegisteredIdentity(const QDBusConnection &connection, QObject *identity) ++ : conn(connection), ident(identity) {} ++ QDBusConnection conn; ++ QObject *ident = nullptr; ++}; ++ + SignonDaemonAdaptor::SignonDaemonAdaptor(SignonDaemon *parent): + QDBusAbstractAdaptor(parent), + m_parent(parent) +@@ -38,6 +45,7 @@ SignonDaemonAdaptor::SignonDaemonAdaptor(SignonDaemon *parent): + + SignonDaemonAdaptor::~SignonDaemonAdaptor() + { ++ qDeleteAll(m_registeredIdentities); + } + + void SignonDaemonAdaptor::registerNewIdentity(const QString &applicationContext, +@@ -46,7 +54,10 @@ void SignonDaemonAdaptor::registerNewIdentity(const QString &applicationContext, + Q_UNUSED(applicationContext); + + QObject *identity = m_parent->registerNewIdentity(); +- objectPath = registerObject(parentDBusContext().connection(), identity); ++ QDBusConnection dbusConnection(parentDBusContext().connection()); ++ objectPath = registerObject(dbusConnection, identity); ++ m_registeredIdentities.append(new RegisteredIdentity(dbusConnection, identity)); ++ connect(identity, SIGNAL(unregistered()), this, SLOT(onIdentityUnregistered())); + + SignonDisposable::destroyUnused(); + } +@@ -130,6 +141,22 @@ void SignonDaemonAdaptor::getIdentity(const quint32 id, + SignonDisposable::destroyUnused(); + } + ++void SignonDaemonAdaptor::onIdentityUnregistered() ++{ ++ QObject *ident = sender(); ++ if (!ident) { ++ return; ++ } ++ ++ for (int i = 0; i < m_registeredIdentities.size(); ++i) { ++ if (m_registeredIdentities[i]->ident == ident) { ++ m_registeredIdentities[i]->conn.unregisterObject(ident->objectName()); ++ delete m_registeredIdentities.takeAt(i); ++ return; ++ } ++ } ++} ++ + void SignonDaemonAdaptor::onIdentityAccessReplyFinished() + { + SignOn::AccessReply *reply = qobject_cast(sender()); +diff --git a/src/signond/signondaemonadaptor.h b/src/signond/signondaemonadaptor.h +index db8d875f..1c20cac3 100644 +--- a/src/signond/signondaemonadaptor.h ++++ b/src/signond/signondaemonadaptor.h +@@ -34,6 +34,7 @@ + namespace SignonDaemonNS { + + typedef QList MapList; ++class RegisteredIdentity; + + class SignonDaemonAdaptor: public QDBusAbstractAdaptor + { +@@ -74,10 +75,12 @@ private: + QObject *object); + + private Q_SLOTS: ++ void onIdentityUnregistered(); + void onIdentityAccessReplyFinished(); + void onAuthSessionAccessReplyFinished(); + + private: ++ QList m_registeredIdentities; + SignonDaemon *m_parent; + }; //class SignonDaemonAdaptor + +diff --git a/src/signond/signonidentity.cpp b/src/signond/signonidentity.cpp +index ce1ecfb0..a143c223 100644 +--- a/src/signond/signonidentity.cpp ++++ b/src/signond/signonidentity.cpp +@@ -84,7 +84,8 @@ private: + SignonIdentity::SignonIdentity(quint32 id, int timeout, + SignonDaemon *parent): + SignonDisposable(timeout, parent), +- m_pInfo(NULL) ++ m_pInfo(NULL), ++ m_destroyed(false) + { + m_id = id; + +@@ -112,7 +113,10 @@ SignonIdentity::SignonIdentity(quint32 id, int timeout, + + SignonIdentity::~SignonIdentity() + { +- emit unregistered(); ++ if (!m_destroyed) { ++ m_destroyed = true; ++ Q_EMIT unregistered(); ++ } + + delete m_signonui; + delete m_pInfo; +@@ -125,9 +129,8 @@ SignonIdentity *SignonIdentity::createIdentity(quint32 id, SignonDaemon *parent) + + void SignonIdentity::destroy() + { +- /* Emitting the destroyed signal makes QDBusConnection unregister the +- * object */ +- Q_EMIT destroyed(); ++ m_destroyed = true; ++ Q_EMIT unregistered(); + deleteLater(); + } + +diff --git a/src/signond/signonidentity.h b/src/signond/signonidentity.h +index 9ec9be4e..f6321f30 100644 +--- a/src/signond/signonidentity.h ++++ b/src/signond/signonidentity.h +@@ -96,6 +96,7 @@ private: + quint32 m_id; + SignonUiAdaptor *m_signonui; + SignonIdentityInfo *m_pInfo; ++ bool m_destroyed; + }; //class SignonDaemon + + } //namespace SignonDaemonNS +-- +2.26.2 + diff --git a/net-libs/signond/signond-8.60-r2.ebuild b/net-libs/signond/signond-8.60-r2.ebuild new file mode 100644 index 00000000000..b1040feb3ec --- /dev/null +++ b/net-libs/signond/signond-8.60-r2.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit qmake-utils + +DESCRIPTION="Signon daemon for libaccounts-glib" +HOMEPAGE="https://gitlab.com/accounts-sso" +SRC_URI="https://gitlab.com/accounts-sso/${PN}/-/archive/VERSION_${PV}/${PN}-VERSION_${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +IUSE="doc test" + +BDEPEND="doc? ( app-doc/doxygen )" +RDEPEND=" + dev-qt/qtcore:5 + dev-qt/qtdbus:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtsql:5 + net-libs/libproxy +" +DEPEND="${RDEPEND} + test? ( dev-qt/qttest:5 ) +" + +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}/${P}-buildsystem.patch" + "${FILESDIR}/${P}-consistent-paths.patch" # bug 701142 + "${FILESDIR}/${P}-crashfix.patch" +) + +S="${WORKDIR}/${PN}-VERSION_${PV}" + +src_prepare() { + default + + # install docs to correct location + sed -e "s|share/doc/\$\${PROJECT_NAME}|share/doc/${PF}|" \ + -i doc/doc.pri || die + sed -e "/^documentation.path = /c\documentation.path = \$\${INSTALL_PREFIX}/share/doc/${PF}/\$\${TARGET}/" \ + -i lib/plugins/doc/doc.pri || die + sed -e "/^documentation.path = /c\documentation.path = \$\${INSTALL_PREFIX}/share/doc/${PF}/libsignon-qt/" \ + -i lib/SignOn/doc/doc.pri || die + + # std flags + sed -e "/CONFIG += c++11/d" \ + -i common-project-config.pri || die "failed fixing CXXFLAGS" + + # fix runtime failures + sed -e "/fno-rtti/d" \ + -i common-project-config.pri src/plugins/plugins.pri \ + src/{remotepluginprocess/remotepluginprocess,extensions/cryptsetup/cryptsetup}.pro \ + tests/{signond-tests/signond-tests,extensions/extensions}.pri \ + tests/{passwordplugintest/passwordplugintest,libsignon-qt-tests/libsignon-qt-tests}.pro \ + || die "failed disabling -fno-rtti" + + use doc || sed -e "/include(\s*doc\/doc.pri\s*)/d" \ + -i signon.pro lib/SignOn/SignOn.pro lib/plugins/plugins.pro || die + + use test || sed -e '/^SUBDIRS/s/tests//' \ + -i signon.pro || die "couldn't disable tests" +} + +src_configure() { + eqmake5 PREFIX="${EPREFIX}"/usr LIBDIR=$(get_libdir) +} + +src_install() { + emake INSTALL_ROOT="${D}" install +}