automountManager: Fix password not re-asked for TCRYPT devices
Since commit https://gitlab.com/cryptsetup/cryptsetup/-/commit/f881092bbc92c79b3217d5e14e96f773f2460035 released in cryptsetup 2.5.0, returns EPERM instead of EINVAL when the TCRYPT header can't be decrypted with the provided password and parameters.
Closes: #7631
Steps to test this:
- Create a VeraCrypt volume in a file
DISK=/tmp/veracrypt.img dd if=/dev/zero of="$DISK" bs=1M count=10 DEV=$(sudo losetup --find --show "$DISK") sudo zuluCrypt-cli -c -t vcrypt -p test -d "$DEV" sudo losetup --detach "$DEV"
- Ensure that udisks2 supports unlocking TCRYPT devices:
sudo touch /etc/udisks2/tcrypt.conf && sudo systemctl restart udisks2
- Ensure that auto-mounting is enabled:
dconf write /org/gnome/desktop/media-handling/automount true
- Attach the VeraCrypt file container:
udisksctl loop-setup --file "$DISK"
- GNOME Shell opens the unlock dialog. Enter an incorrect password and try to unlock.
Edited by segfault3