diff options
author | David Zeuthen <davidz@redhat.com> | 2011-11-29 09:19:29 -0500 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2011-11-29 09:19:29 -0500 |
commit | c87431f146a50ca7e05d57220f977adcac6d58cc (patch) | |
tree | be2c24e0c6e64083db74fc5be62da0930f1089a2 /src/udiskslinuxencrypted.c | |
parent | 01c410f7374160dfb4e0884bc574b95ea318d5c8 (diff) | |
download | udisks-c87431f146a50ca7e05d57220f977adcac6d58cc.tar.gz |
Greatly simplify cleanup logic and routines
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'src/udiskslinuxencrypted.c')
-rw-r--r-- | src/udiskslinuxencrypted.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/udiskslinuxencrypted.c b/src/udiskslinuxencrypted.c index c349798..5061b7f 100644 --- a/src/udiskslinuxencrypted.c +++ b/src/udiskslinuxencrypted.c @@ -513,19 +513,6 @@ handle_lock (UDisksEncrypted *encrypted, device = udisks_linux_block_object_get_device (UDISKS_LINUX_BLOCK_OBJECT (cleartext_object)); escaped_name = g_strescape (g_udev_device_get_sysfs_attr (device, "dm/name"), NULL); - if (cleartext_device_from_file != 0) - { - if (!udisks_cleanup_ignore_unlocked_luks (cleanup, udisks_block_get_device_number (cleartext_block))) - { - g_dbus_method_invocation_return_error (invocation, - UDISKS_ERROR, - UDISKS_ERROR_ALREADY_UNMOUNTING, - "Cannot lock %s as it's already being locked", - udisks_block_get_device (block)); - goto out; - } - } - if (!udisks_daemon_launch_spawned_job_sync (daemon, object, NULL, /* GCancellable */ @@ -537,10 +524,6 @@ handle_lock (UDisksEncrypted *encrypted, "cryptsetup luksClose \"%s\"", escaped_name)) { - if (cleartext_device_from_file != 0) - { - udisks_cleanup_unignore_unlocked_luks (cleanup, udisks_block_get_device_number (cleartext_block)); - } g_dbus_method_invocation_return_error (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, @@ -551,38 +534,6 @@ handle_lock (UDisksEncrypted *encrypted, goto out; } - /* OK, device locked.. now to remove the entry from persistent file */ - if (cleartext_device_from_file != 0) - { - error = NULL; - if (!udisks_cleanup_remove_unlocked_luks (cleanup, udisks_block_get_device_number (cleartext_block), &error)) - { - if (error == NULL) - { - g_dbus_method_invocation_return_error (invocation, - UDISKS_ERROR, - UDISKS_ERROR_FAILED, - "Error removing entry for `%s' from unlocked-luks: Entry not found", - udisks_block_get_device (cleartext_block)); - } - else - { - g_dbus_method_invocation_return_error (invocation, - UDISKS_ERROR, - UDISKS_ERROR_FAILED, - "Error removing entry for `%s' from unlocked-luks: %s (%s, %d)", - udisks_block_get_device (cleartext_block), - error->message, - g_quark_to_string (error->domain), - error->code); - g_error_free (error); - } - udisks_cleanup_unignore_unlocked_luks (cleanup, udisks_block_get_device_number (cleartext_block)); - goto out; - } - udisks_cleanup_unignore_unlocked_luks (cleanup, udisks_block_get_device_number (cleartext_block)); - } - udisks_notice ("Locked LUKS device %s (was unlocked as %s)", udisks_block_get_device (block), udisks_block_get_device (cleartext_block)); |