Blob Blame History Raw
From 8878abc5e22b5bd9107e0f99d87660e114e3add9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 10 Mar 2014 08:25:15 -0400
Subject: [PATCH] logind: fix policykit checks

(cherry picked from commit 055d406624cb9e01963558767420b71e5f75d2d3)
(cherry picked from commit 10ff861167dc4b03ad9e515141f535845fcfd38a)
---
 src/login/logind-dbus.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index e1f0c9a0d7..a5ab19cd9e 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1302,18 +1302,24 @@ static int bus_manager_do_shutdown_or_sleep(
                 r = verify_polkit(connection, message, action_multiple_sessions, interactive, NULL, error);
                 if (r < 0)
                         return r;
+                if (r == 0)
+                        return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
         }
 
         if (blocked) {
                 r = verify_polkit(connection, message, action_ignore_inhibit, interactive, NULL, error);
                 if (r < 0)
                         return r;
+                if (r == 0)
+                        return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
         }
 
         if (!multiple_sessions && !blocked) {
                 r = verify_polkit(connection, message, action, interactive, NULL, error);
                 if (r < 0)
                         return r;
+                if (r == 0)
+                        return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
         }
 
         r = bus_manager_shutdown_or_sleep_now_or_later(m, unit_name, w, error);