Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taint bug in File::Find? #911

Closed
p5pRT opened this issue Dec 3, 1999 · 1 comment
Closed

Taint bug in File::Find? #911

p5pRT opened this issue Dec 3, 1999 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Dec 3, 1999

Migrated from rt.perl.org#1846 (status was 'resolved')

Searchable as RT1846$

@p5pRT
Copy link
Author

p5pRT commented Dec 3, 1999

From dennis@funkplanet.com

$ perl -Twl -MFile​::Find -e 'delete $ENV{ENV}; $ENV{PATH} =
"/bin​:/usr/bin"; sub foo { print "wee​: $_"; } ($x) = ($ARGV[0] =~
/^(.*)/); find( \&foo, $x);' .

<prints all the filenames underneath this directory>
Insecure dependency in chdir while running with -T switch at
/usr/lib/perl/File/Find.pm line 133.

  My system information is enclosed below. Anyhow, without
further ado, a tiny but useful patch​:

*** Find.pm.old Fri Dec 3 00​:34​:46 1999
--- Find.pm Fri Dec 3 00​:36​:32 1999
***************
*** 87,92 ****
--- 87,94 ----
  my $wanted = shift;
  my $bydepth = $wanted->{bydepth};
  my $cwd = $bydepth ? Cwd​::fastcwd() : Cwd​::cwd();
+ $cwd = $1 if $cwd =~ /^(.*)/;
+
  # Localize these rather than lexicalizing them for backwards
  # compatibility.
  local($topdir,$topdev,$topino,$topmode,$topnlink);

  (And while we're on the subject, perlbug wasn't working when I
tried to write this... it just asked me for a subject and froze. Oh,
well, I'll look at it later.)

_________________________________________________________________________
Dennis Taylor "Anyone whose days are all the same and free from
dennis@​funkplanet.com want inhabits eternity of a sort." - Peter Hoeg
_________________________________________________________________________
  PGP Fingerprint​: E8D6 9670 4FBD EEC3 6C6B 810B 2B30 E529 51BD 7B90

Site configuration information for perl 5.00503​:

Configured by root at Sun May 9 23​:28​:38 EDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration​:
  Platform​:
  osname=linux, osvers=2.2.6, archname=i686-linux
  uname='linux blackdove.funkplanet.com 2.2.6 #4 tue apr 20 02​:59​:44
edt 1999 i686 unknown '
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef useperlio=undef d_sfio=undef
  Compiler​:
  cc='cc', optimize='-O2', gccversion=2.7.2.3
  cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
  ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
  stdchar='char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
  alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib
  libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
  libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-rdynamic'
  cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches​:


@​INC for perl 5.00503​:
  /home/dennis/lib/perl5/site_perl
  /usr/lib/perl/i686-linux
  /usr/lib/perl
  /usr/lib/perl5/site_perl/i686-linux
  /usr/lib/perl5/site_perl
  .


Environment for perl 5.00503​:
  HOME=/home/dennis
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/local/bin​:/bin​:/usr/bin​:/usr/X11R6/bin​:/usr/local/bin​:/sbin​:/usr/sbin​:/usr/games​:/home/dennis/bin​:/sbin​:/usr/sbin​:/usr/games​:/home/dennis/bin
  PERL5LIB=/home/dennis/lib/perl5/site_perl
  PERL_BADLANG (unset)
  SHELL=/bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant