diff --git a/0001-Fix-race-condition.patch b/0001-Fix-race-condition.patch new file mode 100644 index 0000000..cc787df --- /dev/null +++ b/0001-Fix-race-condition.patch @@ -0,0 +1,42 @@ +From ecf0566285599605565cdb769f19160dfdfc5d12 Mon Sep 17 00:00:00 2001 +From: Martin Sandsmark +Date: Wed, 16 Jul 2014 17:58:49 +0200 +Subject: [PATCH] Fix race condition. + +Using the PID based method in polkit is deprecated because of PID reuse +races. +--- + src/backends/polkit-1/Polkit1Backend.cpp | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/src/backends/polkit-1/Polkit1Backend.cpp b/src/backends/polkit-1/Polkit1Backend.cpp +index 165f7bb..1e6febe 100644 +--- a/src/backends/polkit-1/Polkit1Backend.cpp ++++ b/src/backends/polkit-1/Polkit1Backend.cpp +@@ -158,21 +158,12 @@ Action::AuthStatus Polkit1Backend::actionStatus(const QString &action) + + QByteArray Polkit1Backend::callerID() const + { +- QByteArray a; +- QDataStream s(&a, QIODevice::WriteOnly); +- s << QCoreApplication::applicationPid(); +- +- return a; ++ return QDBusConnection::systemBus().baseService().toUtf8(); + } + + bool Polkit1Backend::isCallerAuthorized(const QString &action, QByteArray callerID) + { +- QDataStream s(&callerID, QIODevice::ReadOnly); +- qint64 pid; +- +- s >> pid; +- +- PolkitQt1::UnixProcessSubject subject(pid); ++ PolkitQt1::SystemBusNameSubject subject(QString::fromUtf8(callerID)); + PolkitQt1::Authority *authority = PolkitQt1::Authority::instance(); + + PolkitResultEventLoop e; +-- +1.9.1 + diff --git a/kauth.changes b/kauth.changes index 70c6df7..420db86 100644 --- a/kauth.changes +++ b/kauth.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 16 21:31:42 UTC 2014 - hrvoje.senjan@gmail.com + +- Added 0001-Fix-race-condition.patch for resolving bnc#864716 + ------------------------------------------------------------------- Fri Jul 11 09:48:36 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/kauth.spec b/kauth.spec index 9503935..93aed3f 100644 --- a/kauth.spec +++ b/kauth.spec @@ -40,6 +40,8 @@ Source1: baselibs.conf Patch0: polkit-qt5-support.patch # PATCH-FIX-UPSTREAM 0001-Pass-trailing-slash-to-searched-backend-helper-plugi.patch Patch1: 0001-Pass-trailing-slash-to-searched-backend-helper-plugi.patch +# PATCH-FIX-UPSTREAM 0001-Fix-race-condition.patch -- https://git.reviewboard.kde.org/r/119323/ +Patch2: 0001-Fix-race-condition.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -70,6 +72,7 @@ Development files. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %cmake_kf5 -d build -- -DSYSCONF_INSTALL_DIR=%{_kf5_sysconfdir}