Udisks2 interface: Extend permissions

Hi,

we are using udisks2 to handle different use cases with external medias (sd card, usb …). One of it is “formating” an existing partition. To perform this action, udisks2 requires access to the dbus interface “org.freedesktop.login1.Manager” and the member “Inhibit”.

Can we extend the udisks2 interface regarding this topic?

dbus (send,receive)
    bus=system
    path=/org/freedesktop/login1
    interface=org.freedesktop.login1.Manager
    member={Inhibit}
    peer=(label=unconfined),

Thanks.

Is receive necessary here? I assume this is udisks2 wanting to ask the login manager to inhibit suspend etc - so it should only be send then - is that correct?

I will check that. Thanks for the hint.

You are right. While digging in the code of udisks, I found also a subscribe to “PrepareToSleep” (github). Maybe it makes sense to add them both:

dbus (send)
    bus=system
    path=/org/freedesktop/login1
    member=Inhibit
    interface=org.freedesktop.login1.Manager,
dbus (receive)
    bus=system
    path=/org/freedesktop/login1
    member=PrepareForSleep
    interface=org.freedesktop.login1.Manager
    peer=(label=unconfined),

Yes I think that would be a good idea. I’ll prepare a PR for snapd to update this interface.

FYI - I have submitted the following PR for snapd to cover this https://github.com/snapcore/snapd/pull/10226

1 Like