develooper Front page | perl.perl5.porters | Postings from September 2012

[perl #114908] rename wrongly considered insecure in an elsif clause

mhasch @ cpan . org
September 14, 2012 14:54
[perl #114908] rename wrongly considered insecure in an elsif clause
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #114908]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.39 running under perl 5.16.1.

Perl seems to consider "rename" to be an insecure operation in
taint mode if it happens to be called in an elsif clause chained
after an if clause involving something tainted.  This seems to
be the case in perl5.8.9, perl5.10.1, perl5.14.2 and perl5.16.1.

A test for this is attached below.  I thank Bram on #p5p for
help in boiling down the test case.

Site configuration information for perl 5.16.1:

Configured by ***** at Fri Aug 10 10:33:58 CEST 2012.

Summary of my perl5 (revision 5 version 16 subversion 1) configuration:
    osname=linux, osvers=2.6.32-5-686, archname=i686-linux-64int-ld
    uname='linux ******* 2.6.32-5-686 #1 smp sun may 6 04:01:19 utc 2012 i686 gnulinux '
    config_args='-Dprefix=/opt/perl516 -Duse64bitint -Duselongdouble -Dperladmin=none -Dusevfork=false -de'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=define
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.3.5', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /usr/lib64
    libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:

@INC for perl 5.16.1:

Environment for perl 5.16.1:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/bin/bash Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About