chiark / gitweb /
[PATCH] udev_volume_id: volume_id v38
[elogind.git] / extras / volume_id / volume_id / util.c
index 0cd2eadec1313ee00bf7a80907759bca7ab77d43..6ae4d09927a8b8e485692b6b9f6f5f4bd68789f5 100644 (file)
@@ -53,6 +53,8 @@ static char *usage_to_string(enum volume_id_usage usage_id)
                return "raid";
        case VOLUME_ID_DISKLABEL:
                return "disklabel";
+       case VOLUME_ID_CRYPTO:
+               return "crypto";
        case VOLUME_ID_UNPROBED:
                return "unprobed";
        case VOLUME_ID_UNUSED:
@@ -136,8 +138,13 @@ void volume_id_set_uuid(struct volume_id *id, const __u8 *buf, enum uuid_format
                break;
        case UUID_DCE:
                count = 16;
+               break;
+       case UUID_DCE_STRING:
+               count = 36;
+               break;
        }
        memcpy(id->uuid_raw, buf, count);
+       id->uuid_raw_len = count;
 
        /* if set, create string in the same format, the native platform uses */
        for (i = 0; i < count; i++)
@@ -170,6 +177,10 @@ set:
                        buf[8], buf[9],
                        buf[10], buf[11], buf[12], buf[13], buf[14],buf[15]);
                break;
+       case UUID_DCE_STRING:
+               memcpy(id->uuid, buf, count);
+               id->uuid[count] = '\0';
+               break;
        }
 }