Prevent paste in screen locker (alternative approach)

Authored by davidedmundson on Aug 18 2018, 9:26 PM.



KScreenlocker tries to clear the clipboard on load. However, klipper
also (by default) automatically keeps the last relevant item in the
clipboard. Whilst both parts work correctly, Plasma as a whole does not.

This became a problem when we added the reveal password button as it is
a data leak.

Instead of clearing the clipboard this patch replaces it with a real
entry, but with a dummy mime value that is of no value to anyone,
especially a textfield.

BUG: 388049

Test Plan

Reproduced issue
Made this patch
Tried pasting in session
Nothing happned
Logged in
Could paste

Diff Detail

R133 KScreenLocker
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Aug 18 2018, 9:26 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 18 2018, 9:26 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Aug 18 2018, 9:26 PM

I like the other solution better as it doesn't depend on Klipper specific behavior.

But the bug is klipper specific behaviour.
In hindsight the mimetype doesn't actually matter, there's no text/plain so klipper wouldn't save anyway.

The important part is that we have something non-empty, non-useful. That should work in all clipboard managers.

mart added a subscriber: mart.Aug 20 2018, 8:36 AM

i lean for this solution as well ( a garbage value in the clipboard would work even if klipper is not used, or a different similar thing is used as well?)

davidedmundson edited the summary of this revision. (Show Details)

Update comment for clarity, use different mimedata

mart accepted this revision as: mart.Aug 20 2018, 12:04 PM
This revision is now accepted and ready to land.Aug 20 2018, 12:04 PM
This revision was automatically updated to reflect the committed changes.