← Back to team overview

debcrafters-packages team mailing list archive

[Bug 2128350] [NEW] malcontent hides snaps that have command-line arguments

 

Public bug reported:

[ Impact ]

Malcontent is a parental control mechanism implemented in GNOME Shell.
It supports hiding applications from the application menu.

Some desktop snaps like telegram-desktop are no longer visible in GNOME Shell when libmalcontent is installed, even without any filters applied. Which snaps are hidden depends on the numbers of command-line arguments they specify in the Exec line. If it's more than 2, then the snap will be hidden.
For example, telegram-desktop uses:

Exec=/snap/bin/telegram-desktop -- %U

Ubuntu ships a patch in malcontent to allow filtering non-flatpak applications too.
This patch assumed that a desktop snap Exec= line would always follow the format `Exec=env BAMF_DESKTOP_FILE_HINT=foo.desktop /snap/bin/foo arg1 arg2`, so it would interpret the third argument as the absolute binary path.

That was changed in snapd version 2.72 to remove the
BAMF_DESKTOP_FILE_HINT environment variable, so the Exec line now
follows the format `Exec=/snap/bin/foo arg1 arg2`. The third argument is
no longer the binary's absolute path, and things break.

Malcontent needs to be adapted to not assume that the snap binary is
always the third argument.

[ Test Plan ]

1. Install the `telegram-desktop` snap
2. Open the GNOME Shell application launcher
3. Search for Telegram
4. Verify that the Telegram app is listed.

[ Where problems could occur ]

Problems would manifest with applications being incorrectly filtered out
or not filtered out.

The patch should make sure that it is future-proof by not assuming the
position of the binary path in the command-line a-priori.

** Affects: malcontent (Ubuntu)
     Importance: High
     Assignee: Alessandro Astone (aleasto)
         Status: In Progress

** Summary changed:

- malcontent hides all snaps with command-line arguments
+ malcontent hides snaps which have command-line arguments

** Summary changed:

- malcontent hides snaps which have command-line arguments
+ malcontent hides snaps that have command-line arguments

-- 
You received this bug notification because you are a member of
Debcrafters packages, which is subscribed to malcontent in Ubuntu.
https://bugs.launchpad.net/bugs/2128350

Title:
  malcontent hides snaps that have command-line arguments

Status in malcontent package in Ubuntu:
  In Progress

Bug description:
  [ Impact ]

  Malcontent is a parental control mechanism implemented in GNOME Shell.
  It supports hiding applications from the application menu.

  Some desktop snaps like telegram-desktop are no longer visible in GNOME Shell when libmalcontent is installed, even without any filters applied. Which snaps are hidden depends on the numbers of command-line arguments they specify in the Exec line. If it's more than 2, then the snap will be hidden.
  For example, telegram-desktop uses:

  Exec=/snap/bin/telegram-desktop -- %U

  Ubuntu ships a patch in malcontent to allow filtering non-flatpak applications too.
  This patch assumed that a desktop snap Exec= line would always follow the format `Exec=env BAMF_DESKTOP_FILE_HINT=foo.desktop /snap/bin/foo arg1 arg2`, so it would interpret the third argument as the absolute binary path.

  That was changed in snapd version 2.72 to remove the
  BAMF_DESKTOP_FILE_HINT environment variable, so the Exec line now
  follows the format `Exec=/snap/bin/foo arg1 arg2`. The third argument
  is no longer the binary's absolute path, and things break.

  Malcontent needs to be adapted to not assume that the snap binary is
  always the third argument.

  [ Test Plan ]

  1. Install the `telegram-desktop` snap
  2. Open the GNOME Shell application launcher
  3. Search for Telegram
  4. Verify that the Telegram app is listed.

  [ Where problems could occur ]

  Problems would manifest with applications being incorrectly filtered
  out or not filtered out.

  The patch should make sure that it is future-proof by not assuming the
  position of the binary path in the command-line a-priori.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/malcontent/+bug/2128350/+subscriptions



Follow ups