From: David Zeuthen Date: Fri, 1 Oct 2010 16:02:24 +0000 (-0400) Subject: Also export UDISKS_DM_TARGET_PARAMS for 'multipath' target X-Git-Tag: upstream/2.1.2~589 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e014838956eb2d926ce2db28b48d202e4fae9db7;p=platform%2Fupstream%2Fudisks2.git Also export UDISKS_DM_TARGET_PARAMS for 'multipath' target This is safe - no key material or similar is ever exported cf. CVE-2010-1149. Additionally, this unbreaks multipath support, see http://people.freedesktop.org/~david/multipath-restored.png Signed-off-by: David Zeuthen --- diff --git a/src/device.c b/src/device.c index 3602f0f..91c6cd1 100644 --- a/src/device.c +++ b/src/device.c @@ -3338,7 +3338,8 @@ update_info_partition_on_linux_dmmp (Device *device) 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) + if (targets_type == NULL || !(g_strcmp0 (targets_type[0], "linear") == 0 || + g_strcmp0 (targets_type[0], "multipath") == 0)) goto out; targets_params = g_udev_device_get_property_as_strv (device->priv->d, "UDISKS_DM_TARGETS_PARAMS"); diff --git a/src/probers/udisks-dm-export.c b/src/probers/udisks-dm-export.c index 8fff4f9..86da709 100644 --- a/src/probers/udisks-dm-export.c +++ b/src/probers/udisks-dm-export.c @@ -290,7 +290,9 @@ dm_export (int major, int minor) /* 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) + if ((g_strcmp0 (target_type, "linear") == 0 || + g_strcmp0 (target_type, "multipath") == 0) + && params != NULL && strlen (params) > 0) { _udev_util_encode_string (params, buf, sizeof (buf)); g_string_append (params_str, buf);