This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Wed, 31 Mar 2004 10:43:26 +0000 (10:43 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 31 Mar 2004 10:43:26 +0000 (10:43 +0000)
[ 22407]
Use File::Temp for tempfiles if it is available.
(Based on a patch from Solar Designer <solar@openwall.com> in
Message-ID: <20040125222218.GA13499@openwall.com>, the bulk of which
was applied as change 22258)

[ 22484]
Subject: Re: [PATCH] Re: Proposal to remove support for MachTen
From: Dominic Dunlop <shouldbedomo@mac.com>
Date: Thu, 11 Mar 2004 10:34:01 +0100
Message-Id: <3B07B7FC-733F-11D8-AC24-000A27839BD6@mac.com>

[ 22604]
fix typo in change 22597

[ 22614]
Subject: Zaurus SL-[78]60 native compile patch
Message-Id: <46DCC0BF-8199-11D8-8D5B-000A95DBB50A@dan.co.jp>
From: Dan Kogai <dankogai@dan.co.jp>
Date: Tue, 30 Mar 2004 00:53:52 +0900
p4raw-link: @22614 on //depot/perl: a148bc21b766f4140cbfd09c58adec1f3939aa65
p4raw-link: @22604 on //depot/perl: cf2dc985c417547affbfd5f503520532b4626f60
p4raw-link: @22484 on //depot/perl: d0c3e6d694ba2b6651c767fbceed20be69dd8594
p4raw-link: @22407 on //depot/perl: 003a92ef523fede541513d0991848d9e3d62707a

p4raw-id: //depot/maint-5.8/perl@22616
p4raw-integrated: from //depot/perl@22611 'copy in' README.machten
(@10461..) hints/machten.sh (@18283..) utils/perlbug.PL
(@18698..) ext/Errno/Errno_pm.PL (@20469..) 'merge in' op.h
(@22597..)

README.machten
ext/Errno/Errno_pm.PL
hints/machten.sh
op.h
utils/perlbug.PL

index a15b907..f2628fd 100644 (file)
@@ -11,9 +11,36 @@ README.machten - Perl version 5 on Power MachTen systems
 This document describes how to build Perl 5 on Power MachTen systems,
 and discusses a few wrinkles in the implementation.
 
-=head2 Compiling Perl 5 on MachTen
-
-To compile perl under MachTen 4.1.4 (and probably earlier versions):
+=head2 Perl version 5.8.x and greater not supported
+
+B<Power MachTen is not supported by versions of Perl later than
+5.6.x.>
+If you wish to build a version from the 5.6 track, please
+obtain a source distribution from the archive at
+L<http://cpan.org/src/5.0/> and follow the instructions in its
+README.machten file.
+
+MachTen is no longer supported by its developers, Tenon Intersystems.
+A UNIX environment hosted on Mac OS Classic, MachTen has been
+superseded by Mac OS X and by BSD and Linux implementations for Macintosh
+hardware.
+The final version of Power MachTen, 4.1.4, lacks many features found in
+modern implementations of UNIX, and has a number of bugs.
+These shortcomings prevent recent versions of Perl from being able to use
+extensions on MachTen, and cause numerous test suite failures in the
+perl core.
+
+In September 2003, a discussion on the MachTen mailing list determined
+that there was no interest in making a later version of Perl build
+successfully on MachTen.
+Consequently, support for building Perl under MachTen has been suppressed
+in Perl distributions published after February 2004.
+The hints file, F<hints/machten.sh>, remains a part of the
+distributions for reference purposes.
+
+=head2 Compiling Perl 5.6.x on MachTen
+
+To compile perl 5.6.x under MachTen 4.1.4 (and probably earlier versions):
 
   ./Configure -de
   make
@@ -86,4 +113,4 @@ Dominic Dunlop <domo@computer.org>
 
 =head1 DATE
 
-Version 1.0.1 2000-03-27
+Version 1.1.0 2004-02-13
index 22171fa..fdab9ee 100644 (file)
@@ -109,7 +109,9 @@ sub get_files {
             ) {
        # Some Linuxes have weird errno.hs which generate
        # no #file or #line directives
-       $file{'/usr/include/errno.h'} = 1;
+       my $linux_errno_h = -e '/usr/include/errno.h' ?
+           '/usr/include/errno.h' : '/usr/local/include/errno.h';
+       $file{$linux_errno_h} = 1;
     } elsif ($^O eq 'MacOS') {
        # note that we are only getting the GUSI errno's here ...
        # we might miss out on compiler-specific ones
index 46fb144..cdca69a 100644 (file)
@@ -1,7 +1,14 @@
 #! /bin/bash
 # machten.sh
 # This is for MachTen 4.1.4.  It might work on other versions and variants
-# too.  If it doesn't, tell me, and I'll try to fix it -- domo@computer.org
+# too.  MachTen is now obsolete, lacks many features expected in modern UNIX
+# implementations, and suffers from a number of bugs which are likely never
+# to be fixed. This means that, in the absence of extensive work on
+# this file and on the perl source code, versions of perl later than 5.6.x
+# cannot successfully be built on MachTen. This file enforces this
+# restriction. Should you wish to port a later version of perl to MachTen,
+# feel free to contact me for pointers.
+#                      -- Dominic Dunlop <domo@computer.org> 040213
 #
 # Users of earlier MachTen versions might need a fixed tr from ftp.tenon.com.
 # This should be described in the MachTen release notes.
@@ -15,6 +22,8 @@
 #      Martijn Koster <m.koster@webcrawler.com>
 #      Richard Yeh <rcyeh@cco.caltech.edu>
 #
+# Prevent building of perls later than 5.6.x, stating why -- see above.
+#                      -- Dominic Dunlop <domo@computer.org> 040213
 # Deny system's false claims to support mmap() and munmap(); note
 # also that Sys V IPC (re)disabled by jhi due to continuing inadequacy
 #                      -- Dominic Dunlop <domo@computer.org> 001111
 # Do not use perl's malloc; SysV IPC OK -- Neil Cutcliffe, Tenon 961030
 # File::Find's use of link count disabled by Dominic Dunlop 960528
 # Perl's use of sigsetjmp etc. disabled by Dominic Dunlop 960521
-#
-# Comments, questions, and improvements welcome!
+
+# Assume that PERL_REVISON in patchlevel.h is 5.
+# If you want to try building perl-5.8.x or later, set PERL_VERSION_SAFE_MAX
+# appropriately in your environment before running Configure.
+if [ `awk '$1=="#define" && $2=="PERL_VERSION"{print $3}' patchlevel.h` \
+      -gt ${PERL_VERSION_SAFE_MAX:-6} ]
+then
+    cat <<EOF >&4
+
+Perl versions greater than 5.6.x have not been ported to MachTen. If you
+wish to build a version from the 5.6 track, please see the notes in
+README.machten
+EOF
+    exit 1
+fi
 #
 # MachTen 4.1.1's support for shadow password file access is incomplete:
 # disable its use completely.
@@ -95,7 +117,7 @@ d_vfork=${d_vfork:-define}
 # Specify a high level of optimization (-O3 wouldn't do much more)
 optimize=${optimize:--O2 -fomit-frame-pointer}
 
-# Make symbol table listings les voluminous
+# Make symbol table listings less voluminous
 nmopts=-gp
 
 # Set reg_infty -- the maximum allowable number of repeats in regular
diff --git a/op.h b/op.h
index e86c667..c917c49 100644 (file)
--- a/op.h
+++ b/op.h
@@ -144,7 +144,7 @@ Deprecated.  Use C<GIMME_V> instead.
 /* Private for OP_REPEAT */
 #define OPpREPEAT_DOLIST       64      /* List replication. */
 
-/* Private for OP_RV2GV, OP_RV2SV, OP_AELEM, OP_AHLEM, OP_PADSV */
+/* Private for OP_RV2GV, OP_RV2SV, OP_AELEM, OP_HELEM, OP_PADSV */
 #define OPpDEREF               (32|64) /* autovivify: Want ref to something: */
 #define OPpDEREF_AV            32      /*   Want ref to AV. */
 #define OPpDEREF_HV            64      /*   Want ref to HV. */
index b9906f8..8f3e6a0 100644 (file)
@@ -89,9 +89,12 @@ BEGIN {
     $::HaveSend = ($@ eq "");
     eval "use Mail::Util;";
     $::HaveUtil = ($@ eq "");
+    # use secure tempfiles wherever possible
+    eval "require File::Temp;";
+    $::HaveTemp = ($@ eq "");
 };
 
-my $Version = "1.34";
+my $Version = "1.35";
 
 # Changed in 1.06 to skip Mail::Send and Mail::Util if not available.
 # Changed in 1.07 to see more sendmail execs, and added pipe output.
@@ -130,6 +133,7 @@ my $Version = "1.34";
 # Changed in 1.32 Use File::Spec->tmpdir TJENNESS 20-08-2000
 # Changed in 1.33 Don't require -t STDOUT for -ok.
 # Changed in 1.34 Added Message-Id RFOLEY 18-06-2002 
+# Changed in 1.35 Use File::Temp (patch from Solar Designer) NWCLARK 28-02-2004
 
 # TODO: - Allow the user to re-name the file on mail failure, and
 #       make sure failure (transmission-wise) of Mail::Send is
@@ -958,10 +962,18 @@ EOF
 }
 
 sub filename {
-    my $dir = File::Spec->tmpdir();
-    $filename = "bugrep0$$";
-    $filename++ while -e File::Spec->catfile($dir, $filename);
-    $filename = File::Spec->catfile($dir, $filename);
+    if ($::HaveTemp) {
+       # Good. Use a secure temp file
+       my ($fh, $filename) = File::Temp::tempfile(UNLINK => 1);
+       close($fh);
+       return $filename;
+    } else {
+       # Bah. Fall back to doing things less securely.
+       my $dir = File::Spec->tmpdir();
+       $filename = "bugrep0$$";
+       $filename++ while -e File::Spec->catfile($dir, $filename);
+       $filename = File::Spec->catfile($dir, $filename);
+    }
 }
 
 sub paraprint {