After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779522 - gdb helper code installed as executable scripts but has no #!
gdb helper code installed as executable scripts but has no #!
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.50.x
Other Linux
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-03-03 11:10 UTC by Simon McVittie
Modified: 2017-03-03 20:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.54 KB, patch)
2017-03-03 11:10 UTC, Simon McVittie
accepted-commit_now Details | Review

Description Simon McVittie 2017-03-03 11:10:16 UTC
Created attachment 347124 [details] [review]
proposed patch

Debian's Lintian tool reports a warning when processing the debug package for GLib:

https://lintian.debian.org/tags/executable-not-elf-or-script.html

This is because glib_gdb.py and gobject_gdb.py are installed executable, but do not start with "#!" or ELF headers. If a user attempted to run them, the execve() call would fail with ENOEXEC, resulting in either an error or the parent process falling back to using /bin/sh as an interpreter (which would not work, because they are written in Python, not shell).

These files are essentially library code, and do not do anything when run, so the solution is to make them not executable.

(The same warning is also emitted for echo-script.bat and echo-script in the installed-tests, but I have overridden the warning as a false positive in those cases, because it is deliberate: they are test data for GLib's ability to respond to ENOEXEC by falling back to using /bin/sh as interpreter.)
Comment 1 Philip Withnall 2017-03-03 11:43:05 UTC
Review of attachment 347124 [details] [review]:

Looks good.
Comment 2 Simon McVittie 2017-03-03 20:09:42 UTC
Thanks, fixed in git for 2.51.5 as e3f59e482.