* grub-core/fs/bfs.c (mount): Improve filesystem detection reliability.
* grub-core/fs/ext2.c (grub_ext2_mount): Likewise. * grub-core/fs/hfs.c (grub_hfs_mount): Likewise. * grub-core/fs/hfsplus.c (grub_hfsplus_mount): Likewise. * grub-core/fs/jfs.c (grub_jfs_mount): Likewise. * grub-core/fs/minix.c (grub_minix_mount): Likewise. * grub-core/fs/ntfs.c (grub_ntfs_mount): Likewise. * grub-core/fs/romfs.c (grub_romfs_mount): Likewise. * grub-core/fs/xfs.c (grub_xfs_mount): Likewise.
This commit is contained in:
parent
fe8c2f1117
commit
2e57f28fc7
10 changed files with 63 additions and 18 deletions
|
@ -439,18 +439,21 @@ grub_hfsplus_mount (grub_disk_t disk)
|
|||
/* Make sure this is an HFS+ filesystem. XXX: Do we really support
|
||||
HFX? */
|
||||
magic = grub_be_to_cpu16 (volheader.hfsplus.magic);
|
||||
if ((magic != GRUB_HFSPLUS_MAGIC) && (magic != GRUB_HFSPLUSX_MAGIC))
|
||||
if (((magic != GRUB_HFSPLUS_MAGIC) && (magic != GRUB_HFSPLUSX_MAGIC))
|
||||
|| volheader.hfsplus.blksize == 0
|
||||
|| ((volheader.hfsplus.blksize & (volheader.hfsplus.blksize - 1)) != 0)
|
||||
|| grub_be_to_cpu32 (volheader.hfsplus.blksize) < GRUB_DISK_SECTOR_SIZE)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
grub_memcpy (&data->volheader, &volheader.hfsplus,
|
||||
sizeof (volheader.hfsplus));
|
||||
sizeof (volheader.hfsplus));
|
||||
|
||||
if (grub_fshelp_log2blksize (grub_be_to_cpu32 (data->volheader.blksize),
|
||||
&data->log2blksize))
|
||||
goto fail;
|
||||
for (data->log2blksize = 0;
|
||||
(1U << data->log2blksize) < grub_be_to_cpu32 (data->volheader.blksize);
|
||||
data->log2blksize++);
|
||||
|
||||
/* Make a new node for the catalog tree. */
|
||||
data->catalog_tree.file.data = data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue