Bug 488235 - Authentication is unnecessarily/pointlessly required to mount LUKS drive Plasma Desktop
Summary: Authentication is unnecessarily/pointlessly required to mount LUKS drive Plas...
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.0.5
Platform: NixOS Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-09 02:40 UTC by m1vri31c
Modified: 2025-08-14 07:43 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Authentication Pop-up (90.42 KB, image/png)
2024-06-09 02:40 UTC, m1vri31c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m1vri31c 2024-06-09 02:40:40 UTC
Created attachment 170283 [details]
Authentication Pop-up

SUMMARY
Whenever a luks encrypted drive is plugged in – the ones I've tested have been btrfs – the window pops up to enter your password, the drive is mounted, and then a second window pops up asking for authentication. I always just press cancel because it's already mounted. 

STEPS TO REPRODUCE
1. Format external drive with btrfs and luks
2. Make sure auto-mount settings in Plasma are set to auto-mount that drive
3. Unmount the drive then plug it in

OBSERVED RESULT
Window opens to enter password, the drive is mounted. Then another window pops up asking for authentication to mount the drive – SCREENSHOT ATTACHED.
Whether this is registered as mounted is inconsistent – sometimes it will appear unmounted in the Disks and Devices system tray widget, sometimes it will appear mounted, and Dolphin is similarly inconsistent. Sometimes you will need to click the device in dolphin to "mount" it and no authentication is required. But the drive is mounted and files can be accessed.

EXPECTED RESULT
Window opens to enter password, then drive is mounted, like mounting the drive manually.

SOFTWARE/OS VERSIONS
NixOS 24.11 (unstable channel)
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0 
Qt Version: 6.7.1

ADDITIONAL INFORMATION
Has happened since I started using Plasma 5 on Debian 12 earlier this year (now am using NixOS and still having the issue).
Comment 1 Nate Graham 2024-06-10 18:05:37 UTC
Cannot reproduce on Fedora 40. Perhaps Polkit rules differ between distros here?

Regardless, the fact that the authentication dialog is pointless because the disk was already mounted is probably a bug in our code.
Comment 2 m1vri31c 2024-06-11 10:06:51 UTC
Some more info:

I wondered if it was a problem with my configuration since I was using the same Home folder on Debian and NixOS, so I made a new user, and that user had the same issue. However, that user was unable to manually mount the drive (not an issue I've seen before), even though auto-mount behavior (asking for authentication despite drive being mounted) was the same. When mounting manually, I was able to enter the encryption password, but the drive did not display as mounted in Disks and Devices, and clicking on the drive in Dolphin did not prompt for the password (presumably because I had just entered it when mounting from Disks and Devices), but I could not access the drive.

I format my drives using KDE Partition Manager.
Comment 3 Nate Graham 2025-04-05 22:23:40 UTC
Is this still happening in Plasma 6.3's X11 session?
Comment 4 m1vri31c 2025-04-07 02:47:24 UTC
(In reply to Nate Graham from comment #3)
> Is this still happening in Plasma 6.3's X11 session?

Yes. X11 & Wayland sessions, tested Plasma Version 6.3.4
Comment 5 Nate Graham 2025-08-13 22:23:58 UTC
Any changes in Plasma 6.4?
Comment 6 m1vri31c 2025-08-14 07:43:51 UTC
(In reply to Nate Graham from comment #5)
> Any changes in Plasma 6.4?

Haven't tested X11, but no changes in Wayland in 6.4. Currently running 6.4.4.

More info: 

• In the Device Auto-Mount settings I tried selecting the encrypted device but not the option with my filesystem label (e.g. for one of my encrypted external drives, "4.5TiB Encrypted Drive" but not "Red Hard Drive"). Plasma asked for my encryption password as usual but did not ask for that additional authentication (even though this authentication request usually seems to be to mount the LUKS device rather than filesystem); however, udisks hung, and I had to force restart my computer (I have encountered MANY unrecoverable udisks errors mounting/umounting those encrypted BTRFS drives with and without Plasma involved, usually after I disconnect a drive without ejecting and then trying to use it again, so not necessarily a Plasma issue, although weirdly it does sometimes corrupt my KWallet).

• I have tried resetting automount and plasma wallet configuration and the issue still happens

• More cases tested: I reformatted my removable drives to ZFS on LUKS, and and while Plasma/udisks do not support mounting/unmounting ZFS, I use the Plasma wallet to unlock the LUKS component, and it still asks for authentication. These drives also differ from the BTRFS drives I tested so far in that, 1) LUKS encryption was set up through cryptsetup rather than KDE Partition manager, and, 2) In some cases I used LUKS encryption on the device itself with no partition map.