chiark / gitweb /
[PATCH] udev_volume_id: volume_id v38
[elogind.git] / extras / volume_id / volume_id / util.c
index 6159a5992800edcf9415555eb8f9e0391b79c1e2..6ae4d09927a8b8e485692b6b9f6f5f4bd68789f5 100644 (file)
@@ -138,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++)
@@ -172,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;
        }
 }