diff options
author | Karel Zak | 2010-01-20 23:51:13 +0100 |
---|---|---|
committer | Karel Zak | 2010-01-21 00:20:19 +0100 |
commit | cc62a975a21629d66557ee18ea9f4354b73e9e7f (patch) | |
tree | 7b1658f357fcbd89bb2694b0f1dfc7422b0eb2e7 /shlibs | |
parent | libblkid: add sanity checks for FAT to DOS PT parser (diff) | |
download | kernel-qcow2-util-linux-cc62a975a21629d66557ee18ea9f4354b73e9e7f.tar.gz kernel-qcow2-util-linux-cc62a975a21629d66557ee18ea9f4354b73e9e7f.tar.xz kernel-qcow2-util-linux-cc62a975a21629d66557ee18ea9f4354b73e9e7f.zip |
libblkid: don't probe for GPT and Unixware PT on floppies
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs')
-rw-r--r-- | shlibs/blkid/src/partitions/gpt.c | 1 | ||||
-rw-r--r-- | shlibs/blkid/src/partitions/partitions.c | 3 | ||||
-rw-r--r-- | shlibs/blkid/src/partitions/unixware.c | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/shlibs/blkid/src/partitions/gpt.c b/shlibs/blkid/src/partitions/gpt.c index 2ec3f7397..2c3a3267f 100644 --- a/shlibs/blkid/src/partitions/gpt.c +++ b/shlibs/blkid/src/partitions/gpt.c @@ -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 diff --git a/shlibs/blkid/src/partitions/partitions.c b/shlibs/blkid/src/partitions/partitions.c index 82861a5b3..154365d79 100644 --- a/shlibs/blkid/src/partitions/partitions.c +++ b/shlibs/blkid/src/partitions/partitions.c @@ -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 */ diff --git a/shlibs/blkid/src/partitions/unixware.c b/shlibs/blkid/src/partitions/unixware.c index 70b6626f3..62dba7647 100644 --- a/shlibs/blkid/src/partitions/unixware.c +++ b/shlibs/blkid/src/partitions/unixware.c @@ -173,6 +173,7 @@ const struct blkid_idinfo unixware_pt_idinfo = { .name = "unixware", .probefunc = probe_unixware_pt, + .minsz = 1024 * 1440 + 1, /* ignore floppies */ .magics = { { |