]> err.no Git - util-linux/commitdiff
libblkid: don't probe for GPT and Unixware PT on floppies
authorKarel Zak <kzak@redhat.com>
Wed, 20 Jan 2010 22:51:13 +0000 (23:51 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Jan 2010 23:20:19 +0000 (00:20 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/partitions/gpt.c
shlibs/blkid/src/partitions/partitions.c
shlibs/blkid/src/partitions/unixware.c

index 2ec3f7397917f1b59ae1aa88ca421510e6d06a32..2c3a3267fd1f4f75eda986d7368e00c5753c1034 100644 (file)
@@ -368,6 +368,7 @@ const struct blkid_idinfo gpt_pt_idinfo =
 {
        .name           = "gpt",
        .probefunc      = probe_gpt_pt,
+       .minsz          = 1024 * 1440 + 1,      /* ignore floppies */
 
        /*
         * It would be possible to check for DOS signature (0xAA55), but
index 82861a5b362d7574cc3bc375d11b1e54e37e1195..154365d79d63829674fab720f83112ef9f055a1f 100644 (file)
@@ -505,6 +505,9 @@ static int idinfo_probe(blkid_probe pr, const struct blkid_idinfo *id)
        int hasmag = 0;
        int rc = 1;             /* = nothing detected */
 
+       if (id->minsz && id->minsz > pr->size)
+               goto nothing;   /* the device is too small */
+
        mag = id->magics ? &id->magics[0] : NULL;
 
        /* try to detect by magic string */
index 70b6626f35ebbc2f751b862c390e7ab5382491aa..62dba76479a6142a7d74b4f3a0d75a4f1501b491 100644 (file)
@@ -173,6 +173,7 @@ const struct blkid_idinfo unixware_pt_idinfo =
 {
        .name           = "unixware",
        .probefunc      = probe_unixware_pt,
+       .minsz          = 1024 * 1440 + 1,              /* ignore floppies */
        .magics         =
        {
                {