summaryrefslogtreecommitdiff
path: root/shlibs
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2010-09-15 11:51:09 +0200
committerKarel Zak <kzak@redhat.com>2010-09-15 11:51:09 +0200
commit26eb5a59fc0e7e1f3e6493c647f8b7071af9b31a (patch)
tree9bbf4103af638c2cd74ad92f7340af060a00af2e /shlibs
parent7c97f7402e77b2d42c4ddfd9516c848a8022f099 (diff)
downloadutil-linux-old-26eb5a59fc0e7e1f3e6493c647f8b7071af9b31a.tar.gz
libblkid: don't probe directories
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs')
-rw-r--r--shlibs/blkid/src/probe.c3
1 files changed, 3 insertions, 0 deletions
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;