chiark / gitweb /
logind: fix policykit checks
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 Mar 2014 12:25:15 +0000 (08:25 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 Mar 2014 14:43:47 +0000 (10:43 -0400)
src/login/logind-dbus.c

index c9c58f3f823701f35af3311eb61a3c7205d890b7..235b1313d470d3f19f7739a2c1cf35b5aaaf572b 100644 (file)
@@ -1480,6 +1480,8 @@ static int method_do_shutdown_or_sleep(
                                             action_multiple_sessions, interactive, error, method, m);
                 if (r < 0)
                         return r;
                                             action_multiple_sessions, interactive, error, method, m);
                 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) {
         }
 
         if (blocked) {
@@ -1487,6 +1489,8 @@ static int method_do_shutdown_or_sleep(
                                             action_ignore_inhibit, interactive, error, method, m);
                 if (r < 0)
                         return r;
                                             action_ignore_inhibit, interactive, error, method, m);
                 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) {
         }
 
         if (!multiple_sessions && !blocked) {
@@ -1494,6 +1498,8 @@ static int method_do_shutdown_or_sleep(
                                             action, interactive, error, method, m);
                 if (r < 0)
                         return r;
                                             action, interactive, error, method, m);
                 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);
         }
 
         r = bus_manager_shutdown_or_sleep_now_or_later(m, unit_name, w, error);