only use a single PolicyKit action for Linux MD operations
authorDavid Zeuthen <davidz@redhat.com>
Sun, 15 Mar 2009 17:05:18 +0000 (13:05 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Sun, 15 Mar 2009 17:05:18 +0000 (13:05 -0400)
policy/org.freedesktop.devicekit.disks.policy.in
src/devkit-disks-device.c
src/devkit-disks-poller.c
src/devkit-disks-poller.h
src/org.freedesktop.DeviceKit.Disks.Device.xml
src/org.freedesktop.DeviceKit.Disks.xml

index 07099e4..8a3fab6 100644 (file)
@@ -175,16 +175,6 @@ file are instantly applied.
     <defaults>
       <allow_any>no</allow_any>
       <allow_inactive>no</allow_inactive>
-      <allow_active>yes</allow_active>
-    </defaults>
-  </action>
-
-  <action id="org.freedesktop.devicekit.disks.linux-md-system-internal">
-    <_description>Configure Linux Software RAID on a system-internal device</_description>
-    <_message>Authentication is required to configure Linux Software RAID devices</_message>
-    <defaults>
-      <allow_any>no</allow_any>
-      <allow_inactive>no</allow_inactive>
       <allow_active>auth_admin</allow_active>
     </defaults>
   </action>
index fadae11..8c75b53 100644 (file)
@@ -7561,8 +7561,6 @@ devkit_disks_device_linux_md_stop (DevkitDisksDevice     *device,
 
         if (!devkit_disks_damon_local_check_auth (device->priv->daemon,
                                                   pk_caller,
-                                                  device->priv->device_is_system_internal ?
-                                                  "org.freedesktop.devicekit.disks.linux-md-system-internal" :
                                                   "org.freedesktop.devicekit.disks.linux-md",
                                                   context)) {
                 goto out;
@@ -7676,8 +7674,6 @@ devkit_disks_device_linux_md_add_component (DevkitDisksDevice     *device,
 
         if (!devkit_disks_damon_local_check_auth (device->priv->daemon,
                                                   pk_caller,
-                                                  device->priv->device_is_system_internal ?
-                                                  "org.freedesktop.devicekit.disks.linux-md-system-internal" :
                                                   "org.freedesktop.devicekit.disks.linux-md",
                                                   context)) {
                 goto out;
@@ -7895,8 +7891,6 @@ devkit_disks_device_linux_md_remove_component (DevkitDisksDevice     *device,
 
         if (!devkit_disks_damon_local_check_auth (device->priv->daemon,
                                                   pk_caller,
-                                                  device->priv->device_is_system_internal ?
-                                                  "org.freedesktop.devicekit.disks.linux-md-system-internal" :
                                                   "org.freedesktop.devicekit.disks.linux-md",
                                                   context)) {
                 goto out;
@@ -8195,8 +8189,6 @@ devkit_disks_daemon_linux_md_start (DevkitDisksDaemon     *daemon,
 
         if (!devkit_disks_damon_local_check_auth (daemon,
                                                   pk_caller,
-                                                  TRUE ? /* TODO: si IFF just a single component is si */
-                                                  "org.freedesktop.devicekit.disks.linux-md-system-internal" :
                                                   "org.freedesktop.devicekit.disks.linux-md",
                                                   context)) {
                 goto out;
index 4db4004..fe89ad3 100644 (file)
@@ -95,6 +95,7 @@ out:
 #endif
 }
 
+/* ---------------------------------------------------------------------------------------------------- */
 
 static gchar **poller_devices_to_poll = NULL;
 
@@ -130,6 +131,7 @@ devkit_disks_poller_poll_device (const gchar *device_file)
         }
 }
 
+/* ---------------------------------------------------------------------------------------------------- */
 
 static gboolean
 poller_timeout_cb (gpointer user_data)
@@ -146,6 +148,8 @@ poller_timeout_cb (gpointer user_data)
         return TRUE;
 }
 
+/* ---------------------------------------------------------------------------------------------------- */
+
 static gboolean
 poller_have_data (GIOChannel    *channel,
                   GIOCondition   condition,
@@ -211,6 +215,8 @@ poller_have_data (GIOChannel    *channel,
         return TRUE;
 }
 
+/* ---------------------------------------------------------------------------------------------------- */
+
 static void
 poller_run (gint fd)
 {
@@ -269,6 +275,8 @@ devkit_disks_poller_setup (int argc, char *argv[])
         return ret;
 }
 
+/* ---------------------------------------------------------------------------------------------------- */
+
 void
 devkit_disks_poller_set_devices (GList *devices)
 {
@@ -299,8 +307,10 @@ devkit_disks_poller_set_devices (GList *devices)
                 devices_currently_polled = devices_to_poll;
 
                 write (poller_daemon_write_end_fd, devices_currently_polled, strlen (devices_currently_polled));
-                //g_debug ("Wanna poll: '%s'", devices_currently_polled);
+                //g_debug ("Want to poll: '%s'", devices_currently_polled);
         } else {
                 g_free (devices_to_poll);
         }
 }
+
+/* ---------------------------------------------------------------------------------------------------- */
index ee6a40d..9d80a38 100644 (file)
 #include <devkit-disks-device.h>
 
 gboolean devkit_disks_poller_setup (int argc, char *argv[]);
+
+/* media detection polling */
 void     devkit_disks_poller_set_devices (GList *devices);
 void     devkit_disks_poller_poll_device (const gchar *device_file);
 
+/* ATA smart polling */
+void     devkit_disks_poller_set_ata_smart_devices (GList *devices);
 
 #endif /* __DEVKIT_DISKS_POLLER_H */
index fa1e9de..2cf9263 100644 (file)
           </doc:para>
         </doc:description>
         <doc:permission>
-          The caller will need one of the following PolicyKit authorizations:
+          The caller will need the following PolicyKit authorization:
           <doc:list>
             <doc:item>
               <doc:term>org.freedesktop.devicekit.disks.linux-md</doc:term>
               <doc:definition>
-                Needed to configured Linux md Software RAID devices where all components are
-                <doc:ref type="property" to="Device:device-is-system-internal">non-system-internal</doc:ref>.
-              </doc:definition>
-            </doc:item>
-            <doc:item>
-              <doc:term>org.freedesktop.devicekit.disks.linux-md-system-internal</doc:term>
-              <doc:definition>
-                Needed to configured Linux md Software RAID devices with one or more
-                <doc:ref type="property" to="Device:device-is-system-internal">system-internal</doc:ref>
-                components.
+                Needed to configured Linux md Software RAID devices.
               </doc:definition>
             </doc:item>
           </doc:list>
           </doc:para>
         </doc:description>
         <doc:permission>
-          The caller will need one of the following PolicyKit authorizations:
+          The caller will need the following PolicyKit authorization:
           <doc:list>
             <doc:item>
               <doc:term>org.freedesktop.devicekit.disks.linux-md</doc:term>
               <doc:definition>
-                Needed to configured Linux md Software RAID devices where all components are
-                <doc:ref type="property" to="Device:device-is-system-internal">non-system-internal</doc:ref>.
-              </doc:definition>
-            </doc:item>
-            <doc:item>
-              <doc:term>org.freedesktop.devicekit.disks.linux-md-system-internal</doc:term>
-              <doc:definition>
-                Needed to configured Linux md Software RAID devices with one or more
-                <doc:ref type="property" to="Device:device-is-system-internal">system-internal</doc:ref>
-                components.
+                Needed to configured Linux md Software RAID devices.
               </doc:definition>
             </doc:item>
           </doc:list>
           </doc:para>
         </doc:description>
         <doc:permission>
-          The caller will need one of the following PolicyKit authorizations:
+          The caller will need the following PolicyKit authorization:
           <doc:list>
             <doc:item>
               <doc:term>org.freedesktop.devicekit.disks.linux-md</doc:term>
               <doc:definition>
-                Needed to configured Linux md Software RAID devices where all components are
-                <doc:ref type="property" to="Device:device-is-system-internal">non-system-internal</doc:ref>.
-              </doc:definition>
-            </doc:item>
-            <doc:item>
-              <doc:term>org.freedesktop.devicekit.disks.linux-md-system-internal</doc:term>
-              <doc:definition>
-                Needed to configured Linux md Software RAID devices with one or more
-                <doc:ref type="property" to="Device:device-is-system-internal">system-internal</doc:ref>
-                components.
+                Needed to configured Linux md Software RAID devices.
               </doc:definition>
             </doc:item>
           </doc:list>
index e5d3822..f4f7ef8 100644 (file)
           </doc:para>
         </doc:description>
         <doc:permission>
-          The caller will need one of the following PolicyKit authorizations:
+          The caller will need the following PolicyKit authorization:
           <doc:list>
             <doc:item>
               <doc:term>org.freedesktop.devicekit.disks.linux-md</doc:term>
               <doc:definition>
-                Needed to configured Linux md Software RAID devices where all components are
-                <doc:ref type="property" to="Device:device-is-system-internal">non-system-internal</doc:ref>.
-              </doc:definition>
-            </doc:item>
-            <doc:item>
-              <doc:term>org.freedesktop.devicekit.disks.linux-md-system-internal</doc:term>
-              <doc:definition>
-                Needed to configured Linux md Software RAID devices with one or more
-                <doc:ref type="property" to="Device:device-is-system-internal">system-internal</doc:ref>
-                components.
+                Needed to configured Linux md Software RAID devices.
               </doc:definition>
             </doc:item>
           </doc:list>