* grub-core/fs/reiserfs.c (grub_reiserfs_uuid): Reject 0-uuid as

created when no uuid support is compiled into mkfs.reiser.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-01-14 23:36:21 +01:00
parent 76df2068c4
commit 8502fbca04
2 changed files with 20 additions and 11 deletions

View file

@ -1,3 +1,8 @@
2012-01-14 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/reiserfs.c (grub_reiserfs_uuid): Reject 0-uuid as
created when no uuid support is compiled into mkfs.reiser.
2012-01-14 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/hfs.c (macroman_to_utf8): Convert / to :.

View file

@ -1351,21 +1351,25 @@ grub_reiserfs_uuid (grub_device_t device, char **uuid)
grub_dl_ref (my_mod);
*uuid = NULL;
data = grub_reiserfs_mount (disk);
if (data)
{
*uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
grub_be_to_cpu16 (data->superblock.uuid[0]),
grub_be_to_cpu16 (data->superblock.uuid[1]),
grub_be_to_cpu16 (data->superblock.uuid[2]),
grub_be_to_cpu16 (data->superblock.uuid[3]),
grub_be_to_cpu16 (data->superblock.uuid[4]),
grub_be_to_cpu16 (data->superblock.uuid[5]),
grub_be_to_cpu16 (data->superblock.uuid[6]),
grub_be_to_cpu16 (data->superblock.uuid[7]));
unsigned i;
for (i = 0; i < ARRAY_SIZE (data->superblock.uuid); i++)
if (data->superblock.uuid[i])
break;
if (i < ARRAY_SIZE (data->superblock.uuid))
*uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
grub_be_to_cpu16 (data->superblock.uuid[0]),
grub_be_to_cpu16 (data->superblock.uuid[1]),
grub_be_to_cpu16 (data->superblock.uuid[2]),
grub_be_to_cpu16 (data->superblock.uuid[3]),
grub_be_to_cpu16 (data->superblock.uuid[4]),
grub_be_to_cpu16 (data->superblock.uuid[5]),
grub_be_to_cpu16 (data->superblock.uuid[6]),
grub_be_to_cpu16 (data->superblock.uuid[7]));
}
else
*uuid = NULL;
grub_dl_unref (my_mod);