Bug 520441 - ExtUtils::MakeMaker adds extra sanity check to executable perl scripts
Summary: ExtUtils::MakeMaker adds extra sanity check to executable perl scripts
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 0.7
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space07
TreeView+ depends on / blocked
 
Reported: 2009-08-31 14:10 UTC by Milan Zázrivec
Modified: 2009-12-07 12:02 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-07 12:02:56 UTC
Embargoed:


Attachments (Terms of Use)

Description Milan Zázrivec 2009-08-31 14:10:06 UTC
Description of problem:
All Spacewalk executable perl scripts (i.e. those located under bin/ sbin/
directoris) built by ExtUtils::MakeMaker have these two lines added to
the beginning of the file during package build:

eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
    if 0; # not running under some shell

These two lines are being added by ExtUtils::MakeMaker and take care of
situations when the operating system is not able to deal with the information
following the #! declaration at the beginning and tries to run the script
under arbitrary shell (i.e. not perl as it should). 

Though these two lines are quite harmless (Linux is able to deal with #!
without any problems), having these two lines in the running code might
be a problem when the perl stack reports an error at some particular line,
but the line number information will be skewed (i.e. the line numbers
in spacewalk source code would not match).

Version-Release number of selected component (if applicable):
Spacewalk 0.6

How reproducible:
Always

Steps to Reproduce:
1. Look at the begining of the perl executables in your Spacewalk
installation
  
Actual results:
Some of the start with:
#!/usr/bin/perl

eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
    if 0; # not running under some shell


Expected results:
Should be just:
#!/usr/bin/perl

Additional info:
Adelton suggests adding these lines to every affected Makefile.PL:

package MY;
sub tools_other {
        my $self = shift;
        my $ret = $self->SUPER::tools_other(@_);
        $ret =~ s/^(FIXIN\b.+)$/## $1\nFIXIN = \$(PERLRUN) -e 1/m;
        return $ret;
}

Comment 1 Milan Zázrivec 2009-09-01 13:41:35 UTC
Packages affected:

spacewalk-web (dobby module)
perl-Satcon
spacewalk-setup

Comment 2 Milan Zázrivec 2009-09-01 13:52:41 UTC
spacewalk.git master: a9ee83d25fb5135caada005c68b66787308b4692

Comment 3 Miroslav Suchý 2009-12-07 12:02:56 UTC
Spacewalk 0.7 released.


Note You need to log in before you can comment on or make changes to this bug.