Currently there are certain things that require a user to be in the wheel group to use them.
I am thinking of mounting and decrypting LUKS SSDs on the PC, or managing systemwide flatpaks.
These two actions: mount & unlock, could be allowed to users in a certain group like this:
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.udisks2.encrypted-unlock-system" || action.id == "org.freedesktop.udisks2.filesystem-mount-system" &&
subject.active == true && subject.local == true &&
subject.isInGroup("diskadmin")) {
return polkit.Result.YES;
}
});
for granting such granular permission, just like with plugdev
or libvirt
groups, a new group per permission would be helpful.
barryascott
(Barry A Scott)
January 22, 2024, 11:16pm
2
I like the idea, and I assume that you would need to have umount?
1 Like
boredsquirrel
(boredsquirrel)
Category updated
June 19, 2024, 1:58pm
5
boredsquirrel
(boredsquirrel)
Tags updated
June 19, 2024, 1:58pm
6
I am currently writing a change proposal to edit the freedesktop Flatpak polkit rule, to allow users in the flatpak
group to do all the actions too.
A rule for the disk unlock things is also planned.
Who wants to join? Write me a PM or on Matrix: boredsquirrel@fedora.im
What did you mean by this exactly?
Agreed ! If anyone is following my “side” project to auto update a luks encrypted external drive, I ran into this a couple of times. So much so, that I literally found a way to avoid the .mount files altogether ( and their complicated to the eye, use of x2 escape characters ) .
I need a refresher on what the groups are , also would the change be for F42 ? too soon for F41 ?
I can also be reached on Matrix : @definitive_linux :matrix.org
I don’t think the flatpak group does what you said it does.
true, my mistake.
>> cat /usr/share/polkit-1/rules.d/org.freedesktop.Flatpak.rules
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.Flatpak.app-install" ||
action.id == "org.freedesktop.Flatpak.runtime-install"||
action.id == "org.freedesktop.Flatpak.app-uninstall" ||
action.id == "org.freedesktop.Flatpak.runtime-uninstall" ||
action.id == "org.freedesktop.Flatpak.…
This is the proposed rule, its under 20 changed characters hahaha. That doesnt mean it is quick… but I plan on F41.
https://fedoraproject.org/wiki/Changes/UnprivilegedSystemFlatpakManagement
Not sure about the name… a better word for “unprivileged” ? “rootless”?
You only have mount and unlock, umount is needed as well.
1 Like
So this?
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.udisks2.encrypted-unlock-system" ||
action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
action.id == "org.freedesktop.udisks2.umount") &&
subject.active == true && subject.local == true && (
subject.isInGroup("diskadmin") || subject.isInGroup("wheel"))) {
return polkit.Result.YES;
}
});
I dont have a way currently to test this, Dolphin doesnt request a password if I use the above rule, I invented the last action lol.
It needs to be tested on Silverblue too, then I create a Change Proposal to get this hopefully into 41 as it is also really small
boredsquirrel:
So this?
I’m not a polkit expert, yet, but it looks reasonable.
So I missed the F41 submission deadline, the change proposals will poorly only land for F42.
The changes are here:
Please add needed disk actions where nonwheel users get a password prompt. And also maybe the name is not suiting well, “rootless” or “wheel-less” or “granular” may be better