Flatpak now allows dashes in the app id

Alexander Larsson alexl at redhat.com
Thu Oct 6 08:34:04 UTC 2016


On tor, 2016-10-06 at 10:10 +0200, Alexander Larsson wrote:
> On fre, 2016-09-16 at 17:11 +0200, Alexander Larsson wrote:
> > 
> > Flatpak has long disagreed with dbus on whether dashes are allowed
> > in
> > names (bus name vs flatpak app ids). DBus allows them (but not in
> > object paths) and flatpak doesn't.
> > 
> > However, a lot of pre-existing apps *do* use dashes, and recently
> > GApplication was changed to allowed this (and the details were made
> > more clear in the dbus spec), so today I landed a change in flatpak
> > that allows this.
> > 
> > However, for "special" reasons, we additionally disallow
> > application
> > ids to end with "-symbolic", in order to be able to handle
> > exporting
> > symbolic application icons.
> > 
> > For details, see: 
> > 
> >  https://github.com/flatpak/flatpak/commit/5c075525a8b14aefbaf7f3d4
> > 59
> > 20bd1d8f7e110c
> 
> So, it turns out this breaks the libreoffice flatpaks:
> 
>   https://github.com/flatpak/flatpak/issues/336
> 
> Because they export multiple desktop files from one app, by appending
> "-foo" (i.e. org.libreoffice.LibreOffice-writer.desktop). This is no
> longer allowed due to the above change.
> 
> Maybe we should consider reverting this change. The alternative is to
> switch libreoffice to use
> "org.libreoffice.LibreOffice.writer.desktop"
> instead, which should work fine.

So, i'm probably going to tweak this a bit. Here is the problem if we
allow dashed.

If my app is called "org.my.app" then it can export org.my.app.desktop
as well as "org.my.app.extra.desktop" (we explicitly allow this) and
"org.my.app-extra.desktop" (guaranteed to not conclict with another app
if we disallow dashes).

In this case we've already reasoned that "org.my.app.extra" is allowed,
because a) we need to be able to export multiple desktop/service files
and b) these always share the dns-prefix, so one organization could
make sure there are no conflicts.

Given the same reasoning we could easily allow "org.my.app" to export
"org.my.app-extra" because the "org.my" organization can resolve
conflicts.

However, there is a problem if we allow dashes earlier in the name. For
instance, if an app "org.my-proj.app" exports "org.my-
proj.app.desktop", then an app called "org.my" could also export that.

So, i think I will change the rules to only allow dashes in the last
segment (which is what many current dash-using apps do). This is a
problem for organizations with dashes in the domain-name, but they will
have to encode it with underscore instead.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's a benighted overambitious filmmaker on the run. She's an artistic 
foul-mouthed nun from beyond the grave. They fight crime! 



More information about the xdg-app mailing list