summaryrefslogtreecommitdiff
path: root/src/df.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-11-23 15:36:58 +0000
committerJim Meyering <jim@meyering.net>2000-11-23 15:36:58 +0000
commit9a4e9f426cf332327a6942540f17441486bd97ec (patch)
tree0f01eb2f8353a893681a5922f6b034b409ea13d3 /src/df.c
parent4e07d471cc982c915394608e98d3189bbc477169 (diff)
downloadcoreutils-9a4e9f426cf332327a6942540f17441486bd97ec.tar.gz
coreutils-9a4e9f426cf332327a6942540f17441486bd97ec.tar.bz2
coreutils-9a4e9f426cf332327a6942540f17441486bd97ec.zip
(show_point): Before accepting an entry as a match, make sure that
the mount directory exists and has the required device number. Before, e.g., `df /floppy' would mistakenly report on the root partition if /floppy were not listed in /etc/mtab but / was. Patch from Eirik Fuller (http://bugs.debian.org/76923).
Diffstat (limited to 'src/df.c')
-rw-r--r--src/df.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/df.c b/src/df.c
index 3979dac53..ad49e4244 100644
--- a/src/df.c
+++ b/src/df.c
@@ -612,7 +612,9 @@ show_point (const char *point, const struct stat *statp)
}
}
- if (best_match && !STREQ (best_match->me_type, "lofs"))
+ if (best_match && !STREQ (best_match->me_type, "lofs")
+ && stat (best_match->me_mountdir, &disk_stats) == 0
+ && disk_stats.st_dev == statp->st_dev)
{
me = best_match;
goto show_me;