mate-desktop / mate-notification-daemon

Daemon to display passive pop-up notifications
https://mate-desktop.org
GNU General Public License v2.0
30 stars 26 forks source link

Add AssumedAppArmorLabel to dbus service file #201

Closed lucyllewy closed 2 years ago

lucyllewy commented 2 years ago

Snap packages are unable to trigger the notification daemon in a fully confined package, because the snapd apparmor rules state that the target of the dbus call must specify that it is labelled unconfined. See https://forum.snapcraft.io/t/snapd-doesnt-allow-notification-daemon-to-be-activatable/22912/1 for the details.

raveit65 commented 2 years ago

How , can i test that it works? I am using snapd on fedora and i have installed a few application from snapstore.

lucyllewy commented 2 years ago

You need to find a strictly-confined snap that triggers a desktop notification and cause it to do so. The notification daemon needs to be not-running, but loaded, at the time of the triggering to validate that the update works because once the daemon is running I believe apparmor can correctly detect the label.

You also need to ensure that your system is capable of correctly forming the strict confinement, because not all kernels are able to do so - you can check with snap debug confinement which should print strict if strict confinement is supported.

raveit65 commented 2 years ago

You need to find a strictly-confined snap that triggers a desktop notification and cause it to do so.

Which application from snapstore can do that? I don't want to search at the whole snapstore :)

raveit65 commented 2 years ago
[rave@mother ~]$ snap debug confinement
partial

So, i can't test it ?

lucyllewy commented 2 years ago

So, i can't test it ?

You can only test that it doesn't regress with that system. This is because the dbus isn't being mediated by apparmor in partial confinement, so the call will always succeed where on a strict-capable system it will fail.

ricab commented 2 years ago

Which application from snapstore can do that?

The Multipass GUI tries to issue a notification on first startup. When installed as a confined snap, it currently fails to do so on MATE, unless the service is already running. This should hopefully fix that, so you could use Multipass to verify :slightly_smiling_face:

raveit65 commented 2 years ago

Ok, on fedora systems selinux Mandatory Access Control is running and not apparmor, in result i can only test that adding AssumedAppArmorLabel=unconfined doesn't break notification-daemon on systems without apparmor. This needs to be tested from someone who has Ubuntu running, maybe Martin Wimpress? @flexiondotorg

raveit65 commented 2 years ago

@diddledani Can you please update commit message with a meaningful valid description? Update org.freedesktop.mate.Notifications.service.in is what you did, but not what commit does ;)

lucyllewy commented 2 years ago

done :-)

raveit65 commented 2 years ago

@diddledani I suggest to ping Martin at ubuntu-mate at discord for testing. He is one of the owner of MATE at github.

flexiondotorg commented 2 years ago

I confirm this patch fixes the issue. I've used Ubuntu MATE 21.10 (devel) with this patch applied to mate-notification-daemon 1.26.0-0ubuntu2.

raveit65 commented 2 years ago

@flexiondotorg this needs push to 1.26 branch, or not?