summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-02 18:15:45 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-02 18:15:45 +0000
commit22b9b55d20128c12483e353debd7b73746ce84e8 (patch)
tree5531387fdad67f382d9a32895f867e4db24bffd3
parent0c1d5eeb2119d0fea75cdbf9cbe912379684c13b (diff)
parent5c0ae288a26eb80423f967ca816c14afb7276b7c (diff)
downloadperl-22b9b55d20128c12483e353debd7b73746ce84e8.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@8985
-rw-r--r--doio.c9
-rw-r--r--lib/File/Copy.pm31
-rw-r--r--pod/perldata.pod6
-rw-r--r--pod/perlfaq1.pod23
-rw-r--r--vms/vms.c14
5 files changed, 65 insertions, 18 deletions
diff --git a/doio.c b/doio.c
index 53863b649d..3ed517b0bd 100644
--- a/doio.c
+++ b/doio.c
@@ -1294,15 +1294,18 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp,
*a++ = "";
}
*a = Nullch;
- if (*PL_Argv[0] != '/') /* will execvp use PATH? */
+ if (really)
+ tmps = SvPV(really, n_a);
+ if ((!really && *PL_Argv[0] != '/') ||
+ (really && *tmps != '/')) /* will execvp use PATH? */
TAINT_ENV(); /* testing IFS here is overkill, probably */
- if (really && *(tmps = SvPV(really, n_a)))
+ if (really && *tmps)
PerlProc_execvp(tmps,EXEC_ARGV_CAST(PL_Argv));
else
PerlProc_execvp(PL_Argv[0],EXEC_ARGV_CAST(PL_Argv));
if (ckWARN(WARN_EXEC))
Perl_warner(aTHX_ WARN_EXEC, "Can't exec \"%s\": %s",
- PL_Argv[0], Strerror(errno));
+ (really ? tmps : PL_Argv[0]), Strerror(errno));
if (do_report) {
int e = errno;
diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm
index 8d1d7834c9..24d1ffdf63 100644
--- a/lib/File/Copy.pm
+++ b/lib/File/Copy.pm
@@ -37,7 +37,7 @@ sub _catname { # Will be replaced by File::Spec when it arrives
import File::Basename 'basename';
}
if ($^O eq 'VMS') { $to = VMS::Filespec::vmspath($to) . basename($from); }
- elsif ($^O eq 'MacOS') { $to .= ':' . basename($from); }
+ elsif ($^O eq 'MacOS') { $to =~ s/^([^:]+)$/:$1/; $to .= ':' . basename($from); }
elsif ($to =~ m|\\|) { $to .= '\\' . basename($from); }
else { $to .= '/' . basename($from); }
}
@@ -69,6 +69,7 @@ sub copy {
&& !($from_a_handle && $^O eq 'os2' ) # OS/2 cannot handle handles
&& !($from_a_handle && $^O eq 'mpeix') # and neither can MPE/iX.
&& !($from_a_handle && $^O eq 'MSWin32')
+ && !($from_a_handle && $^O eq 'MacOS')
)
{
return syscopy($from, $to);
@@ -83,7 +84,7 @@ sub copy {
if ($from_a_handle) {
*FROM = *$from{FILEHANDLE};
} else {
- $from = "./$from" if $from =~ /^\s/s;
+ $from = _protect($from) if $from =~ /^\s/s;
open(FROM, "< $from\0") or goto fail_open1;
binmode FROM or die "($!,$^E)";
$closefrom = 1;
@@ -92,7 +93,7 @@ sub copy {
if ($to_a_handle) {
*TO = *$to{FILEHANDLE};
} else {
- $to = "./$to" if $to =~ /^\s/s;
+ $to = _protect($to) if $to =~ /^\s/s;
open(TO,"> $to\0") or goto fail_open2;
binmode TO or die "($!,$^E)";
$closeto = 1;
@@ -180,6 +181,13 @@ sub move {
*cp = \&copy;
*mv = \&move;
+
+if ($^O eq 'MacOS') {
+ *_protect = sub { MacPerl::MakeFSSpec($_[0]) };
+} else {
+ *_protect = sub { "./$_[0]" };
+}
+
# &syscopy is an XSUB under OS/2
unless (defined &syscopy) {
if ($^O eq 'VMS') {
@@ -196,6 +204,23 @@ unless (defined &syscopy) {
return 0 unless @_ == 2;
return Win32::CopyFile(@_, 1);
};
+ } elsif ($^O eq 'MacOS') {
+ require Mac::MoreFiles;
+ *syscopy = sub {
+ my($from, $to) = @_;
+ my($dir, $toname);
+
+ return 0 unless -e $from;
+
+ if ($to =~ /(.*:)([^:]+):?$/) {
+ ($dir, $toname) = ($1, $2);
+ } else {
+ ($dir, $toname) = (":", $to);
+ }
+
+ unlink($to);
+ Mac::MoreFiles::FSpFileCopy($from, $dir, $toname, 1);
+ };
} else {
$Syscopy_is_copy = 1;
*syscopy = \&copy;
diff --git a/pod/perldata.pod b/pod/perldata.pod
index 50b685816e..1744ff7fc9 100644
--- a/pod/perldata.pod
+++ b/pod/perldata.pod
@@ -209,9 +209,9 @@ with a regular expression (as documented in L<perlre>).
unless /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/;
The length of an array is a scalar value. You may find the length
-of array @days by evaluating C<$#days>, as in B<csh>. Technically
-speaking, this isn't the length of the array; it's the subscript
-of the last element, since there is ordinarily a 0th element.
+of array @days by evaluating C<$#days>, as in B<csh>. However, this
+isn't the length of the array; it's the subscript of the last element,
+which is a different value since there is ordinarily a 0th element.
Assigning to C<$#days> actually changes the length of the array.
Shortening an array this way destroys intervening values. Lengthening
an array that was previously shortened does not recover values
diff --git a/pod/perlfaq1.pod b/pod/perlfaq1.pod
index 1f9cb4c2e0..8809495f8a 100644
--- a/pod/perlfaq1.pod
+++ b/pod/perlfaq1.pod
@@ -292,22 +292,29 @@ by the Perl Development Team. Another big sell for Perl5 is the large
number of modules and extensions which greatly reduce development time
for any given task. Also mention that the difference between version
4 and version 5 of Perl is like the difference between awk and C++.
-(Well, OK, maybe it's not quite that distinct, but you get the idea.) If you
-want support and a reasonable guarantee that what you're developing
-will continue to work in the future, then you have to run the supported
-version. That probably means running the 5.005 release, although 5.004
-isn't that bad. Several important bugs were fixed from the 5.000 through
-5.003 versions, though, so try upgrading past them if possible.
+(Well, OK, maybe it's not quite that distinct, but you get the idea.)
+If you want support and a reasonable guarantee that what you're
+developing will continue to work in the future, then you have to run
+the supported version. As of early March 2001 that probably means
+running either of the releases 5.6.0 (released in March 2000) or
+5.005_03 (released in March 1999), although 5.004_05 isn't that bad
+if you B<absolutely> need such an old version (released in April 1999)
+for stability reasons. Anything older than 5.004_05 shouldn't be used.
Of particular note is the massive bug hunt for buffer overflow
problems that went into the 5.004 release. All releases prior to
that, including perl4, are considered insecure and should be upgraded
as soon as possible.
+In August 2000 in all Linux distributions a new security problem was
+found in the optional 'suidperl' (not built or installed by default)
+in all the Perl branches 5.6, 5.005, and 5.004, see
+http://www.cpan.org/src/5.0/sperl-2000-08-05/
+
=head1 AUTHOR AND COPYRIGHT
-Copyright (c) 1997, 1998, 1999 Tom Christiansen and Nathan Torkington.
-All rights reserved.
+Copyright (c) 1997, 1998, 1999, 2000, 2001 Tom Christiansen and Nathan
+Torkington. All rights reserved.
When included as an integrated part of the Standard Distribution
of Perl or of its documentation (printed or otherwise), this works is
diff --git a/vms/vms.c b/vms/vms.c
index 43a5c225f6..7915679068 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -1732,6 +1732,18 @@ struct _pipeloc {
};
static pPLOC head_PLOC = 0;
+void
+free_pipelocs(void *head)
+{
+ pPLOC p, pnext;
+
+ p = (pPLOC) head;
+ while (p) {
+ pnext = p->next;
+ Safefree(p);
+ p = pnext;
+ }
+}
static void
store_pipelocs()
@@ -1798,7 +1810,7 @@ store_pipelocs()
p->dir[NAM$C_MAXRSS] = '\0';
}
#endif
-
+ Perl_call_atexit(&free_pipelocs, head_PLOC);
}