From 26eb5a59fc0e7e1f3e6493c647f8b7071af9b31a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 15 Sep 2010 11:51:09 +0200 Subject: [PATCH] libblkid: don't probe directories Signed-off-by: Karel Zak --- shlibs/blkid/src/probe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c index 200a52c5..9353ecd2 100644 --- a/shlibs/blkid/src/probe.c +++ b/shlibs/blkid/src/probe.c @@ -626,6 +626,9 @@ int blkid_probe_set_device(blkid_probe pr, int fd, if (fstat(fd, &sb)) goto err; + if (!S_ISBLK(sb.st_mode) && !S_ISCHR(sb.st_mode) && !S_ISREG(sb.st_mode)) + goto err; + pr->mode = sb.st_mode; if (S_ISBLK(sb.st_mode) || S_ISCHR(sb.st_mode)) pr->devno = sb.st_rdev; -- 2.39.5