diff options
author | Pádraig Brady <P@draigBrady.com> | 2014-05-12 13:29:01 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-05-13 23:23:30 +0100 |
commit | fb902297f536df060ff10ef06bb8fe6cfe0c845e (patch) | |
tree | b7cbc753625065e50bb3965e6010a1b3e45b4054 /tests/df | |
parent | 2dc5d044a88fd64e11e35886e78b54a4a9fc2b23 (diff) | |
download | coreutils-fb902297f536df060ff10ef06bb8fe6cfe0c845e.tar.xz |
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.
Diffstat (limited to 'tests/df')
-rwxr-xr-x | tests/df/df-symlink.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/df/df-symlink.sh b/tests/df/df-symlink.sh index aaed8108b..6d96bd2aa 100755 --- a/tests/df/df-symlink.sh +++ b/tests/df/df-symlink.sh @@ -28,4 +28,11 @@ df --out=source,target "$disk" > exp || skip_ "cannot get info for $disk" df --out=source,target symlink > out || fail=1 compare exp out || fail=1 +# Ensure we output the same values for device nodes and '.' +# This was not the case in coreutil-8.22 on systems +# where the device in the mount list was a symlink itself. +# I.E. '.' => /dev/mapper/fedora-home -> /dev/dm-2 +df --out=source,target '.' > out || fail=1 +compare exp out || fail=1 + Exit $fail |