forked from pool/kauth
This commit is contained in:
parent
66a643ffb3
commit
ee66e2a9d3
@ -1,29 +1,17 @@
|
|||||||
From ecf0566285599605565cdb769f19160dfdfc5d12 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Martin Sandsmark <martin.sandsmark@kde.org>
|
|
||||||
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
|
diff --git a/src/backends/polkit-1/Polkit1Backend.cpp b/src/backends/polkit-1/Polkit1Backend.cpp
|
||||||
index 165f7bb..1e6febe 100644
|
index 165f7bb..525e920 100644
|
||||||
--- a/src/backends/polkit-1/Polkit1Backend.cpp
|
--- a/src/backends/polkit-1/Polkit1Backend.cpp
|
||||||
+++ b/src/backends/polkit-1/Polkit1Backend.cpp
|
+++ b/src/backends/polkit-1/Polkit1Backend.cpp
|
||||||
@@ -142,7 +142,8 @@ void Polkit1Backend::setupAction(const QString &action)
|
@@ -142,7 +142,7 @@ void Polkit1Backend::setupAction(const QString &action)
|
||||||
|
|
||||||
Action::AuthStatus Polkit1Backend::actionStatus(const QString &action)
|
Action::AuthStatus Polkit1Backend::actionStatus(const QString &action)
|
||||||
{
|
{
|
||||||
- PolkitQt1::UnixProcessSubject subject(QCoreApplication::applicationPid());
|
- PolkitQt1::UnixProcessSubject subject(QCoreApplication::applicationPid());
|
||||||
+ PolkitQt1::SystemBusNameSubject subject(QDBusConnection::systemBus().baseService());
|
+ PolkitQt1::SystemBusNameSubject subject(QDBusConnection::systemBus().baseService());
|
||||||
+ qDebug() << "actionStatus called with subject:" << QDBusConnection::systemBus().baseService();
|
|
||||||
PolkitQt1::Authority::Result r = PolkitQt1::Authority::instance()->checkAuthorizationSync(action, subject,
|
PolkitQt1::Authority::Result r = PolkitQt1::Authority::instance()->checkAuthorizationSync(action, subject,
|
||||||
PolkitQt1::Authority::None);
|
PolkitQt1::Authority::None);
|
||||||
switch (r) {
|
switch (r) {
|
||||||
@@ -158,21 +159,13 @@ Action::AuthStatus Polkit1Backend::actionStatus(const QString &action)
|
@@ -158,21 +158,12 @@ Action::AuthStatus Polkit1Backend::actionStatus(const QString &action)
|
||||||
|
|
||||||
QByteArray Polkit1Backend::callerID() const
|
QByteArray Polkit1Backend::callerID() const
|
||||||
{
|
{
|
||||||
@ -44,10 +32,6 @@ index 165f7bb..1e6febe 100644
|
|||||||
-
|
-
|
||||||
- PolkitQt1::UnixProcessSubject subject(pid);
|
- PolkitQt1::UnixProcessSubject subject(pid);
|
||||||
+ PolkitQt1::SystemBusNameSubject subject(QString::fromUtf8(callerID));
|
+ PolkitQt1::SystemBusNameSubject subject(QString::fromUtf8(callerID));
|
||||||
+ qDebug() << "isCallerAuthorized called with subject:" << callerID;
|
|
||||||
PolkitQt1::Authority *authority = PolkitQt1::Authority::instance();
|
PolkitQt1::Authority *authority = PolkitQt1::Authority::instance();
|
||||||
|
|
||||||
PolkitResultEventLoop e;
|
PolkitResultEventLoop e;
|
||||||
--
|
|
||||||
1.9.1
|
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jul 18 08:12:36 UTC 2014 - hrvoje.senjan@gmail.com
|
||||||
|
|
||||||
|
- Install org.kde.kf5auth.conf, now that it's whitelisted
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jul 16 21:31:42 UTC 2014 - hrvoje.senjan@gmail.com
|
Wed Jul 16 21:31:42 UTC 2014 - hrvoje.senjan@gmail.com
|
||||||
|
|
||||||
|
@ -84,8 +84,10 @@ Development files.
|
|||||||
|
|
||||||
%find_lang %{name}5 --with-qt --without-mo
|
%find_lang %{name}5 --with-qt --without-mo
|
||||||
|
|
||||||
# Comment out until security review is done!
|
%if 0%{?suse_version} <= 1310
|
||||||
# echo "setBadness('suse-dbus-unauthorized-service', 0)" > $RPM_SOURCE_DIR/%name-rpmlintrc
|
# we need this for older oS releases; only Factory/13.2 has the whitelist
|
||||||
|
echo "setBadness('suse-dbus-unauthorized-service', 0)" > $RPM_SOURCE_DIR/%name-rpmlintrc
|
||||||
|
%endif
|
||||||
|
|
||||||
%post -n %lname -p /sbin/ldconfig
|
%post -n %lname -p /sbin/ldconfig
|
||||||
|
|
||||||
@ -100,8 +102,7 @@ Development files.
|
|||||||
%{_kf5_plugindir}/
|
%{_kf5_plugindir}/
|
||||||
%dir %{_kf5_libdir}/libexec
|
%dir %{_kf5_libdir}/libexec
|
||||||
%{_kf5_libdir}/libexec/kauth
|
%{_kf5_libdir}/libexec/kauth
|
||||||
# Until security review is done!
|
%config %{_kf5_sysconfdir}/dbus-1/system.d/org.kde.kf5auth.conf
|
||||||
%exclude %{_kf5_sysconfdir}/dbus-1/system.d/org.kde.kf5auth.conf
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
Loading…
Reference in New Issue
Block a user