[Fstab] Show non-empty share name in case root fs is exported
ClosedPublic

Authored by bruns on Sep 27 2018, 3:21 PM.

Details

Summary

The leading slash is stripped to save some space for the human readable
description ("share on server"). In case of an exported root filesystem,
this creates an empty export name, so readd the slash.

BUG: 395562

Test Plan

Create two entries in fstab:
server:/ /mnt/a/ nfs defaults 0 0
server:/b /mnt/b/ nfs defaults 0 0
run e.g. solid-hardware5 list details
result
description = '/ on server'
description = 'b on server'

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.
bruns created this revision.Sep 27 2018, 3:21 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 27 2018, 3:21 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Sep 27 2018, 3:21 PM
bruns edited the summary of this revision. (Show Details)Sep 27 2018, 3:25 PM
bruns added a reviewer: broulik.
broulik added inline comments.Sep 27 2018, 3:28 PM
src/solid/devices/backends/fstab/fstabdevice.cpp
45

This should probably be moved outside this if, you get the same bug when you do `//server/

bruns marked an inline comment as done.Sep 27 2018, 3:35 PM
bruns added inline comments.
src/solid/devices/backends/fstab/fstabdevice.cpp
45

SMB/Cifs share names can never be empty, i.e. you always have //server/<nonempty-string>

broulik accepted this revision.Sep 27 2018, 3:36 PM

Alright, ship it

This revision is now accepted and ready to land.Sep 27 2018, 3:36 PM
This revision was automatically updated to reflect the committed changes.
bruns marked an inline comment as done.