summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2010-10-06 16:14:00 -0400
committerDavid Zeuthen <davidz@redhat.com>2010-10-06 16:14:00 -0400
commitb847eb4e2333019464c3f71c8e3970a6a7e61f20 (patch)
treed2ab1f22a32f9d9756bea9d49e652c812e0a6534
parente4665237fde5efed14cacc8a6986c6a9bf00a410 (diff)
Add LUKS:mapping_name option to specify the name of the created DM device
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--stc/stcitem.c9
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)