DBusGMethodInvocation *context)
{
const gchar *action_id;
+ gboolean auth_no_user_interaction;
+ gchar **options_to_pass;
+ guint n;
+ guint m;
if (is_device_in_fstab (device, NULL)) {
action_id = NULL;
action_id = "org.freedesktop.devicekit.disks.filesystem-mount";
}
+ auth_no_user_interaction = FALSE;
+ options_to_pass = g_strdupv (given_options);
+ for (n = 0; options_to_pass != NULL && options_to_pass[n] != NULL; n++) {
+ if (g_strcmp0 (options_to_pass[n], "auth_no_user_interaction") == 0) {
+ auth_no_user_interaction = TRUE;
+ g_free (options_to_pass[n]);
+ for (m = n; options_to_pass[m + 1] != NULL; m++)
+ options_to_pass[m] = options_to_pass[m + 1];
+ options_to_pass[m] = NULL;
+ break;
+ }
+ }
+
devkit_disks_daemon_local_check_auth (device->priv->daemon,
device,
action_id,
"FilesystemMount",
+ !auth_no_user_interaction,
devkit_disks_device_filesystem_mount_authorized_cb,
context,
2,
g_strdup (filesystem_type), g_free,
- g_strdupv (given_options), g_strfreev);
+ options_to_pass, g_strfreev);
return TRUE;
}
device,
action_id,
"FilesystemUnmount",
+ TRUE,
devkit_disks_device_filesystem_unmount_authorized_cb,
context,
1,
devkit_disks_daemon_local_check_auth (device->priv->daemon,
device,
device->priv->device_is_system_internal ?
- "org.freedesktop.devicekit.disks.filesystem-lsof-system-internal" :
- "org.freedesktop.devicekit.disks.filesystem-lsof",
+ "org.freedesktop.devicekit.disks.filesystem-lsof-system-internal" :
+ "org.freedesktop.devicekit.disks.filesystem-lsof",
"FilesystemListOpenFiles",
+ TRUE,
devkit_disks_device_filesystem_list_open_files_authorized_cb,
context,
0);
device,
"org.freedesktop.devicekit.disks.drive-eject",
"DriveEject",
+ TRUE,
devkit_disks_device_drive_eject_authorized_cb,
context,
1,
device,
"org.freedesktop.devicekit.disks.drive-detach",
"DriveDetach",
+ TRUE,
devkit_disks_device_drive_detach_authorized_cb,
context,
1,
devkit_disks_daemon_local_check_auth (device->priv->daemon,
device,
device->priv->device_is_system_internal ?
- "org.freedesktop.devicekit.disks.filesystem-check-system-internal" :
- "org.freedesktop.devicekit.disks.filesystem-check",
+ "org.freedesktop.devicekit.disks.filesystem-check-system-internal" :
+ "org.freedesktop.devicekit.disks.filesystem-check",
"FilesystemCheck",
+ TRUE,
devkit_disks_device_filesystem_check_authorized_cb,
context,
1,
devkit_disks_daemon_local_check_auth (device->priv->daemon,
device,
device->priv->device_is_system_internal ?
- "org.freedesktop.devicekit.disks.change-system-internal" :
- "org.freedesktop.devicekit.disks.change",
+ "org.freedesktop.devicekit.disks.change-system-internal" :
+ "org.freedesktop.devicekit.disks.change",
"PartitionDelete",
+ TRUE,
devkit_disks_device_partition_delete_authorized_cb,
context,
1,
"org.freedesktop.devicekit.disks.change-system-internal" :
"org.freedesktop.devicekit.disks.change",
"FilesystemCreate",
+ TRUE,
devkit_disks_device_filesystem_create_authorized_cb,
context,
2,
device,
action_id,
"JobCancel",
+ TRUE,
devkit_disks_device_job_cancel_authorized_cb,
context,
0);
"org.freedesktop.devicekit.disks.change-system-internal" :
"org.freedesktop.devicekit.disks.change",
"PartitionCreate",
+ TRUE,
devkit_disks_device_partition_create_authorized_cb,
context,
8,
"org.freedesktop.devicekit.disks.change-system-internal" :
"org.freedesktop.devicekit.disks.change",
"PartitionModify",
+ TRUE,
devkit_disks_device_partition_modify_authorized_cb,
context,
3,
"org.freedesktop.devicekit.disks.change-system-internal" :
"org.freedesktop.devicekit.disks.change",
"PartitionTableCreate",
+ TRUE,
devkit_disks_device_partition_table_create_authorized_cb,
context,
2,
device,
"org.freedesktop.devicekit.disks.luks-unlock",
"LuksUnlock",
+ TRUE,
devkit_disks_device_luks_unlock_authorized_cb,
context,
2,
device,
action_id,
"LuksLock",
+ TRUE,
devkit_disks_device_luks_lock_authorized_cb,
context,
1,
"org.freedesktop.devicekit.disks.change-system-internal" :
"org.freedesktop.devicekit.disks.change",
"LuksChangePassphrase",
+ TRUE,
devkit_disks_device_luks_change_passphrase_authorized_cb,
context,
2,
"org.freedesktop.devicekit.disks.change-system-internal" :
"org.freedesktop.devicekit.disks.change",
"FilesystemSetLabel",
+ TRUE,
devkit_disks_device_filesystem_set_label_authorized_cb,
context,
1,
device,
action_id,
"DriveAtaSmartRefreshData",
+ TRUE,
devkit_disks_device_drive_ata_smart_refresh_data_authorized_cb,
context,
1,
device,
"org.freedesktop.devicekit.disks.drive-ata-smart-retrieve-historical-data",
"DriveAtaSmartGetHistoricalData",
+ TRUE,
devkit_disks_device_drive_ata_smart_get_historical_data_authorized_cb,
context,
3,
device,
"org.freedesktop.devicekit.disks.drive-ata-smart-selftest",
"DriveAtaSmartInitiateSelftest",
+ TRUE,
devkit_disks_device_drive_ata_smart_initiate_selftest_authorized_cb,
context,
2,
device,
"org.freedesktop.devicekit.disks.linux-md",
"LinuxMdStop",
+ TRUE,
devkit_disks_device_linux_md_stop_authorized_cb,
context,
1,
device,
"org.freedesktop.devicekit.disks.linux-md",
job_name,
+ TRUE,
devkit_disks_device_linux_md_check_authorized_cb,
context,
1,
device,
"org.freedesktop.devicekit.disks.linux-md",
"LinuxMdAddComponent",
+ TRUE,
devkit_disks_device_linux_md_add_component_authorized_cb,
context,
2,
device,
"org.freedesktop.devicekit.disks.linux-md",
"LinuxMdRemoveComponent",
+ TRUE,
devkit_disks_device_linux_md_remove_component_authorized_cb,
context,
2,
NULL,
"org.freedesktop.devicekit.disks.linux-md",
"LinuxMdStart",
+ TRUE,
devkit_disks_daemon_linux_md_start_authorized_cb,
context,
2,
NULL,
"org.freedesktop.devicekit.disks.linux-md",
"LinuxMdCreate",
+ TRUE,
devkit_disks_daemon_linux_md_create_authorized_cb,
context,
4,
device,
"org.freedesktop.devicekit.disks.inhibit-polling",
"DriveInhibitPolling",
+ TRUE,
devkit_disks_device_drive_inhibit_polling_authorized_cb,
context,
1,
device,
"org.freedesktop.devicekit.disks.inhibit-polling",
"DrivePollMedia",
+ TRUE,
devkit_disks_device_drive_poll_media_authorized_cb,
context,
0);
device,
"org.freedesktop.devicekit.disks.drive-set-spindown",
"DriveSetSpindownTimeout",
+ TRUE,
devkit_disks_device_drive_set_spindown_timeout_authorized_cb,
context,
2,