Repository navigation
fix(devices): close the LUKS mapping when locking internal volumes - #1952
Conversation
Lock only stopped removable password drives through GIO, so on an internal disk it unmounted the filesystem and left the dm-crypt mapping open, and refused outright once the filesystem was unmounted. When no stoppable drive exists, Lock now closes the container with UDisks2 Encrypted.Lock, resolving it from the device path (container or open mapping) or the LUKS UUID, and never locks a block without the Encrypted interface. The sidebar also treats an open mapping with an unmounted filesystem as unlocked when GVfs shows no padlock emblem. Fixes lgse#1923
|
Looks good — two optional nits, nothing blocking. The change fixes the cause described in #1923. When there is no stoppable password drive, Lock now resolves the container through UDisks and calls
Nits
|
…tainer Reading Encrypted.CleartextDevice treated every error as a block without the Encrypted interface, so a udisksd restart or call timeout after the unmount surfaced as "Could not identify the drive's block device". Only InvalidArgs, UnknownInterface and UnknownProperty now skip the block; other failures keep their D-Bus message.
…locking Only the Encrypted.Lock call needs to wait indefinitely for the polkit prompt. ResolveDevice and property reads now use the default timeout so a hung udisksd reports an error instead of leaving Lock in flight. Also drop two doc comments that only restated the type names.
ReviewMerged What I checked
Change made in this review (253f1b6)
Local verification (review worktree, private Xvfb/D-Bus via
CI on the new head: all required checks green (QA scenarios job is dispatch-only and skipped as usual). |
|
Thanks for the quick turnaround and the fast fix. Both cases from the issue work as expected on my end. I built
I also ran the |
Description
Locking an encrypted volume on an internal (non-removable) disk left its dm-crypt mapping open. Lock only closed the container by stopping a removable password drive through GIO; internal SATA/NVMe disks have no stoppable drive, so Lock unmounted the filesystem and stopped there, and once the filesystem was unmounted it refused with "This volume has no supported lock operation while unmounted".
Encrypted.Lock. The container is resolved from the volume's device path (the container itself or its open cleartext mapping) and falls back to the LUKS UUID. Only a block carrying theEncryptedinterface is ever locked, and an already closed container is left alone.Drive::stoppath.Visual evidence
N/A. The change is in how Lock closes the volume; the dialogs and sidebar controls are unchanged.
How to test
lsblk: the partition has nocrypt(luks-<uuid>) child.umountorudisksctl unmount -b /dev/mapper/luks-<uuid>), then choose Lock in Strata.lsblkagain.cd'd into the mounted volume, choose Lock.Expected result: Steps 2 and 4 show no
cryptchild and no error dialog appears. In step 5 the busy error is shown and the mapping stays open. The removable stick locks as before.Related issue
Closes #1923