Samba: Ensure to differenciate mounts sharing the same source
ClosedPublic

Authored by meven on Apr 1 2020, 8:44 AM.

Details

Summary

getmntent for samba returns fsname of the form "//server/folder" (same as mount)
It is not sufficient to use in udi as device name as it does not differenciate mounts sharing the same source but having different mount points.

BUG: 418906
FIXED-IN: 5.69

Test Plan

With a local cifs mount point:

Before
$ solid-hardware5 list | grep ourfiles
udi = '/org/kde/fstab///meven-synapse/ourfiles'

After
$ solid-hardware5 list | grep ourfiles
udi = '/org/kde/fstab///meven-synapse/ourfiles:/media/samba'

Diff Detail

Repository
R245 Solid
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
meven created this revision.Apr 1 2020, 8:44 AM
Restricted Application added a project: Frameworks. Β· View Herald TranscriptApr 1 2020, 8:44 AM
Restricted Application added a subscriber: kde-frameworks-devel. Β· View Herald Transcript
meven requested review of this revision.Apr 1 2020, 8:44 AM
meven updated this revision to Diff 79023.Apr 1 2020, 8:45 AM

Fix comment

meven updated this revision to Diff 79025.Apr 1 2020, 8:54 AM

Use a char instead of char*

anthonyfieroni added inline comments.
src/solid/devices/backends/fstab/fstabhandling.cpp
127

use QLatin1String

meven updated this revision to Diff 79030.Apr 1 2020, 9:11 AM
meven marked an inline comment as done.

Use QLatin1String

ahmadsamir added inline comments.
src/solid/devices/backends/fstab/fstabhandling.cpp
131

Nitpick: QLatin1Char.

meven updated this revision to Diff 79032.Apr 1 2020, 9:31 AM
meven marked an inline comment as done.

Use QLatin1Char

meven updated this revision to Diff 79035.Apr 1 2020, 9:48 AM

Correct typo in comment

sitter accepted this revision.Apr 1 2020, 10:24 AM

You know, I may have noticed this when working on kinfocenter and then quickly forgotten about it again πŸ˜‚
Good stuff!

This revision is now accepted and ready to land.Apr 1 2020, 10:24 AM
This revision was automatically updated to reflect the committed changes.
bruns added a subscriber: bruns.Apr 1 2020, 4:45 PM

The comment and commit message are lacking required information. One should not have to go to the bug report to actually see why this is needed.

While the summary has the BR reference, the code comment is totally unclear.

meven added a comment.Apr 7 2020, 7:17 AM

The comment and commit message are lacking required information. One should not have to go to the bug report to actually see why this is needed.

How about the commit title "Ensure to differenciate mounts sharing the same source" -> it implies that before this, mounts sharing the same source where not differentiated. That already sounds pretty bad to me...