.desktop files

Syntax validation for .desktop files
The official validation tool for files is distributed with the package

Executable bit in .desktop files
files in should have consistent executable bits.

As of 2017-06-16 many ebuilds (mostly KDE) create executable.

Look for executable files on the system with:

Please report any violations upstream.

Executable bit on Ubuntu systems
The Ubuntu Security Policy makes use of executable bits:

This does not apply to software which is installed via Gentoo ebuilds. Software should not ship a .desktop file with executable bit. The user can set the bit on demand where it is needed.

Ideas / Todo

 * we could check for the x bit in https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/util/_desktop_entry.py
 * In the past there were discussions about requiring them to be executable: https://commit-digest.org/issues/2009-02-08/
 * 2017-06-18 asked on the freedesktop mailing list about the  file.
 * KDE: "Note: Since KDE 4.3, there are more restrictions on authorized desktop files to prevent users from inadvertently running trojan desktop files. Your application launchers should have the executable bit set to prevent issues." source: kde.org
 * Xfce: please see about thunar behavior

Troubleshooting
Report bugs in desktop-file-validate on https://gitlab.freedesktop.org/xdg/desktop-file-utils/issues
 * Validation in some cases seems not correct ... (should be reported upstream)
 * "desktop-file-validate claims OnlyShowIn is deprecated" https://gitlab.freedesktop.org/xdg/desktop-file-utils/issues/52

External resources

 * https://devmanual.gentoo.org/eclass-reference/desktop.eclass