goto out;
targets_type = g_udev_device_get_property_as_strv (device->priv->d, "UDISKS_DM_TARGETS_TYPE");
+ /* If we ever need this for other types than "linear", remember to update
+ udisks-dm-export.c as well. */
if (targets_type == NULL || g_strcmp0 (targets_type[0], "linear") != 0)
goto out;
//g_printerr ("targets_type=`%s'\n", targets_type);
//g_printerr ("encoded_targets_params=`%s'\n", encoded_targets_params);
+ /* If we ever need this for other types than "linear", remember to update
+ udisks-dm-export.c as well. */
if (g_strcmp0 (targets_type, "linear") == 0)
{
gint partition_slave_major;
g_string_append (target_types_str, target_type);
g_string_append_printf (start_str, "%" G_GUINT64_FORMAT, start);
g_string_append_printf (length_str, "%" G_GUINT64_FORMAT, length);
- if (params != NULL && strlen (params) > 0)
+ /* Set target_params for known-safe and known-needed target types only. In particular,
+ * we must not export it for "crypto", since that would expose
+ * information about the key. */
+ if (g_strcmp0 (target_type, "linear") == 0 && params != NULL && strlen (params) > 0)
{
_udev_util_encode_string (params, buf, sizeof (buf));
g_string_append (params_str, buf);