From: David Zeuthen Date: Tue, 25 Mar 2008 18:19:01 +0000 (-0400) Subject: only tear down crypto cleartext devices set up by ourselves X-Git-Tag: upstream/2.1.2~1048 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49e1babde3bd3e3e744faefecc476c3b01b54d5d;p=platform%2Fupstream%2Fudisks2.git only tear down crypto cleartext devices set up by ourselves --- diff --git a/src/devkit-disks-device.c b/src/devkit-disks-device.c index a046355..18fc646 100644 --- a/src/devkit-disks-device.c +++ b/src/devkit-disks-device.c @@ -4607,15 +4607,18 @@ force_removal (DevkitDisksDevice *device, d->priv->info.crypto_cleartext_slave != NULL && strcmp (d->priv->info.crypto_cleartext_slave, device->priv->object_path) == 0) { - g_warning ("Force crypto teardown device %s (cleartext %s)", - device->priv->info.device_file, - d->priv->info.device_file); + /* Check whether it is set up by us */ + if (d->priv->info.dm_name != NULL && + g_str_has_prefix (d->priv->info.dm_name, "devkit-disks-luks-uuid-")) { - /* TODO: actually check whether it is set up by us */ + g_warning ("Force crypto teardown device %s (cleartext %s)", + device->priv->info.device_file, + d->priv->info.device_file); - /* Gotcha */ - force_crypto_teardown (device, d, callback, user_data); - goto pending; + /* Gotcha */ + force_crypto_teardown (device, d, callback, user_data); + goto pending; + } } } }