[1986] 2009-02-09 Felix Zielcke <[email protected]>

Felix Zielcke <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1986
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1986
Author:   fzielcke
Date:     2009-02-09 14:17:19 +0000 (Mon, 09 Feb 2009)

Log Message:
-----------
2009-02-09  Felix Zielcke  <[email protected]>

	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.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/fs/fat.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-02-08 22:11:48 UTC (rev 1985)
+++ trunk/grub2/ChangeLog	2009-02-09 14:17:19 UTC (rev 1986)
@@ -1,3 +1,9 @@
+2009-02-09  Felix Zielcke  <[email protected]>
+
+	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  <[email protected]>
 
 	* fs/tar.c: Replace "fs/cpio.c" with "cpio.c".

Modified: trunk/grub2/fs/fat.c
===================================================================
--- trunk/grub2/fs/fat.c	2009-02-08 22:11:48 UTC (rev 1985)
+++ trunk/grub2/fs/fat.c	2009-02-09 14:17:19 UTC (rev 1986)
@@ -187,6 +187,11 @@
   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));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.