summaryrefslogtreecommitdiff
path: root/lib/blkid/devname.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2005-01-05 17:45:32 -0500
committerTheodore Ts'o <tytso@mit.edu>2005-01-05 17:45:32 -0500
commit2e6a9febb48ea0e57d32cacb5e67220443c0e059 (patch)
tree37fb70f32818fe1c552de96fd182f4b2863dd1fa /lib/blkid/devname.c
parent22dcccdd1aa295db6fa2696d63c60902aabbbfff (diff)
downloade2fsprogs-2e6a9febb48ea0e57d32cacb5e67220443c0e059.tar.gz
Adjust blkid library so that it returns vfat in preference to msdos so
that mount will try to use the vfat filesystem. (Addresses Debian bug #287455) Similarly, the blkid library will now return an ext3 type for ext 2/3 filesystems that have the journal capability set. We allow files to be probed by the blkid library, to make it easier to test the library. However, we also added safety checks to avoid saving relative pathnames to blkid.tab, and probe_one() will only check block device files.
Diffstat (limited to 'lib/blkid/devname.c')
-rw-r--r--lib/blkid/devname.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
index 3a00146f..ab1db6f6 100644
--- a/lib/blkid/devname.c
+++ b/lib/blkid/devname.c
@@ -113,7 +113,8 @@ static void probe_one(blkid_cache cache, const char *ptname,
dev->bid_devno == devno)
goto set_pri;
- if (stat(device, &st) == 0 && st.st_rdev == devno) {
+ if (stat(device, &st) == 0 && S_ISBLK(st.st_mode) &&
+ st.st_rdev == devno) {
devname = blkid_strdup(device);
break;
}