aboutsummaryrefslogtreecommitdiff
path: root/util-linux/volume_id
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-06-27 21:58:25 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-06-27 21:58:25 +0200
commit4fc5ec56f912b858ee7d64a2af2cbd24f2111b34 (patch)
treeb49471d11cfa78b881afabf5f33cadcfaa5b717a /util-linux/volume_id
parenteb1cda2f2d6236baf36986d2da07cc564617fa88 (diff)
downloadbusybox-4fc5ec56f912b858ee7d64a2af2cbd24f2111b34.tar.gz
device matching against UUIDs: do not try floppies
function old new delta uuidcache_check_device 255 292 +37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/volume_id')
-rw-r--r--util-linux/volume_id/get_devname.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c
index ac69f78c4..181b6db7e 100644
--- a/util-linux/volume_id/get_devname.c
+++ b/util-linux/volume_id/get_devname.c
@@ -86,9 +86,16 @@ uuidcache_check_device(const char *device,
char *label = label;
int fd;
+ /* note: this check rejects links to devices, among other nodes */
if (!S_ISBLK(statbuf->st_mode))
return TRUE;
+ /* Users report that mucking with floppies (especially non-present
+ * ones) is significant PITA. This is a horribly dirty hack,
+ * but it is very useful in real world. */
+ if (major(statbuf->st_rdev) == 2)
+ return TRUE;
+
fd = open(device, O_RDONLY);
if (fd < 0)
return TRUE;