udisks2: Fix missing polkit rule preventing unlock of LUKS2 encrypted disks from GNOME GUI
## Description
udisks2 does not include a polkit rule to allow wheel group users to unlock LUKS2 encrypted disks from GNOME (Nautilus/GNOME Disks).
## Error
`udisks quark 4 - not authorized to perform this operation`
## Steps to reproduce
1. Have a LUKS2 encrypted disk connected
2. Try to unlock it from Nautilus or GNOME Disks
3. Get "not authorized" error
## Affected applications
- Nautilus
- GNOME Disks
- niri (window manager)
- Mango WC
## Fix
Create `/etc/polkit-1/rules.d/50-udisks2.rules` with:
```
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.udisks2.encrypted-unlock" ||
action.id == "org.freedesktop.udisks2.encrypted-unlock-system" ||
action.id == "org.freedesktop.udisks2.encrypted-unlock-other-seat") &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
```
## System info
- cryptsetup 2.8.4
- udisks2 supports luks1 and luks2
5 条评论