Bug 767978

Summary: remove/disable E: script-without-shebang /usr/share/applications/foo.desktop check
Product: [Fedora] Fedora Reporter: Rex Dieter <rdieter>
Component: rpmlintAssignee: Tom "spot" Callaway <tcallawa>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: a.badger, kevin, manuel.wolfshant, tcallawa, tmz, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-15 19:38:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rex Dieter 2011-12-15 12:58:33 UTC
Per a recent package review:
kdf.x86_64: E: script-without-shebang /usr/share/applications/kde4/kdf.desktop

xdg specs (or at least common practice and conventional wisdom) now strongly encourages .desktop files to ship with executable bits as an additional security measure.  For awhile now, at least all upstream core kde applications follow this practice and kdelibs enforces additional checks on .desktop files (in particular, those .desktop files found outside of usual search paths)

Given this, I'd recommend that rpmlint no longer issue warnings or errors pertaining to packages containing executable .desktop files

Comment 1 Tom "spot" Callaway 2011-12-15 15:09:09 UTC
Does the xdg standard really say that .desktop files should be +x as a _security_ measure? What happens if you try to execute it? It has no interpreter!

Looking at the Desktop Entry Specification (http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html), I can't see anything to back this up, nor can I figure out why it would be conventional wisdom or common practice to set the executable flag on a file that cannot execute.

Comment 2 Rex Dieter 2011-12-15 15:34:15 UTC
It's not part of the spec, but is a common practice these days.

I'll see if I can dig up some mailing list references for some background.

Comment 3 Rex Dieter 2011-12-15 18:55:38 UTC
here's the main thread I recall,

".desktop file security"
http://lists.freedesktop.org/archives/xdg/2009-February/010209.html

Comment 4 Tom "spot" Callaway 2011-12-15 19:10:08 UTC
Hrm. It seems like a terrible idea, and a great way to try to exploit a system. While I'd prefer that this was standardized in the Desktop Entry Specification, it isn't explicitly forbidden. (Neither is wearing a .desktop file as pants, but I wouldn't recommend that either.)

The concept of taking a file format and making it executable when there is no reason to do so is completely flawed, IMHO.

But. I realize that the time for sanity in this discussion may have come and gone if it has been implemented in KDE already, so I'll just grumble and wave my cane of sanity at you from my front porch.

Comment 5 Ville Skyttä 2011-12-15 19:14:55 UTC
(In reply to comment #3)
> http://lists.freedesktop.org/archives/xdg/2009-February/010209.html

That post lists three conditions, any of which is said to permit the launch.  Two of three (root ownership, installed in system dirs) are already true for packaged apps, so I don't see why adding the executable bit would do any good.

Comment 6 Rex Dieter 2011-12-15 19:30:13 UTC
Sure, kde adds X unconditionally, for folks installing kde trees outside of system dirs.  I suppose it could be argued it should only do that conditionally in that case.

Comment 7 Tom "spot" Callaway 2011-12-15 19:38:29 UTC
rpmlint-1.4-4.fc17 squelches the error on +x desktop files. If only it was so easy to squelch bad ideas on the internets. *sigh*

Comment 8 Ville Skyttä 2011-12-15 21:25:42 UTC
(In reply to comment #6)
> Sure, kde adds X unconditionally, for folks installing kde trees outside of
> system dirs.  I suppose it could be argued it should only do that conditionally
> in that case.

...or if/as long as it doesn't, packagers (c|sh)ould just remove the x bits from where they're not needed.

Comment 9 Kevin Kofler 2011-12-15 22:43:32 UTC
I think KDE considers the other 2 conditions just compatibility hacks and would like ALL .desktop files to be marked executable.