Skip Menu |
Report information
Id: 873
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: wpm [at] ms.com
Cc:
AdminCc:

Operating System: Solaris
PatchStatus: (no value)
Severity: medium
Type: core
Perl Version: 5.005_03
Fixed In: (no value)



From: "W. Phillip Moore" <wpm [...] ms.com>
Date: Tue, 15 Jun 1999 17:39:07 -0400 (EDT)
To: perlbug [...] perl.com
Cc: wpm [...] ms.com
Subject: File::Path 1.04 bug (all perl5 core versions)
Download (untitled) / with headers
text/plain 3.9k
A bug in File::Path caused some very serious outages here. A bug in code which *uses* File::Path called rmtree() with an uninitialized first argument. Unfortunately, rmtree() behaves by defaulting to assume that you want to remove /. This is *bad* default behavior. The patch below will at least check that $roots has a true value, and will return 0 otherwise. This applies to all the existing perl releases, that include File::Path 1.04 or 1.0401, most importantly including all the latest maintenance releases. *** /ms/dist/perl5/PROJ/core/5.00503/lib/perl5/File/Path.pm Thu Apr 22 11:52:32 1999 --- /ms/user/w/wpm/tmp/Path.pm Tue Jun 15 17:37:48 1999 *************** *** 148,157 **** my($roots, $verbose, $safe) = @_; my(@files); my($count) = 0; - $roots = [$roots] unless ref $roots; $verbose ||= 0; $safe ||= 0; my($root); foreach $root (@{$roots}) { $root =~ s#/$##; --- 148,164 ---- my($roots, $verbose, $safe) = @_; my(@files); my($count) = 0; $verbose ||= 0; $safe ||= 0; + if ( defined($roots) && length($roots) ) { + $roots = [$roots] unless ref $roots; + } + else { + carp "No root path(s) specified\n"; + return 0; + } + my($root); foreach $root (@{$roots}) { $root =~ s#/$##; --- This perlbug was built using Perl 5.00503 - Thu May 20 11:43:00 EDT 1999 It is being executed now by Perl 5.00503 - Thu May 20 11:45:48 EDT 1999. Site configuration information for perl 5.00503: Configured by wpm at Thu May 20 11:45:48 EDT 1999. Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=solaris, osvers=2.5.1, archname=sun4-solaris uname='sunos sascs1 5.5.1 generic_103640-24 sun4u sparc sunw,ultra-enterprise ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O', gccversion= cppflags='-DAPPLLIB_EXP="/ms/dist/perl5/VERS/5.00503-core/lib/perl5:/ms/dist/perl5/VERS/5.005-core/lib/perl5" -I/usr/local/include' ccflags ='-DAPPLLIB_EXP="/ms/dist/perl5/VERS/5.00503-core/lib/perl5:/ms/dist/perl5/VERS/5.005-core/lib/perl5" -I/usr/local/include' stdchar='unsigned char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 alignbytes=8, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib' Locally applied patches: --- @INC for perl 5.00503: /ms/dist/perl5/VERS/5.00503-core/lib/perl5 /ms/dist/perl5/VERS/5.005-core/lib/perl5 /ms/dist/perl5/PROJ/core/5.00503/exec/lib/perl5 /ms/dist/perl5/PROJ/core/5.00503/common/lib/perl5 /ms/dist/perl5/VERS/5.00503/lib/perl5 /ms/dist/perl5/VERS/5.005/lib/perl5 /ms/dist/perl5/lib/perl5 /ms/dist/aurora/lib/perl5 . --- Environment for perl 5.00503: HOME=/ms/user/w/wpm LANG=C LANGUAGE (unset) LD_LIBRARY_PATH=/usr/dt/lib:/opt/softbench/lib:/usr/openwin/lib:/ms/dist/aurora/lib LOGDIR (unset) PATH=/ms/dist/msjava/PROJ/jdk/1.2/exec/bin:/ms/dist/perl5/bin:/ms/dist/i18n/bin:/ms/dist/afs/PROJ/vms/beta/common/bin:/ms/dist/afs/PROJ/vms/beta/common/sbin:/ms/dist/msde/PROJ/msde/1.4/bin:/ms/user/w/wpm/bin:/ms/user/w/wpm/bin/@sys:/ms/dist/aurora/hackbin:/ms/dist/aurora/bin:/bin:/usr/ccs/bin:/usr/ucb:/ms/dist/fsf/bin:/ms/dist/afs/bin:/ms/dist/aurora/sbin:/usr/sbin:/ms/dist/afs/sbin:.:/ms/dist/eoffice/bin:/ms/dist/mq/sbin:/ms/dist/mq/bin:/opt/mqm/bin:/opt/mqm/samp/bin:/ms/dist/syb/bin:/usr/dt/bin:/usr/openwin/bin PERL_BADLANG (unset) SHELL=/bin/ksh
Date: Mon, 24 Jul 2000 09:46:13 -0400
From: rspier+bug19990615.007 [...] speed.seas.upenn.edu
Subject: [ID 19990615.007]
To: close_19990615.007 [...] bugs.perl.org
fixed in change @2695
fixed in change @2695


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org