Discussion:
Should .desktop files have executable permissions?
Jonas Stein
2017-06-18 11:50:33 UTC
Permalink
Dear all,

we had recently a discussion on the gentoo developer cannel, if .desktop
files should be all executable, or all not-executable.

I could not find this in the definition. [1]
Can you help us and could you add a note about the executable bit in the
standard definition, please?

[1]
https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

Best,
--
Jonas Stein
Roman Chistokhodov
2017-06-18 14:47:20 UTC
Permalink
I can't find the standard on that too.
But some desktops implement the concept of authorized (trusted) .desktop
files, not sure that the requirements are uniform across desktops though.
Eg. on KDE desktop file is authorized if either if these applies: [1]
1. Desktop file is in standard location
2. Desktop file has root owner
3. The calling process has executable permission on that desktop file

[1]
https://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKDesktopFile.html#ab9222da1ca239fc3847d31833bc45552
Post by Jonas Stein
Dear all,
we had recently a discussion on the gentoo developer cannel, if .desktop
files should be all executable, or all not-executable.
I could not find this in the definition. [1]
Can you help us and could you add a note about the executable bit in the
standard definition, please?
[1]
https://standards.freedesktop.org/desktop-entry-spec/
desktop-entry-spec-latest.html
Best,
--
Jonas Stein
_______________________________________________
xdg mailing list
https://lists.freedesktop.org/mailman/listinfo/xdg
Jonas Stein
2017-06-25 12:22:02 UTC
Permalink
Thank you for the link.
There is software using
a) executable .desktop files
b) non executable .desktop files
c) mixed a) and b) in one software package.

This is not very satisfying from the perspective of a distribution which
wants to distribute a consistent Linux to the community.

I also think distributions should avoid to change the execution bits.
An advice or an extension of the .desktop standard would be the best
solution for everyone.

Can you imagine any reason, why a distribution should not add a shebang
#!/usr/bin/env xdg-open
in the first line of all .desktop files and set the executable bit?

The definition of the comment [2] would support this strategy very well.
Post by Roman Chistokhodov
I can't find the standard on that too.
But some desktops implement the concept of authorized (trusted) .desktop
files, not sure that the requirements are uniform across desktops though.
Eg. on KDE desktop file is authorized if either if these applies: [1]
1. Desktop file is in standard location
2. Desktop file has root owner
3. The calling process has executable permission on that desktop file
[1]
https://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKDesktopFile.html#ab9222da1ca239fc3847d31833bc45552

[2]
https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html#comments

Best,
--
Jonas Stein
Loading...