]> git.ipfire.org Git - thirdparty/coreutils.git/commit
df: fix handling of symlinks in mount list
authorPádraig Brady <P@draigBrady.com>
Mon, 12 May 2014 12:29:01 +0000 (13:29 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 13 May 2014 22:23:30 +0000 (23:23 +0100)
commitfb902297f536df060ff10ef06bb8fe6cfe0c845e
treeb7cbc753625065e50bb3965e6010a1b3e45b4054
parent2dc5d044a88fd64e11e35886e78b54a4a9fc2b23
df: fix handling of symlinks in mount list

The symlink handling in commit v8.21-172-g33660b4 was incomplete
in the case where there were symlinks in the mount list itself.
For example, in the case where /dev/mapper/fedora-home was in the
mount list and that in turn was a symlink to /dev/dm-2, we have:

  before> df --out=source /dev/mapper/fedora-home
          devtmpfs

  after > df --out=source /dev/mapper/fedora-home
          /dev/mapper/fedora-home

* src/df.c (get_disk): Compare canonicalized device names from
the mount list.  Note we still display the non canonicalized name,
even if longer, as we assume that is the most representative.
* tests/df/df-symlink.sh: This could theoretically fail on some systems
depending on the content of the mount list, but adjust to fail on any
system where symlinks are present in the mount list for the current dir.
src/df.c
tests/df/df-symlink.sh