Actually inhibit the daemon when Inhibit() is called
authorDavid Zeuthen <davidz@redhat.com>
Mon, 5 Oct 2009 18:31:22 +0000 (14:31 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Mon, 5 Oct 2009 18:31:22 +0000 (14:31 -0400)
Guess this was forgotten with the polkit-1 porting effort.

src/devkit-disks-daemon.c
src/devkit-disks-daemon.h

index b8c933b..e3f5bc6 100644 (file)
@@ -1288,7 +1288,13 @@ devkit_disks_daemon_local_check_auth (DevkitDisksDaemon            *daemon,
         }
         va_end (va_args);
 
-        if (action_id != NULL) {
+        if (devkit_disks_daemon_local_is_inhibited (daemon)) {
+                throw_error (data->context,
+                             DEVKIT_DISKS_ERROR_INHIBITED,
+                             "Daemon is inhibited");
+                check_auth_data_free (data);
+
+        } else if (action_id != NULL) {
                 PolkitSubject *subject;
                 PolkitDetails *details;
                 PolkitCheckAuthorizationFlags flags;
@@ -1783,7 +1789,7 @@ daemon_inhibitor_disconnected_cb (DevkitDisksInhibitor *inhibitor,
 }
 
 gboolean
-devkit_disks_daemon_local_has_inhibitors (DevkitDisksDaemon *daemon)
+devkit_disks_daemon_local_is_inhibited (DevkitDisksDaemon *daemon)
 {
         return daemon->priv->inhibitors != NULL;
 }
index dd0a4f0..3164734 100644 (file)
@@ -123,7 +123,7 @@ void               devkit_disks_daemon_local_update_spindown     (DevkitDisksDae
 
 gboolean           devkit_disks_daemon_local_has_polling_inhibitors (DevkitDisksDaemon       *daemon);
 
-gboolean           devkit_disks_daemon_local_has_inhibitors (DevkitDisksDaemon       *daemon);
+gboolean           devkit_disks_daemon_local_is_inhibited (DevkitDisksDaemon       *daemon);
 
 DevkitDisksMountMonitor *devkit_disks_daemon_local_get_mount_monitor (DevkitDisksDaemon *daemon);