summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device.c2
-rw-r--r--src/probers/part-id.c2
-rw-r--r--src/probers/udisks-dm-export.c5
3 files changed, 8 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index bac971d..12cab7c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3336,6 +3336,8 @@ update_info_partition_on_linux_dmmp (Device *device)
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;
diff --git a/src/probers/part-id.c b/src/probers/part-id.c
index b61ea07..306eb44 100644
--- a/src/probers/part-id.c
+++ b/src/probers/part-id.c
@@ -246,6 +246,8 @@ get_part_table_device_file (struct udev_device *given_device,
//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;
diff --git a/src/probers/udisks-dm-export.c b/src/probers/udisks-dm-export.c
index b950c32..8fff4f9 100644
--- a/src/probers/udisks-dm-export.c
+++ b/src/probers/udisks-dm-export.c
@@ -287,7 +287,10 @@ dm_export (int major, int minor)
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);