Notifications emitted by a snap with local files or desktop files use wrong namespace

Bug #1802483 reported by Marco Trevisan (Treviño)
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libnotify (Ubuntu)
Fix Released
Medium
Marco Trevisan (Treviño)
Bionic
Fix Released
Medium
Jeremy Bícha
Focal
Fix Released
Medium
Marco Trevisan (Treviño)
Jammy
Fix Released
Medium
Marco Trevisan (Treviño)

Bug Description

As can be tested using this example snap:
 - https://github.com/3v1n0/notify-send-test-snap

Basically the icons are referenced using absolute paths in snap environment, while they should be readapted so that they depend on $SNAP location.

As we do with appindicators and libunity emblems.

----

[ Impact ]

Icons sonuds and desktop files referenced by a snapped app using notifications aren't exposed to the desktop in absolute paths

[ Test case ]

Build the test snap (or install it from the attached files to this bug):
  git clone https://github.com/3v1n0/notify-send-test-snap
  snapcraft prime
  snap try prime

To use the pre-built snap (https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/1802483/comments/7)
  snap install --dangerous notify-send-test-snap_*.snap

Check that icons are shown when launching:
  notify-send-test-snap
  notify-send-test-snap.image-path
  notify-send-test-snap.image-uri

Ensure that desktop entry is correctly sent, monitoring the dbus session:

 In a terminal:
   dbus-monitor --session --monitor "interface='org.freedesktop.Notifications'"

 In the other:
   notify-send-test-snap.desktop-entry
   notify-send-test-snap.desktop-entry-explicit-id
   notify-send-test-snap.desktop-entry-explicit-file-name
   notify-send-test-snap.desktop-entry-explicit-path
   notify-send-test-snap.desktop-entry-explicit-uri
   notify-send-test-snap.desktop-entry-explicit-snapped-uri

The
 `desktop-entry` value sent to dbus should be either:
   - A `notify-send-test-snap_`-prefixed desktop ID
   - A .desktop file path (readable from both inside and outside the snap)
   - A .desktop file uri (readable from both inside and outside the snap)

[ Regression potential ]

Normal applications that are run with a SNAP environment variable set, might use wrong paths for files or desktop file

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Libnotify fix for xenial

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Fix for bionic (and cosmic)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "libnotify_0.7.7-3+snap-support.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson)
Changed in libnotify (Ubuntu Xenial):
importance: Undecided → Medium
Changed in libnotify (Ubuntu Bionic):
importance: Undecided → Medium
Iain Lane (laney)
no longer affects: libnotify (Ubuntu Xenial)
no longer affects: libnotify (Ubuntu Bionic)
Revision history for this message
Sebastien Bacher (seb128) wrote :

The changes got reviews on https://gitlab.gnome.org/GNOME/libnotify/merge_requests/5 and some work is needed so unsubscribing sponsors for now, please subscribe them back once you get the upstream reviewers agreeing

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :
description: updated
description: updated
description: updated
Changed in libnotify (Ubuntu Focal):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Jeremy Bícha (jbicha)
Changed in libnotify (Ubuntu Focal):
status: New → In Progress
importance: Undecided → Medium
Jeremy Bícha (jbicha)
Changed in libnotify (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Marco, or anyone else affected,

Accepted libnotify into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libnotify/0.7.9-3ubuntu5.22.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in libnotify (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (libnotify/0.7.9-3ubuntu5.22.04.1)

All autopkgtests for the newly accepted libnotify (0.7.9-3ubuntu5.22.04.1) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

firewalld/1.1.1-1ubuntu1 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#libnotify

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Marco, or anyone else affected,

Accepted libnotify into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libnotify/0.7.9-1ubuntu3.20.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in libnotify (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (libnotify/0.7.9-1ubuntu3.20.04.2)

All autopkgtests for the newly accepted libnotify (0.7.9-1ubuntu3.20.04.2) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

apparmor/2.13.3-7ubuntu5.1 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#libnotify

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Jeremy Bícha (jbicha)
Changed in libnotify (Ubuntu Bionic):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Jeremy Bicha (jbicha)
Revision history for this message
Robie Basak (racb) wrote :

+libnotify (0.7.7-3ubuntu0.20.04.1) bionic; urgency=medium

Shouldn't this be ...0.18.04.1? The version number used will work, but is confusing.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote (last edit ):

Yeah... A missing fixup on a cherry-pick... Maybe we should re-upload this?
Would that be accepted?

I guess should be changed to 1.18.04.1 or what?

Revision history for this message
Robie Basak (racb) wrote :

Apart from that the Bionic upload looks fine. I note that notification-Handle-snap-applications.patch is added over the SRU for Focal, but that makes sense as that functionality is required for the other patches.

Revision history for this message
Robie Basak (racb) wrote :

Sorry I missed your reply, but to make progress I just tweaked the version string in a new upload that I signed. It's otherwise identical. So I'll just accept that.

Changed in libnotify (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Marco, or anyone else affected,

Accepted libnotify into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libnotify/0.7.7-3ubuntu0.18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

I tested libnotify4 from the proposed pocket (0.7.9-3ubuntu5.22.04.1) on Jammy and confirm that icons are shown on launching

  notify-send-test-snap
  notify-send-test-snap.image-path
  notify-send-test-snap.image-uri

I also confirm that the six notify-send-test-snap.desktop-entry* commands produce either

   - A `notify-send-test-snap_`-prefixed desktop ID
   - A .desktop file path (readable from both inside and outside the snap)
   - A .desktop file uri (readable from both inside and outside the snap)

as in the attachment.

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libnotify - 0.7.9-3ubuntu5.22.04.1

---------------
libnotify (0.7.9-3ubuntu5.22.04.1) jammy; urgency=medium

  * debian: Update references as per ubuntu/jammy branching
  * debian/patches: Exit with an error if showing notification fails
    (LP: #1970647)
  * debian/patches: Handle file paths, uris and desktop-ID's in Snapped apps
    (LP: #1802483)

 -- Marco Trevisan (Treviño) <email address hidden> Wed, 27 Apr 2022 23:23:22 +0200

Changed in libnotify (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for libnotify has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

I tested libnotify4 from the proposed pocket (0.7.7-3ubuntu0.18.04.1) on Bionic and confirm that icons are shown on launching

  notify-send-test-snap
  notify-send-test-snap.image-path
  notify-send-test-snap.image-uri

I also confirm that the six notify-send-test-snap.desktop-entry* commands produce either

   - A `notify-send-test-snap_`-prefixed desktop ID
   - A .desktop file path (readable from both inside and outside the snap)
   - A .desktop file uri (readable from both inside and outside the snap)

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

I tested libnotify4 from the proposed pocket (0.7.9-1ubuntu3.20.04.2) on Focal and confirm that icons are shown on launching

  notify-send-test-snap
  notify-send-test-snap.image-path
  notify-send-test-snap.image-uri

I also confirm that the six notify-send-test-snap.desktop-entry* commands produce either

   - A `notify-send-test-snap_`-prefixed desktop ID
   - A .desktop file path (readable from both inside and outside the snap)
   - A .desktop file uri (readable from both inside and outside the snap)

tags: added: verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libnotify - 0.7.9-1ubuntu3.20.04.2

---------------
libnotify (0.7.9-1ubuntu3.20.04.2) focal; urgency=medium

  * debian: Update references as per ubuntu/focal branching
  * debian/patches: Exit with an error if showing notification fails
    (LP: #1970647)
  * debian/patches: Handle file paths, uris and desktop-ID's in Snapped apps
    (LP: #1802483)

 -- Marco Trevisan (Treviño) <email address hidden> Wed, 27 Apr 2022 23:42:13 +0200

Changed in libnotify (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libnotify - 0.7.7-3ubuntu0.18.04.1

---------------
libnotify (0.7.7-3ubuntu0.18.04.1) bionic; urgency=medium

  * debian: Update references as per ubuntu/bionic branching
  * debian/patches: Handle file paths, uris and desktop-ID's in Snapped apps
    (LP: #1802483)

 -- Marco Trevisan (Treviño) <email address hidden> Wed, 27 Apr 2022 23:38:42 +0200

Changed in libnotify (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.