View | Details | Raw Unified | Return to bug 807377
Collapse All | Expand All

(-)udisks-2.0.0.orig/src/udiskslinuxdriveobject.c (-3 / +8 lines)
Lines 733-750 Link Here
733
  const gchar *serial;
733
  const gchar *serial;
734
  const gchar *wwn;
734
  const gchar *wwn;
735
  const gchar *path;
735
  const gchar *path;
736
  const gchar *model;
736
737
737
  g_return_val_if_fail (G_UDEV_IS_DEVICE (device), FALSE);
738
  g_return_val_if_fail (G_UDEV_IS_DEVICE (device), FALSE);
738
739
739
  /* order of preference: WWN, serial, path */
740
  /* order of preference: WWN_serial, WWN, serial (!= model), path */
740
  serial = g_udev_device_get_property (device, "ID_SERIAL");
741
  serial = g_udev_device_get_property (device, "ID_SERIAL");
741
  wwn = g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION");
742
  wwn = g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION");
742
  path = g_udev_device_get_property (device, "ID_PATH");
743
  path = g_udev_device_get_property (device, "ID_PATH");
744
  model = g_udev_device_get_property (device, "ID_MODEL");
743
  if (wwn != NULL && strlen (wwn) > 0 && !is_wwn_black_listed (wwn))
745
  if (wwn != NULL && strlen (wwn) > 0 && !is_wwn_black_listed (wwn))
744
    {
746
    {
745
      ret = g_strdup (wwn);
747
      if (serial != NULL && strlen (serial) > 0)
748
         ret = g_strdup_printf ("%s_%s", wwn, path);
749
      else
750
        ret = g_strdup (wwn);
746
    }
751
    }
747
  else if (serial != NULL && strlen (serial) > 0)
752
  else if (serial != NULL && strlen (serial) > 0 && g_strcmp0 (serial, model) != 0)
748
    {
753
    {
749
      ret = g_strdup (serial);
754
      ret = g_strdup (serial);
750
    }
755
    }

Return to bug 807377