Allow a confined app to read its own .desktop file

Bug #1437393 reported by Alberto Mardegan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apparmor-easyprof-ubuntu (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

The use-case is webapps: in the webapp container we are implementing a splash screen to be shown at certain times during the webapp execution, which contains among other things the application icon and name.
While we could ask the webapp developer to explicitly specify the application name and icon in the webapp manifest, this seems like unnecessary work. On the other hand, reading the .desktop file from the installed package dir is not trivial: the file could be in a subdirectory, it could have any name, and we risk picking up the wrong file in case there are more apps in the same package.

AFAICT, the only reliable way to get the desktop file is to check the APP_ID environment variable and read ~/.local/share/applications/$APP_ID.desktop

Alberto Mardegan (mardy)
description: updated
Revision history for this message
Ted Gould (ted) wrote :

I disagree, that file is a temporary file for legacy reasons. It doesn't work that well and causes many problems, continuing to use it will see the continuance of those issues that we could otherwise forgo.

I think it would be simple enough for the webapp to provide a relative path to its installation directory for the desktop file. For instance its Exec line could be as follows:

Exec=webapp-container --desktop-file=data/my-desktop-file.desktop http://foo.com

Revision history for this message
Alberto Mardegan (mardy) wrote :

When .desktop files will disappear, there will be something else replacing them, and we'll use whatever that is. But asking the developer to add additional parameters just to workaround a temporary limitation is wrong. The developers are writing a .desktop file and feeding that to the "desktop" click hook, so they have already given us all the information we need.

So, my suggestion is: change the apparmor rules so that an app can read its own .desktop file under ~/.local/share/applications/, and then, when these files will be removed, we'll use the new solution.

Revision history for this message
Ted Gould (ted) wrote : Re: [Bug 1437393] Re: Allow a confined app to read its own .desktop file

On Mon, 2015-03-30 at 08:02 +0000, Alberto Mardegan wrote:

> So, my suggestion is: change the apparmor rules so that an app can read
> its own .desktop file under ~/.local/share/applications/, and then, when
> these files will be removed, we'll use the new solution.

Let's not build in cruft that has to be removed later ☺

The app can read its own desktop file that is in its directory. I think
that's enough and a solution that we should work with.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Based on Ted's comment I am going to close this bug. Please reopen if this needs further discussion.

Changed in apparmor-easyprof-ubuntu (Ubuntu):
status: New → Won't Fix
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.