Ensure mounted nfs filesystems matches their fstab declared counterpart
Summary:
When a nfs fs is declared in /etc/fstab and the filesystem path ends with a / (like 192.168.1.16:/home/meven/ ), once mounted the detected filesystem path does not have the slash.
This causes the mounted drive not to match the umounted filesystem, causing the later bug.
I.e :
$ solid-hardware list
[...]
udi = '/org/kde/fstab/192.168.1.16:/home/meven/' (fstab declared mount)
udi = '/org/kde/fstab/192.168.1.16:/home/meven' (mounted drive as returned by getmntent)
The patch makes the logic in Solid::Backends::Fstab::FstabHandling::deviceList matching mounted and unmounted filesytems unsensitive to their path ending with /
BUG: 406242
CCBUG: 390691
FIXED-IN: 5.66
Test Plan:
Locally tested with Linux with a nfs drive set up with a path ending with a slash like
192.168.1.16:/home/meven/ /media/NFS nfs defaults,user,auto,noatime,bg 0 0
After patch
$ solid-hardware list
[...]
udi = '/org/kde/fstab/192.168.1.16:/home/meven' (mounted drive as returned by getmntent)
Only one icon appears for the drive in places panel in Dolphin.
Not tested with getmntinfo / BSD code path, but the patch does not alter the code behavior much and don't foresee any risk there.
Reviewers: bruns, Frameworks, ngraham
Reviewed By: bruns, ngraham
Subscribers: broulik, dhaumann, anthonyfieroni, ngraham, bruns, apol, kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D21204