[Bug 2518] New: If JNLP contains 'vendor' the generated .desktop-file contains invalid 'Vendor' entry key which invalidates file and inhibits installation

bugzilla-daemon at icedtea.classpath.org bugzilla-daemon at icedtea.classpath.org
Sun Jul 12 20:15:59 UTC 2015


            Bug ID: 2518
           Summary: If JNLP contains 'vendor' the generated .desktop-file
                    contains invalid 'Vendor' entry key which invalidates
                    file and inhibits installation
           Product: IcedTea-Web
           Version: 1.5
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: NetX (javaws)
          Assignee: jvanek at redhat.com
          Reporter: debian.org at jjaf.de
                CC: unassigned at icedtea.classpath.org

*Steps to Reproduce*

Sample JOSM <https://josm.openstreetmap.de/download/josm.jnlp> contains

<jnlp spec="6.0+" codebase="https://josm.openstreetmap.de/download/"

which <javaws 'https://josm.openstreetmap.de/download/josm.jnlp'> prompts NetX
to generate a desktop entry which despite confirming that is not installed, but
a file is found on <~/Dektop/JOSM (JOSM - Java OpenStreetMap Editor).desktop>
which opens in a text editor.

This .desktop file claims to be a "Desktop Entry" Version 1.0 but contains a
'Vendor=OpenStreetMap' entry which is not on the list of "Recognized desktop
entry keys"
thus this file does not validate by

*Actual Results*

$ desktop-file-validate 'JOSM (JOSM - Java OpenStreetMap Editor).desktop'
JOSM (JOSM - Java OpenStreetMap Editor).desktop: error: file contains key
"Vendor" in group "Desktop Entry", but keys extending the format should start
with "X-"

No desktop entry is present on the system.

*Expected Results*

If the entry is modified to 'X-Vendor' or deleted the desktop entry can be
installed by ...

$ desktop-file-install 'JOSM (JOSM - Java OpenStreetMap Editor).desktop'

... and works normally as an executable desktop entry.

*Additional Information*

The manpage reads:
"desktop-file-install and desktop-file-edit will always try to validate the
resulting desktop file. A failure to validate might lead to the abortion of the
installation of the desktop files."

contain the offending code which should be deleted:

        if (file.getInformation().getVendor() != null) {
            fileContents += "Vendor=" +
sanitize(file.getInformation().getVendor()) + "\n";

*Extended additional information*

I could not find any "Desktop Entry Specification"
<http://standards.freedesktop.org/desktop-entry-spec/> that uses a vendor as an
entry, but the only reference is for the "Desktop Menu Specification"
<http://standards.freedesktop.org/menu-spec/latest/apcs03.html> where it is a
prefix for the filename.

Using <desktop-file-install --vendor=VENDOR> would "Add a vendor prefix to the
desktop files. If a file already has this prefix, nothing happens; else, the
file will be named VENDOR-FILE." (manpage).

<xdg-desktop-menu install --novendor> is used in
"Normally, xdg-desktop-menu checks to ensure that any *.directory and *.desktop
files to be installed has a vendor prefix. This option can be used to disable
that check.
A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with
a dash ("-"). Companies and organizations are encouraged to use a word or
phrase, preferably the organizations name, for which they hold a trademark as
their vendor prefix. The purpose of the vendor prefix is to prevent name
conflicts." (manpage)

So maybe getShortcutTmpFile() in
<./icedtea-web-1.5/netx/net/sourceforge/jnlp/util/XDesktopEntry.java:137> could
be modified to include the vendor in the filename if present and if the
sanitizeFileName() and JNLP-vendor-text would allow it to something like:

        File shortcutFile = new File(userTmp + File.separator +
FileUtils.sanitizeFileName(file.getInformation().getVendor()) + "-" +
FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");

... and above '--novendor' would have to be conditional too.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20150712/3fa00522/attachment-0001.html>

More information about the distro-pkg-dev mailing list