develooper Front page | perl.perl5.porters | Postings from April 2006

Tainting oddness, if () { ...} has no tainting issues, but if () {} elsif () {} does.... (bug maybe?)

Thread Next
From:
demerphq
Date:
April 2, 2006 03:31
Subject:
Tainting oddness, if () { ...} has no tainting issues, but if () {} elsif () {} does.... (bug maybe?)
Message ID:
9b18b3110604020330nc206b2bj9ece905d3da81afc@mail.gmail.com
I've come accross some behaviour under tainting that I cant figure out.

Consider the following two one liners:

perl -Twe "if ( ! $ENV{AUTHOR_TESTING} ) { print 'Skipping'; } if ( !
eval 'use Pod::Coverage 0.17; 1' ) { print 'needmod' }"

perl -Twe "if ( ! $ENV{AUTHOR_TESTING} ) { print 'Skipping'; } elsif (
! eval 'use Pod::Coverage 0.17; 1' ) { print 'needmod' }"


IMO youd expect these to be more or less equivelent. At least, you
wouldnt expect one to die with tainting errors but the other not to.
But thats what happens when you set AUTHOR_TESTING before running
them:

D:\dev\cpan\ExtUtils-Install>perl -Twe "if ( ! $ENV{AUTHOR_TESTING} )
{ print 'Skipping'; } if ( ! eval 'use Pod::Coverage 0.17; 1' ) {
print 'needmod' }"

D:\dev\cpan\ExtUtils-Install>perl -Twe "if ( ! $ENV{AUTHOR_TESTING} )
{ print 'Skipping'; }elsif ( ! eval 'use Pod::Coverage 0.17; 1' ) {
print 'needmod' }"
Insecure dependency in eval while running with -T switch at -e line 1.

This behaviour makes no sense to me, and I think its a bug, am i correct?

Should I file a bugreport on this?

Yves
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
-D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DNO_HASH_SEED
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPL
ICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
    optimize='-MD -Zi -DNDEBUG -O1',
    cppflags='-DWIN32'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='__int64', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf 
-libpath:"D:\ASPerl\811\lib\CORE"  -machine:x86'
    libpth=\lib
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib 
netapi32.lib uuid.lib ws2_
32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib  netapi32.lib uuid.lib
ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
    gnulibc_version='undef'
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf  -libpath:"D:\ASPerl\811\lib\CORE"  -machine:x86'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
  Locally applied patches:
        ActivePerl Build 811
        21540 Fix backward-compatibility issues in if.pm
        23565 Wrong MANIFEST.SKIP
  Built under MSWin32
  Compiled at Dec 13 2004 09:52:01
  @INC:
    D:/ASPerl/811/lib
    D:/ASPerl/811/site/lib
    .

--
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About