From: Jim Meyering Date: Thu, 23 Nov 2000 15:36:58 +0000 (+0000) Subject: (show_point): Before accepting an entry as a match, make sure that X-Git-Tag: FILEUTILS-4_0_33~51 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9a4e9f426cf332327a6942540f17441486bd97ec;p=thirdparty%2Fcoreutils.git (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). --- diff --git a/src/df.c b/src/df.c index 3979dac539..ad49e4244a 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;