Use XDG_DATA_HOME and security fix
ClosedPublic

Authored by cryptodude on Oct 25 2017, 12:02 PM.

Details

Summary

The EncFS has security issues when the encrypted files are shared
in the open. For instance on a usb-pendrive or a shared drive.

Only when the user picks EncFS we then continue to not allow the user to pick his 'device' directory where the encrypted files would go, just store this on the XDG_DATA_HOME which is defined as;
the base directory relative to which user specific data files should be stored

Users can continue picking their datadir just fine when they pick the CryFS and other future backends.

BUG:385982

Diff Detail

Repository
R845 Plasma Vault
Lint
Lint Skipped
Unit
Unit Tests Skipped
cryptodude created this revision.Oct 25 2017, 12:02 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 25 2017, 12:02 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ivan added a comment.Oct 25 2017, 7:50 PM

This one is almost mergeable.

I'm not sure the users will like what you did with encfs, but we can at least test the waters. :)

kded/ui/directorypairchooserwidget.cpp
90 ↗(On Diff #21303)

What do you think about having it disabled instead of hidden?

(I'm expecting bug reports "no information about the data location" if it just gets hidden - if it is just disabled, at least people will know where it is)

123 ↗(On Diff #21303)

Replace this with http://doc.qt.io/qt-5/qstandardpaths.html (I think you need QStandardPaths::AppLocalDataLocation)

I'm not sure the users will like what you did with encfs, but we can at least test the waters. :)

Sounds good.

I know for every feature you take away from users they will be a user that will complain about it. No doubt. I hope we can stand by the position that a wizard that allows a user to set up a vault that is easy to spoof or break is a broken wizard. Not a missing feature.

kded/ui/directorypairchooserwidget.cpp
90 ↗(On Diff #21303)

I didn't consider it an issue as its just data that they would never ever interact with. People never cared where their post-it notes etc are stored.

Making it disabled will more likely be the cause of people not being able to figure out why its disabled. And they start to look for a way to enable it. Causing more confusion.

How does replacing it with a text label sound?

123 ↗(On Diff #21303)

No, the Qt one includes the appname. So I'd get;

~/.local/share/kded5/

Are the Windows/Mac platforms relevant at all? If not, I'd just like to keep it the way it is.

ivan added inline comments.Oct 25 2017, 8:48 PM
kded/ui/directorypairchooserwidget.cpp
90 ↗(On Diff #21303)

Fair enough. Leave it hidden, and if we get complaints, we can change it later.

123 ↗(On Diff #21303)

Can you try QStandardPaths::GenericDataLocation and append "/plasma-vault"? (if we are changing the path, let's use the full name of product just in case other DE people decide to call something of theirs 'vault')

QStandardPaths::GenericDataLocation
Returns a directory location where persistent data shared across applications can be
stored. This is a generic value. The returned path is never empty.

Windows and Mac are not relevant at the moment, but I'd still like it more if we relied on Qt implementation instead of simulating what QSP does.

Updated to use QStandardPaths

Updated to use QStandardPaths

Hmm,

I forgot to test if the XDG_DATA_DIR actually is honoured by the QStandardDirs, and a quick test shows that it doesn't. I'll have to find out what the rest of KDE uses, as the usage of ~/.local/share is an upgrade, but I expected more.

cryptodude retitled this revision from Use XDG_DATA_DIR and security fix to Use XDG_DATA_HOME and security fix.
cryptodude edited the summary of this revision. (Show Details)

Updated git and task comments to use XDG_DATA_HOME.

ivan accepted this revision.Oct 29 2017, 8:20 AM
This revision is now accepted and ready to land.Oct 29 2017, 8:20 AM
This revision was automatically updated to reflect the committed changes.