Bug 467098

Summary: With LUKS-encrypted disk's password saved in KWallet, mounting the disk shows a password dialog with the password already pre-populated in the password field, instead of just decrypting it without asking for interaction
Product: [Plasma] plasmashell Reporter: Henning <boredsquirrel>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: ASSIGNED ---    
Severity: normal CC: kde, kdelibs-bugs, lukas, nate, postix, putr4.s
Priority: NOR    
Version: 5.27.3   
Target Milestone: 1.0   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Henning 2023-03-09 09:31:18 UTC
SUMMARY
KDE allows storing LUKS passwords in Kwallet. Its the users wallet with the users password. But when trying to mount a LUKS drive, you need sudo permissions, which makes no sense.


STEPS TO REPRODUCE
1. Attach a USB LUKS drive
2. Enter the password, let it store in KWallet
3. unmount the LUKS drive, mount again

OBSERVED RESULT
You need to press "Enter" to confirm the password, and you need the sudo password.

EXPECTED RESULT
Password prompt opens where you have to only press enter. This should be removed and used only when the password is wrong. Also you need the sudo password to mount the drive.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 37 (Kinoite, OSTree)
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.14-200.fc37.x86_64 (64-bit)

PROPOSED SOLUTION

add something like that:

bash
echo "$USER ALL=(ALL) NOPASSWD: /usr/bin/mount" | sudo tee -a /etc/sudoers.d/mount

ADDITION
This is not a duplicate of https://bugs.kde.org/show_bug.cgi?id=395300
This may be a solution for https://bugs.kde.org/show_bug.cgi?id=466731
Comment 1 Henning 2023-03-09 09:31:55 UTC
Comment: Linux Mint seems to have that rule, LUKS drives mount fully automatic
Comment 2 Nate Graham 2023-03-13 18:46:50 UTC
In step 2, you're entering the password of the LUKS disk and not your sudo/root password, right?

After step 3, are you saying that you see a dialog window asking you to enter the password for the LUKS disk, and the password is already filled in, but you have ti press the enter key to make it go away?

At what point did you have to enter the sudo/root password?
Comment 3 Henning 2023-03-14 11:49:36 UTC
Step 1: click on the drive / automount
step 2: the LUKS password is already inserted as its saved in KWallt
step 3: I need to enter the sudo password to use udisks and mount it
Comment 4 Henning 2023-03-14 11:51:34 UTC
The LUKS password entry still requires me to press enter, which is kinda useless (should only show up if password was wrong).

after this unneeded dialog comes the sudo dialog, where I have to normally enter the sudo password. This is needed because user cant use udisk it seems
Comment 5 Nate Graham 2023-03-14 15:16:33 UTC
It's possible to suppress the sudo dialog if the distro sets up PolKit to not require authentication for that action. Let's focus on the "popup with password already in it" issue. I can reproduce that issue.
Comment 6 Nate Graham 2023-03-14 15:37:36 UTC
Code in question lives in plasma-workspace/soliduiserver.cpp; moving to Plasma. I'll look into fixing it.
Comment 7 Bug Janitor Service 2023-03-14 19:35:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2745
Comment 8 Henning 2023-03-17 20:32:09 UTC
Thank you!

I dont know how often I wrote with you about some Plasma issues Nate Graham. Thanks a lot for your work! I will see that I can donate, and I will also try to get to know Plasma better and contribute what I can.
Comment 9 Nate Graham 2023-03-27 18:45:32 UTC
Well don't thank me yet; my change isn't merged yet and in fact it doesn't even work properly. :) It needs some more work to get it in a state where we can consider merging it. But thank you for the kind words, and especially any donation! Donations really help.