diff options
-rw-r--r-- | stc/stcitem.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/stc/stcitem.c b/stc/stcitem.c index fe18bee..2735e8b 100644 --- a/stc/stcitem.c +++ b/stc/stcitem.c @@ -1707,12 +1707,14 @@ _stc_item_start_luks (StcItem *item, gboolean ret; gchar *command_line; gchar *q_device; + gchar *name; gchar *q_name; gchar *passphrase; ret = FALSE; command_line = NULL; q_device = NULL; + name = NULL; q_name = NULL; passphrase = NULL; @@ -1738,9 +1740,11 @@ _stc_item_start_luks (StcItem *item, } q_device = g_shell_quote (g_udev_device_get_device_file (device_with_crypto)); - /* TODO: give an option to specify the mapping name */ - q_name = g_strdup_printf ("stc-luks-uuid-%s", + name = g_strdup (g_hash_table_lookup (item->options, "LUKS:mapping_name")); + if (name == NULL) + name = g_strdup_printf ("stc-luks-uuid-%s", g_udev_device_get_property (device_with_crypto, "ID_FS_UUID")); + q_name = g_shell_quote (name); command_line = g_strdup_printf ("cryptsetup luksOpen %s %s", q_device, q_name); @@ -1781,6 +1785,7 @@ _stc_item_start_luks (StcItem *item, g_free (passphrase); } g_free (command_line); + g_free (name); g_free (q_name); g_free (q_device); if (device_with_crypto != NULL) |