permissions of script files wrong/missing shebang lines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Inkscape |
Low
|
Alex Valavanis | ||
| inkscape (Debian) |
Fix Released
|
Unknown
|
||
| inkscape (Ubuntu) |
Low
|
Alex Valavanis |
Bug Description
Hi Altogether,
while packaging for 0.48 pre1 for debian, I came back to an issue I should have reported long ago :-)
Lintian complains for the files listed below:
N: executable-
N:
N: This executable file is not an ELF format binary, and does not start
N: with the #! sequence that marks interpreted scripts. It might be a sh
N: script that fails to name /bin/sh as its shell, or it may be
N: incorrectly marked as executable. Sometimes upstream files developed
N: on Windows are marked unnecessarily as executable on other systems.
N:
N: If you are using debhelper to build your package, running dh_fixperms
N: will often correct this problem for you.
N:
N: Refer to Debian Policy Manual section 10.4 (Scripts) for details.
N:
N: Severity: normal, Certainty: certain
N:
Please go through the listed files and chef if they need the executable permission (than please add the shebang) or if they don't.
Thank you very much,
Wolfi
The affected files are:
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
W: inkscape: executable-
Related branches
- jazzynico (community): Approve on 2010-08-30
-
Diff: 508 lines (+58/-11)50 files modifiedshare/extensions/Barcode/Base.py (+1/-0)
share/extensions/Barcode/Code128.py (+1/-0)
share/extensions/Barcode/Code39.py (+1/-0)
share/extensions/Barcode/Code39Ext.py (+1/-0)
share/extensions/Barcode/Code93.py (+1/-0)
share/extensions/Barcode/EAN13.py (+1/-0)
share/extensions/Barcode/EAN5.py (+1/-0)
share/extensions/Barcode/EAN8.py (+1/-0)
share/extensions/Barcode/RM4CC.py (+1/-0)
share/extensions/Barcode/UPCA.py (+1/-0)
share/extensions/Barcode/UPCE.py (+1/-0)
share/extensions/Barcode/__init__.py (+1/-1)
share/extensions/SpSVG.pm (+1/-1)
share/extensions/color_blackandwhite.py (+1/-0)
share/extensions/color_brighter.py (+1/-0)
share/extensions/color_custom.py (+2/-1)
share/extensions/color_darker.py (+1/-0)
share/extensions/color_desaturate.py (+2/-1)
share/extensions/color_grayscale.py (+2/-1)
share/extensions/color_lesshue.py (+1/-0)
share/extensions/color_lesslight.py (+1/-0)
share/extensions/color_lesssaturation.py (+1/-0)
share/extensions/color_morehue.py (+1/-0)
share/extensions/color_morelight.py (+1/-0)
share/extensions/color_moresaturation.py (+1/-0)
share/extensions/color_negative.py (+2/-1)
share/extensions/color_randomize.py (+1/-0)
share/extensions/color_removeblue.py (+2/-1)
share/extensions/color_removegreen.py (+2/-1)
share/extensions/color_removered.py (+2/-1)
share/extensions/color_replace.py (+1/-0)
share/extensions/color_rgbbarrel.py (+2/-1)
share/extensions/dxf_templates.py (+1/-0)
share/extensions/inkweb.js (+1/-0)
share/extensions/jessyInk.js (+1/-0)
share/extensions/jessyInk_core_mouseHandler_noclick.js (+1/-0)
share/extensions/jessyInk_core_mouseHandler_zoomControl.js (+1/-0)
share/extensions/render_alphabetsoup_config.py (+1/-0)
share/extensions/render_barcode.py (+1/-0)
share/extensions/run_command.py (+1/-0)
share/extensions/svg_and_media_zip_output.py (+1/-1)
share/extensions/svg_regex.py (+1/-0)
share/extensions/text_braille.py (+1/-0)
share/extensions/text_flipcase.py (+1/-0)
share/extensions/text_lowercase.py (+1/-0)
share/extensions/text_randomcase.py (+1/-0)
share/extensions/text_replace.py (+1/-0)
share/extensions/text_sentencecase.py (+1/-0)
share/extensions/text_titlecase.py (+1/-0)
share/extensions/text_uppercase.py (+1/-0)
- Ubuntu branches: Pending requested 2011-05-30
-
Diff: 917 lines (+377/-329)6 files modifieddebian/changelog (+19/-0)
debian/control (+1/-2)
debian/patches/00list (+1/-0)
debian/patches/02-add-shebangs-and-fix-permissions.dpatch (+274/-326)
debian/patches/fix-fontforge-glyph-template.dpatch (+82/-0)
debian/rules (+0/-1)
- Chris Coulson (community): Approve on 2011-06-06
- Ubuntu branches: Pending requested 2011-06-02
-
Diff: 5343 lines (+1005/-4302)6 files modifieddebian/changelog (+38/-0)
debian/patches/00list (+3/-1)
debian/patches/04-fix-build-with-gcc4.6.dpatch (+18/-0)
debian/patches/04-fix-gcc4.6-ftbfs.dpatch (+0/-4301)
debian/patches/05-add-missing-includes.dpatch (+799/-0)
debian/patches/fix-datamatrix-ui.dpatch (+147/-0)
Changed in inkscape: | |
importance: | Undecided → Low |
status: | New → Confirmed |
tags: | added: extensions-plugins |
Changed in inkscape: | |
assignee: | nobody → Leo Albert Jackson Jr (lajjr) |
Changed in inkscape: | |
status: | Confirmed → Triaged |
Hello all,
I found some with missing shebangs as said. I tested and works either way so to conform to most OSs I will add shebangs to make less headaches. I will make a branch off .48 to get the fixes in it after review unless told otherwise. I tested after a compile on .46 I will also verify with .48, but seems to make no difference they still work.
Regards,
Leo Jackson
Sorry about the delay just testing took a bit.
Regards,
Leo Jackson
Changed in inkscape: | |
status: | Triaged → In Progress |
Krzysztof Kosinski (tweenk) wrote : | #4 |
This is wrong. Those scripts are not supposed to be executed as standalone programs, so they should not be executable or have shebangs.
We can use overrides if this is not preferred. Like in Debian and Ubuntu lintian overrides. Under Fedora I didn't see these errors.
Under Windows they are just pushed as well.
where lintian is used is where the errors are. Or we can just ignore it as for the scripts are just pushed to the extensions directory.
Sorry about that.
Regards,
Leo Jackson
I know it's under debate, but I can switch to this even though it might not be pushed to trunk or focus development. It's just to give a possible solution to this bug.
Regards,
Leo Jackson
Changed in inkscape: | |
status: | In Progress → Fix Committed |
Jon A. Cruz (jon-joncruz) wrote : | #7 |
The prior comment was not correct. By design the current inkscape extension system uses scripts that take SVG in on stdin and put replacement output SVG to stdout. These were intended to be reusable as stand-alone CGI-like components that are simple to reuse in other contexts, including invocations from other programs or scripts.
Hello,
I just want to add a small note as Jon A. Cruz said "These were intended to be reusable as stand-alone" This would be a good thing to add shebands if they are reused it another context in the development out of focus. I think they should have them added also seeing the code thus far, it can be a benefit to have.
Say maybe we want to make a toolbox for people to use for quick tasks sure would need them then. (We don't have this)
It sure would be useful and I would help create it. ;-)
With development you never know what road may come up. And for what ever reason you didn't add the shebands, and need them later you will have them.
Regards,
Leo Jackson
Changed in inkscape: | |
milestone: | none → 0.49 |
wolfi (wolfi-sigxcpu) wrote : | #9 |
Thanks for sorting this out, I'll add the patch to the debian package in the next upload.
With best wishes,
Wolfi
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Jazzy,
Thanks again reverted to committed as the release is for a released version to public.
Sorry about that.
Thanks Again,
Leo Jackson
Changed in inkscape: | |
status: | Fix Released → Fix Committed |
su_v (suv-lp) wrote : | #11 |
Jon A. Cruz wrote
> The prior comment was not correct. By design the current inkscape
> extension system uses scripts that take SVG in on stdin and put
> replacement output SVG to stdout. These were intended to be
> reusable as stand-alone CGI-like components that are simple
> to reuse in other contexts, including invocations from other
> programs or scripts.
There are different kind of script files included in the extensions directory, and not _all_ of them are intended to be used as stand-alone components. In my understanding this is limited to those scripts, which are referenced as <command/> in the corresponding INX file.
NOTE: If a shebang line is added e.g. to javascript files which are intended for embedded use in SVG files, it can break an extension (as happens with JessyInk.js [1]).
IMHO there should be rules defined, e.g.
With shebang:
- scripts which are called by INX files (as <command …></command>)
No shebang:
- (python/perl) scripts only imported as modules
- (java)script files to be embedded in SVG files
The merged changes to trunk
<http://
does not include all changes from the merge proposal
<http://
but apparently on some distributions (reported for 0.48.1 on Debian), Inkscape is shipped with the changes from the branch instead of the committed changes (causing locally created JessyInk presentations to fail in web broswers).
[1] reported on irc, with Inkscape 0.48.1 distributed by Debian: new presentations don't run e.g. in Firefox, with this error:
Error: illegal character
Source File: http://
Line: 98
Source Code:
#!/usr/bin/env js
Alex Valavanis (valavanisalex) wrote : | #12 |
Thanks ~suv. I just received a debian bug report email about this, and can confirm that the problem has propagated through to Ubuntu. I have added a comment to the Debian tracker, and I will take care of it in Ubuntu.
Changed in inkscape (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → Alex Valavanis (valavanisalex) |
importance: | Undecided → Low |
Alex Valavanis (valavanisalex) wrote : | #13 |
I'm stripping out the shebang lines from each of the *.js files in the Debian patch. As far as I can tell, none of them are supposed to ever be run as a standalone script. The only other discrepancy I can see between the Debian version and the trunk is that the voronoi.py script has had a shebang added in Debian.
In this case, it looks like voronoi.py *is* intended to be executable, even though it is not called directly by the extension. It handles __main__ invocations, provides command-line help, etc. Perhaps it would be appropriate to include a shebang in this script upstream too?
Alex Valavanis (valavanisalex) wrote : | #14 |
Part of the problem here is that the JavaScript extension files are installed using a _SCRIPTS Automake rule. This adds the "executable" flag to the files, but it is not possible to run any of the *.js files as standalone scripts. It would be better to use a _DATA rule, which just copies the file without changing the permissions.
If no one objects, I will commit the following changes to trunk:
* Add shebang to voronoi.py
* Move *.js files to the _DATA rule in share/extension
Changed in inkscape: | |
assignee: | Leo Jackson (lajjr) → Alex Valavanis (valavanisalex) |
status: | Fix Committed → Incomplete |
Changed in inkscape (Ubuntu): | |
status: | In Progress → Triaged |
Changed in inkscape (Ubuntu): | |
milestone: | none → oneiric-alpha-1 |
su_v (suv-lp) wrote : | #15 |
The python script 'voronoi.py' originates from <http://
Beyond that I see no reason against adding the shebang (but for using the script with Inkscape, it's not required, and it is not part of the original version).
@JazzyNico - since you comitted the original merge proposal, any comments on handling *.js files? As far as I can tell, all included javascript files are intended for embedded use in SVG files.
jazzynico (jazzynico) wrote : | #16 |
> As far as I can tell, all included javascript files are intended for embedded use in SVG files.
Confirmed. Thus adding a shebang here is totally useless.
Alex Valavanis (valavanisalex) wrote : | #17 |
As I see it, it doesn't really matter to the Inkscape project whether voronoi.py is classed as "executable" or not. However, we need to make a decision about which way to go. At the moment, we are distributing the script with executable permission, but not telling the system how to interpret it. If the user tries to run the script in Ubuntu, it is interpreted using the dash interpreter, and obviously fails. We either need to remove the executable flag, or add a shebang.
Alex Valavanis (valavanisalex) wrote : | #18 |
I've updated trunk as described previously. Please feel free to revert the changes if you think it's a bad idea
Changed in inkscape: | |
status: | Incomplete → Fix Committed |
Alex Valavanis (valavanisalex) wrote : | #19 |
trunk: r.10245
Launchpad Janitor (janitor) wrote : | #20 |
This bug was fixed in the package inkscape - 0.48.1-2ubuntu5
---------------
inkscape (0.48.1-2ubuntu5) oneiric; urgency=low
* debian/rules: No need to manually call intltool-update on build. This
is now handled by dh_translations.
* debian/control: No longer suggest python and skencil. They do not
offer any enhancement to Inkscape (LP: #762541)
* debian/control: Suggest transfig to allow import of xfig files
(LP: #668300)
* debian/
No longer mark JavaScript extension files as standalone executables
(LP: #602005):
- share/extension
- share/extension
than _SCRIPTS rule to avoid giving executable permission
* debian/
patch from uptream trunk to fix layer structure in template (LP: #565296)
-- Alex Valavanis <email address hidden> Mon, 30 May 2011 18:50:49 +0100
Changed in inkscape (Ubuntu): | |
status: | Triaged → Fix Released |
su_v (suv-lp) wrote : | #21 |
Alex Valavanis wrote on 2011-05-24:
> * Add shebang to voronoi.py
> * Move *.js files to the _DATA rule in share/extension
The fix was committed to trunk in r10245 - this report should have been tagged 'backport-proposed' (for the 0.48.x branch).
@Hannes - sorry to have missed that in time for 0.48.2.
tags: | added: backport-proposed |
Changed in inkscape (Debian): | |
status: | Unknown → Confirmed |
jazzynico (jazzynico) wrote : | #22 |
Back-ported to the 0.48.x branch, revision 9829.
Changed in inkscape: | |
milestone: | 0.49 → 0.48.3 |
tags: | removed: backport-proposed |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Changed in inkscape (Debian): | |
status: | Confirmed → Fix Released |
I will look through them.
Regards,
Leo Jackson