]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-02-09 Felix Zielcke <fzielcke@z-51.de>
authorfzielcke <fzielcke@localhost>
Mon, 9 Feb 2009 14:17:19 +0000 (14:17 +0000)
committerfzielcke <fzielcke@localhost>
Mon, 9 Feb 2009 14:17:19 +0000 (14:17 +0000)
fs/fat.c (grub_fat_mount): Try to avoid false positives by checking
bpb.version_specific.fat12_or_fat16.fstype and
bpb.version_specific.fat32.fstype.

ChangeLog
fs/fat.c

index 440f2cebcadfc8789d4c5e8cff05da24c7af86e6..9dd5df2199f9b550a987317d93cc917d07df0de0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-09  Felix Zielcke  <fzielcke@z-51.de>
+
+       fs/fat.c (grub_fat_mount): Try to avoid false positives by checking
+       bpb.version_specific.fat12_or_fat16.fstype and
+       bpb.version_specific.fat32.fstype.
+
 2009-02-08  Robert Millan  <rmh@aybabtu.com>
 
        * fs/tar.c: Replace "fs/cpio.c" with "cpio.c".
index d62adbc27999d2708a992d4978f3cf5e803b991f..6b39ef0f673c52455fd360a44e7e06387743aa9b 100644 (file)
--- a/fs/fat.c
+++ b/fs/fat.c
@@ -187,6 +187,11 @@ grub_fat_mount (grub_disk_t disk)
   if (grub_disk_read (disk, 0, 0, sizeof (bpb), (char *) &bpb))
     goto fail;
 
+  if (! grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT12",5)
+      || ! grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT16",5)
+      || ! grub_strncmp((const char *) bpb.version_specific.fat32.fstype, "FAT32",5))
+    goto fail;
+  
   /* Get the sizes of logical sectors and clusters.  */
   data->logical_sector_bits =
     fat_log2 (grub_le_to_cpu16 (bpb.bytes_per_sector));