Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 66360 | Differences between
and this patch

Collapse All | Expand All

(-)perl-5.8.3.orig/ext/DB_File/DB_File.pm (-4 / +4 lines)
Lines 1821-1827 Link Here
1821
    use DB_File ;
1821
    use DB_File ;
1822
1822
1823
    my %hash ;
1823
    my %hash ;
1824
    my $filename = "/tmp/filt" ;
1824
    my $filename = "/var/run/filt" ;
1825
    unlink $filename ;
1825
    unlink $filename ;
1826
1826
1827
    my $db = tie %hash, 'DB_File', $filename, O_CREAT|O_RDWR, 0666, $DB_HASH 
1827
    my $db = tie %hash, 'DB_File', $filename, O_CREAT|O_RDWR, 0666, $DB_HASH 
Lines 1863-1869 Link Here
1863
    use strict ;
1863
    use strict ;
1864
    use DB_File ;
1864
    use DB_File ;
1865
    my %hash ;
1865
    my %hash ;
1866
    my $filename = "/tmp/filt" ;
1866
    my $filename = "/var/run/filt" ;
1867
    unlink $filename ;
1867
    unlink $filename ;
1868
1868
1869
1869
Lines 1894-1901 Link Here
1894
1894
1895
The locking technique went like this. 
1895
The locking technique went like this. 
1896
1896
1897
    $db = tie(%db, 'DB_File', '/tmp/foo.db', O_CREAT|O_RDWR, 0666)
1897
    $db = tie(%db, 'DB_File', '/var/run/foo.db', O_CREAT|O_RDWR, 0644)
1898
        || die "dbcreat /tmp/foo.db $!";
1898
        || die "dbcreat /var/run/foo.db $!";
1899
    $fd = $db->fd;
1899
    $fd = $db->fd;
1900
    open(DB_FH, "+<&=$fd") || die "dup $!";
1900
    open(DB_FH, "+<&=$fd") || die "dup $!";
1901
    flock (DB_FH, LOCK_EX) || die "flock: $!";
1901
    flock (DB_FH, LOCK_EX) || die "flock: $!";
(-)perl-5.8.3.orig/ext/DB_File/t/db-recno.t (-1 / +1 lines)
Lines 1198-1204 Link Here
1198
1198
1199
my $testnum = 181;
1199
my $testnum = 181;
1200
my $failed = 0;
1200
my $failed = 0;
1201
require POSIX; my $tmp = POSIX::tmpnam();
1201
my $tmp = "dbr$$";
1202
foreach my $test (@tests) {
1202
foreach my $test (@tests) {
1203
    my $err = test_splice(@$test);
1203
    my $err = test_splice(@$test);
1204
    if (defined $err) {
1204
    if (defined $err) {
(-)perl-5.8.3.orig/ext/Devel/PPPort/PPPort.pm (-4 / +4 lines)
Lines 349-361 Link Here
349
	}
349
	}
350
	
350
	
351
	if ($changes) {
351
	if ($changes) {
352
		open(OUT,">/tmp/ppport.h.$$");
352
		open(OUT,"ppport.h.$$");
353
		print OUT $c;
353
		print OUT $c;
354
		close(OUT);
354
		close(OUT);
355
		open(DIFF, "diff -u $filename /tmp/ppport.h.$$|");
355
		open(DIFF, "diff -u $filename ppport.h.$$|");
356
		while (<DIFF>) { s!/tmp/ppport\.h\.$$!$filename.patched!; print STDOUT; }
356
		while (<DIFF>) { s!ppport\.h\.$$!$filename.patched!; print STDOUT; }
357
		close(DIFF);
357
		close(DIFF);
358
		unlink("/tmp/ppport.h.$$");
358
		unlink("ppport.h.$$");
359
	} else {
359
	} else {
360
		print "Looks OK\n";
360
		print "Looks OK\n";
361
	}
361
	}
(-)perl-5.8.3.orig/ext/IO/t/io_unix.t (-2 / +2 lines)
Lines 24-30 Link Here
24
	elsif ($^O eq 'os2') {
24
	elsif ($^O eq 'os2') {
25
	    require IO::Socket;
25
	    require IO::Socket;
26
26
27
	    eval {IO::Socket::pack_sockaddr_un('/tmp/foo') || 1}
27
	    eval {IO::Socket::pack_sockaddr_un('/foo/bar') || 1}
28
	      or $@ !~ /not implemented/ or
28
	      or $@ !~ /not implemented/ or
29
		$reason = 'compiled without TCP/IP stack v4';
29
		$reason = 'compiled without TCP/IP stack v4';
30
	} elsif ($^O =~ m/^(?:qnx|nto|vos)$/ ) {
30
	} elsif ($^O =~ m/^(?:qnx|nto|vos)$/ ) {
Lines 37-43 Link Here
37
    }
37
    }
38
}
38
}
39
39
40
$PATH = "/tmp/sock-$$";
40
$PATH = "sock-$$";
41
41
42
# Test if we can create the file within the tmp directory
42
# Test if we can create the file within the tmp directory
43
if (-e $PATH or not open(TEST, ">$PATH") and $^O ne 'os2') {
43
if (-e $PATH or not open(TEST, ">$PATH") and $^O ne 'os2') {
(-)perl-5.8.3.orig/ext/ODBM_File/ODBM_File.xs (-1 / +1 lines)
Lines 32-38 Link Here
32
 * Set DBM_BUG_DUPLICATE_FREE in the extension hint file.
32
 * Set DBM_BUG_DUPLICATE_FREE in the extension hint file.
33
 */
33
 */
34
/* Close the previous dbm, and fail to open a new dbm */
34
/* Close the previous dbm, and fail to open a new dbm */
35
#define dbmclose()	((void) dbminit("/tmp/x/y/z/z/y"))
35
#define dbmclose()	((void) dbminit("/nonexistent"))
36
#endif
36
#endif
37
37
38
#include <fcntl.h>
38
#include <fcntl.h>
(-)perl-5.8.3.orig/ext/POSIX/POSIX.pod (-5 / +5 lines)
Lines 417-425 Link Here
417
uses file descriptors such as those obtained by calling C<POSIX::open>.
417
uses file descriptors such as those obtained by calling C<POSIX::open>.
418
418
419
The following will determine the maximum length of the longest allowable
419
The following will determine the maximum length of the longest allowable
420
pathname on the filesystem which holds C</tmp/foo>.
420
pathname on the filesystem which holds C</var/foo>.
421
421
422
	$fd = POSIX::open( "/tmp/foo", &POSIX::O_RDONLY );
422
	$fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
423
	$path_max = POSIX::fpathconf( $fd, &POSIX::_PC_PATH_MAX );
423
	$path_max = POSIX::fpathconf( $fd, &POSIX::_PC_PATH_MAX );
424
424
425
Returns C<undef> on failure.
425
Returns C<undef> on failure.
Lines 919-925 Link Here
919
919
920
Open a directory for reading.
920
Open a directory for reading.
921
921
922
	$dir = POSIX::opendir( "/tmp" );
922
	$dir = POSIX::opendir( "/var" );
923
	@files = POSIX::readdir( $dir );
923
	@files = POSIX::readdir( $dir );
924
	POSIX::closedir( $dir );
924
	POSIX::closedir( $dir );
925
925
Lines 930-938 Link Here
930
Retrieves the value of a configurable limit on a file or directory.
930
Retrieves the value of a configurable limit on a file or directory.
931
931
932
The following will determine the maximum length of the longest allowable
932
The following will determine the maximum length of the longest allowable
933
pathname on the filesystem which holds C</tmp>.
933
pathname on the filesystem which holds C</var>.
934
934
935
	$path_max = POSIX::pathconf( "/tmp", &POSIX::_PC_PATH_MAX );
935
	$path_max = POSIX::pathconf( "/var", &POSIX::_PC_PATH_MAX );
936
936
937
Returns C<undef> on failure.
937
Returns C<undef> on failure.
938
938
(-)perl-5.8.3.orig/ext/Socket/Socket.pm (-2 / +2 lines)
Lines 32-39 Link Here
32
32
33
    $proto = getprotobyname('tcp');
33
    $proto = getprotobyname('tcp');
34
    socket(Socket_Handle, PF_UNIX, SOCK_STREAM, $proto);
34
    socket(Socket_Handle, PF_UNIX, SOCK_STREAM, $proto);
35
    unlink('/tmp/usock');
35
    unlink('/var/run/usock');
36
    $sun = sockaddr_un('/tmp/usock');
36
    $sun = sockaddr_un('/var/run/usock');
37
    connect(Socket_Handle,$sun);
37
    connect(Socket_Handle,$sun);
38
38
39
=head1 DESCRIPTION
39
=head1 DESCRIPTION
(-)perl-5.8.3.orig/ext/Storable/Storable.pm (-3 / +3 lines)
Lines 786-795 Link Here
786
786
787
	%color = ('Blue' => 0.1, 'Red' => 0.8, 'Black' => 0, 'White' => 1);
787
	%color = ('Blue' => 0.1, 'Red' => 0.8, 'Black' => 0, 'White' => 1);
788
788
789
	store(\%color, '/tmp/colors') or die "Can't store %a in /tmp/colors!\n";
789
	store(\%color, '/var/run/colors') or die "Can't store %a in /var/run/colors!\n";
790
790
791
	$colref = retrieve('/tmp/colors');
791
	$colref = retrieve('/var/run/colors');
792
	die "Unable to retrieve from /tmp/colors!\n" unless defined $colref;
792
	die "Unable to retrieve from /var/run/colors!\n" unless defined $colref;
793
	printf "Blue is still %lf\n", $colref->{'Blue'};
793
	printf "Blue is still %lf\n", $colref->{'Blue'};
794
794
795
	$colref2 = dclone(\%color);
795
	$colref2 = dclone(\%color);
(-)perl-5.8.3.orig/ext/Time/HiRes/Makefile.PL (-9 / +1 lines)
Lines 71-89 Link Here
71
# without changing it, and then I'd always forget to change it before a
71
# without changing it, and then I'd always forget to change it before a
72
# release. Sorry, Edward :)
72
# release. Sorry, Edward :)
73
73
74
sub TMPDIR {
75
    my $TMPDIR =
76
	(grep(defined $_ && -d $_ && -w _,
77
	      ((defined $ENV{'TMPDIR'} ? $ENV{'TMPDIR'} : undef),
78
	       qw(/var/tmp /usr/tmp /tmp c:/temp))))[0];
79
    $TMPDIR || die "Cannot find writable temporary directory.\n";
80
}
81
82
sub try_compile_and_link {
74
sub try_compile_and_link {
83
    my ($c, %args) = @_;
75
    my ($c, %args) = @_;
84
76
85
    my ($ok) = 0;
77
    my ($ok) = 0;
86
    my ($tmp) = (($^O eq 'VMS') ? "sys\$scratch:tmp$$" : TMPDIR() . '/' . "tmp$$");
78
    my ($tmp) = "tmp$$";
87
    local(*TMPC);
79
    local(*TMPC);
88
80
89
    my $obj_ext = $Config{obj_ext} || ".o";
81
    my $obj_ext = $Config{obj_ext} || ".o";
(-)perl-5.8.3.orig/lib/CGI/Cookie.pm (-1 / +1 lines)
Lines 407-413 Link Here
407
You may also retrieve cookies that were stored in some external
407
You may also retrieve cookies that were stored in some external
408
form using the parse() class method:
408
form using the parse() class method:
409
409
410
       $COOKIES = `cat /usr/tmp/Cookie_stash`;
410
       $COOKIES = `cat /var/run/www/Cookie_stash`;
411
       %cookies = parse CGI::Cookie($COOKIES);
411
       %cookies = parse CGI::Cookie($COOKIES);
412
412
413
If you are in a mod_perl environment, you can save some overhead by
413
If you are in a mod_perl environment, you can save some overhead by
(-)perl-5.8.3.orig/lib/CGI.pm (+3 lines)
Lines 2-7 Link Here
2
require 5.004;
2
require 5.004;
3
use Carp 'croak';
3
use Carp 'croak';
4
4
5
# XXX: The temporary file handling implemented in here is crap.  It should
6
# be re-done making use of File::Temp.
7
5
# See the bottom of this file for the POD documentation.  Search for the
8
# See the bottom of this file for the POD documentation.  Search for the
6
# string '=head'.
9
# string '=head'.
7
10
(-)perl-5.8.3.orig/lib/CPAN.pm (-1 / +1 lines)
Lines 2273-2279 Link Here
2273
# If more accuracy is wanted/needed, Chris Leach sent me this patch...
2273
# If more accuracy is wanted/needed, Chris Leach sent me this patch...
2274
2274
2275
 # > *** /install/perl/live/lib/CPAN.pm-	Wed Sep 24 13:08:48 1997
2275
 # > *** /install/perl/live/lib/CPAN.pm-	Wed Sep 24 13:08:48 1997
2276
 # > --- /tmp/cp	Wed Sep 24 13:26:40 1997
2276
 # > --- cp	Wed Sep 24 13:26:40 1997
2277
 # > ***************
2277
 # > ***************
2278
 # > *** 1562,1567 ****
2278
 # > *** 1562,1567 ****
2279
 # > --- 1562,1580 ----
2279
 # > --- 1562,1580 ----
(-)perl-5.8.3.orig/lib/ExtUtils/MakeMaker.pm (-4 / +4 lines)
Lines 1013-1019 Link Here
1013
The Makefile to be produced may be altered by adding arguments of the
1013
The Makefile to be produced may be altered by adding arguments of the
1014
form C<KEY=VALUE>. E.g.
1014
form C<KEY=VALUE>. E.g.
1015
1015
1016
  perl Makefile.PL PREFIX=/tmp/myperl5
1016
  perl Makefile.PL PREFIX=~/myperl5
1017
1017
1018
Other interesting targets in the generated Makefile are
1018
Other interesting targets in the generated Makefile are
1019
1019
Lines 1355-1367 Link Here
1355
1355
1356
This is the root directory into which the code will be installed.  It
1356
This is the root directory into which the code will be installed.  It
1357
I<prepends itself to the normal prefix>.  For example, if your code
1357
I<prepends itself to the normal prefix>.  For example, if your code
1358
would normally go into /usr/local/lib/perl you could set DESTDIR=/tmp/
1358
would normally go into /usr/local/lib/perl you could set DESTDIR=/other/
1359
and installation would go into /tmp/usr/local/lib/perl.
1359
and installation would go into /other/usr/local/lib/perl.
1360
1360
1361
This is primarily of use for people who repackage Perl modules.
1361
This is primarily of use for people who repackage Perl modules.
1362
1362
1363
NOTE: Due to the nature of make, it is important that you put the trailing
1363
NOTE: Due to the nature of make, it is important that you put the trailing
1364
slash on your DESTDIR.  "/tmp/" not "/tmp".
1364
slash on your DESTDIR.  "/other/" not "/other".
1365
1365
1366
=item DIR
1366
=item DIR
1367
1367
(-)perl-5.8.3.orig/lib/ExtUtils/instmodsh (-10 / +7 lines)
Lines 2-7 Link Here
2
2
3
use strict;
3
use strict;
4
use IO::File;
4
use IO::File;
5
use File::Temp;
5
use ExtUtils::Packlist;
6
use ExtUtils::Packlist;
6
use ExtUtils::Installed;
7
use ExtUtils::Installed;
7
8
Lines 58-73 Link Here
58
      $reply =~ /^t\s*/ and do
59
      $reply =~ /^t\s*/ and do
59
         {
60
         {
60
         my $file = (split(' ', $reply))[1];
61
         my $file = (split(' ', $reply))[1];
61
         my $tmp = "/tmp/inst.$$";
62
         my ($fh, $tmp) = File::Temp::tempfile(UNLINK => 1);
62
         if (my $fh = IO::File->new($tmp, "w"))
63
         $fh->print(join("\n", $Inst->files($module)));
63
            {
64
         $fh->close();
64
            $fh->print(join("\n", $Inst->files($module)));
65
         # This used to use -I which is wrong for GNU tar.
65
            $fh->close();
66
         system("tar cvf $file -T $tmp");
66
            system("tar cvf $file -I $tmp");
67
         unlink($tmp);
67
            unlink($tmp);
68
            last CASE;
69
            }
70
         else { print("Can't open $file: $!\n"); }
71
         last CASE;
68
         last CASE;
72
         };
69
         };
73
      $reply eq 'v' and do
70
      $reply eq 'v' and do
(-)perl-5.8.3.orig/lib/Memoize/t/tie.t (-8 / +1 lines)
Lines 29-42 Link Here
29
  $_[0]+1;
29
  $_[0]+1;
30
}
30
}
31
31
32
if (eval {require File::Spec::Functions}) {
32
$file = "md$$";
33
  File::Spec::Functions->import('tmpdir', 'catfile');
34
  $tmpdir = tmpdir();
35
} else {
36
  *catfile = sub { join '/', @_ };
37
  $tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
38
}
39
$file = catfile($tmpdir, "md$$");
40
@files = ($file, "$file.db", "$file.dir", "$file.pag");
33
@files = ($file, "$file.db", "$file.dir", "$file.pag");
41
1 while unlink @files;
34
1 while unlink @files;
42
35
(-)perl-5.8.3.orig/lib/Memoize/t/tie_gdbm.t (-7 / +1 lines)
Lines 26-38 Link Here
26
26
27
print "1..4\n";
27
print "1..4\n";
28
28
29
if (eval {require File::Spec::Functions}) {
29
$file = "md$$";
30
 File::Spec::Functions->import();
31
} else {
32
  *catfile = sub { join '/', @_ };
33
}
34
$tmpdir = $ENV{TMP} || $ENV{TMPDIR} ||  '/tmp';  
35
$file = catfile($tmpdir, "md$$");
36
1 while unlink $file, "$file.dir", "$file.pag";
30
1 while unlink $file, "$file.dir", "$file.pag";
37
tryout('GDBM_File', $file, 1);  # Test 1..4
31
tryout('GDBM_File', $file, 1);  # Test 1..4
38
1 while unlink $file, "$file.dir", "$file.pag";
32
1 while unlink $file, "$file.dir", "$file.pag";
(-)perl-5.8.3.orig/lib/Memoize/t/tie_ndbm.t (-8 / +1 lines)
Lines 28-41 Link Here
28
28
29
print "1..4\n";
29
print "1..4\n";
30
30
31
31
$file = "md$$";
32
if (eval {require File::Spec::Functions}) {
33
 File::Spec::Functions->import();
34
} else {
35
  *catfile = sub { join '/', @_ };
36
}
37
$tmpdir = $ENV{TMP} || $ENV{TMPDIR} ||  '/tmp';  
38
$file = catfile($tmpdir, "md$$");
39
1 while unlink $file, "$file.dir", "$file.pag";
32
1 while unlink $file, "$file.dir", "$file.pag";
40
tryout('Memoize::NDBM_File', $file, 1);  # Test 1..4
33
tryout('Memoize::NDBM_File', $file, 1);  # Test 1..4
41
1 while unlink $file, "$file.dir", "$file.pag";
34
1 while unlink $file, "$file.dir", "$file.pag";
(-)perl-5.8.3.orig/lib/Memoize/t/tie_sdbm.t (-8 / +1 lines)
Lines 28-41 Link Here
28
28
29
print "1..4\n";
29
print "1..4\n";
30
30
31
if (eval {require File::Spec::Functions}) {
31
$file = "md$$";
32
 File::Spec::Functions->import('tmpdir', 'catfile');
33
 $tmpdir = tmpdir();
34
} else {
35
 *catfile = sub { join '/', @_ };
36
  $tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
37
}
38
$file = catfile($tmpdir, "md$$");
39
1 while unlink $file, "$file.dir", "$file.pag";
32
1 while unlink $file, "$file.dir", "$file.pag";
40
tryout('Memoize::SDBM_File', $file, 1);  # Test 1..4
33
tryout('Memoize::SDBM_File', $file, 1);  # Test 1..4
41
1 while unlink $file, "$file.dir", "$file.pag";
34
1 while unlink $file, "$file.dir", "$file.pag";
(-)perl-5.8.3.orig/lib/Memoize/t/tie_storable.t (-8 / +1 lines)
Lines 33-46 Link Here
33
33
34
print "1..4\n";
34
print "1..4\n";
35
35
36
36
$file = "storable$$";
37
if (eval {require File::Spec::Functions}) {
38
 File::Spec::Functions->import();
39
} else {
40
  *catfile = sub { join '/', @_ };
41
}
42
$tmpdir = $ENV{TMP} || $ENV{TMPDIR} ||  '/tmp';  
43
$file = catfile($tmpdir, "storable$$");
44
1 while unlink $file;
37
1 while unlink $file;
45
tryout('Memoize::Storable', $file, 1);  # Test 1..4
38
tryout('Memoize::Storable', $file, 1);  # Test 1..4
46
1 while unlink $file;
39
1 while unlink $file;
(-)perl-5.8.3.orig/lib/Shell.pm (-1 / +1 lines)
Lines 140-146 Link Here
140
    sub ps;
140
    sub ps;
141
    print ps -ww;
141
    print ps -ww;
142
142
143
    cp("/etc/passwd", "/tmp/passwd");
143
    cp("/etc/passwd", "/etc/passwd.orig");
144
144
145
That's maybe too gonzo.  It actually exports an AUTOLOAD to the current
145
That's maybe too gonzo.  It actually exports an AUTOLOAD to the current
146
package (and uncovered a bug in Beta 3, by the way).  Maybe the usual
146
package (and uncovered a bug in Beta 3, by the way).  Maybe the usual
(-)perl-5.8.3.orig/lib/dotsh.pl (-7 / +5 lines)
Lines 27-35 Link Here
27
#         dependent upon. These variables MUST be defined using shell syntax.
27
#         dependent upon. These variables MUST be defined using shell syntax.
28
#
28
#
29
#   Example:
29
#   Example:
30
#      &dotsh ('/tmp/foo', 'arg1');
30
#      &dotsh ('/foo/bar', 'arg1');
31
#      &dotsh ('/tmp/foo');
31
#      &dotsh ('/foo/bar');
32
#      &dotsh ('/tmp/foo arg1 ... argN');
32
#      &dotsh ('/foo/bar arg1 ... argN');
33
#
33
#
34
sub dotsh {
34
sub dotsh {
35
   local(@sh) = @_;
35
   local(@sh) = @_;
Lines 54-72 Link Here
54
      }
54
      }
55
   }
55
   }
56
   if (length($vars) > 0) {
56
   if (length($vars) > 0) {
57
      system "$shell \"$vars;. $command $args; set > /tmp/_sh_env$$\"";
57
      open (_SH_ENV, "$shell \"$vars && . $command $args && set \" |") || die;
58
   } else {
58
   } else {
59
      system "$shell \". $command $args; set > /tmp/_sh_env$$\"";
59
      open (_SH_ENV, "$shell \". $command $args && set \" |") || die;
60
   }
60
   }
61
61
62
   open (_SH_ENV, "/tmp/_sh_env$$") || die "Could not open /tmp/_sh_env$$!\n";
63
   while (<_SH_ENV>) {
62
   while (<_SH_ENV>) {
64
       chop;
63
       chop;
65
       m/^([^=]*)=(.*)/s;
64
       m/^([^=]*)=(.*)/s;
66
       $ENV{$1} = $2;
65
       $ENV{$1} = $2;
67
   }
66
   }
68
   close (_SH_ENV);
67
   close (_SH_ENV);
69
   system "rm -f /tmp/_sh_env$$";
70
68
71
   foreach $key (keys(%ENV)) {
69
   foreach $key (keys(%ENV)) {
72
       $tmp .= "\$$key = \$ENV{'$key'};" if $key =~ /^[A-Za-z]\w*$/;
70
       $tmp .= "\$$key = \$ENV{'$key'};" if $key =~ /^[A-Za-z]\w*$/;
(-)perl-5.8.3.orig/lib/perl5db.pl (-3 / +3 lines)
Lines 206-212 Link Here
206
=item * noTTY 
206
=item * noTTY 
207
207
208
if set, goes in NonStop mode.  On interrupt, if TTY is not set,
208
if set, goes in NonStop mode.  On interrupt, if TTY is not set,
209
uses the value of noTTY or "/tmp/perldbtty$$" to find TTY using
209
uses the value of noTTY or "/var/run/perldbtty$$" to find TTY using
210
Term::Rendezvous.  Current variant is to have the name of TTY in this
210
Term::Rendezvous.  Current variant is to have the name of TTY in this
211
file.
211
file.
212
212
Lines 5689-5696 Link Here
5689
        else {
5689
        else {
5690
            eval "require Term::Rendezvous;" or die;
5690
            eval "require Term::Rendezvous;" or die;
5691
            # See if we have anything to pass to Term::Rendezvous.
5691
            # See if we have anything to pass to Term::Rendezvous.
5692
            # Use /tmp/perldbtty$$ if not.
5692
            # Use /var/run/perldbtty$$ if not.
5693
            my $rv = $ENV{PERLDB_NOTTY} || "/tmp/perldbtty$$";
5693
            my $rv = $ENV{PERLDB_NOTTY} || "/var/run/perldbtty$$";
5694
5694
5695
            # Rendezvous and get the filehandles.
5695
            # Rendezvous and get the filehandles.
5696
            my $term_rv = new Term::Rendezvous $rv;
5696
            my $term_rv = new Term::Rendezvous $rv;
(-)perl-5.8.3.orig/mpeix/nm (-3 / +3 lines)
Lines 22-33 Link Here
22
# I wanted to pipe this into awk, but it fell victim to a known pipe/streams
22
# I wanted to pipe this into awk, but it fell victim to a known pipe/streams
23
# bug on my multiprocessor machine.
23
# bug on my multiprocessor machine.
24
24
25
callci xeq linkedit.pub.sys \"$LIST\" >/tmp/nm.$$
25
callci xeq linkedit.pub.sys \"$LIST\" >nm.$$
26
26
27
/bin/awk '\
27
/bin/awk '\
28
    / data  univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$5,"extern","data","?"} \
28
    / data  univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$5,"extern","data","?"} \
29
    / entry univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$7,"extern","entry","?"}' /tmp/nm.$$
29
    / entry univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$7,"extern","entry","?"}' nm.$$
30
30
31
rm -f /tmp/nm.$$
31
rm -f nm.$$
32
32
33
exit 0
33
exit 0
(-)perl-5.8.3.orig/mpeix/relink (-1 / +1 lines)
Lines 14-20 Link Here
14
14
15
echo "Creating $RAND.sl...\n"
15
echo "Creating $RAND.sl...\n"
16
16
17
TEMP=/tmp/perlmpe.$$
17
TEMP=perlmpe.$$
18
18
19
rm -f $TEMP $RAND.a $RAND.sl
19
rm -f $TEMP $RAND.a $RAND.sl
20
20
(-)perl-5.8.3.orig/perly.fixer (-1 / +1 lines)
Lines 23-29 Link Here
23
23
24
input=$1
24
input=$1
25
output=$2
25
output=$2
26
tmp=/tmp/f$$
26
tmp=perly$$
27
27
28
inputh=`echo $input|sed 's:\.c$:.h:'`
28
inputh=`echo $input|sed 's:\.c$:.h:'`
29
if grep '^#ifdef PERL_CORE' $inputh; then
29
if grep '^#ifdef PERL_CORE' $inputh; then
(-)perl-5.8.3.orig/pod/perl571delta.pod (-4 / +4 lines)
Lines 771-787 Link Here
771
If your file system supports symbolic links you can build Perl outside
771
If your file system supports symbolic links you can build Perl outside
772
of the source directory by
772
of the source directory by
773
773
774
	mkdir /tmp/perl/build/directory
774
	mkdir perl/build/directory
775
	cd /tmp/perl/build/directory
775
	cd perl/build/directory
776
	sh /path/to/perl/source/Configure -Dmksymlinks ...
776
	sh /path/to/perl/source/Configure -Dmksymlinks ...
777
777
778
This will create in /tmp/perl/build/directory a tree of symbolic links
778
This will create in perl/build/directory a tree of symbolic links
779
pointing to files in /path/to/perl/source.  The original files are left
779
pointing to files in /path/to/perl/source.  The original files are left
780
unaffected.  After Configure has finished you can just say
780
unaffected.  After Configure has finished you can just say
781
781
782
	make all test
782
	make all test
783
783
784
and Perl will be built and tested, all in /tmp/perl/build/directory.
784
and Perl will be built and tested, all in perl/build/directory.
785
785
786
=back
786
=back
787
787
(-)perl-5.8.3.orig/pod/perl58delta.pod (-4 / +4 lines)
Lines 1905-1921 Link Here
1905
If your file system supports symbolic links, you can build Perl outside
1905
If your file system supports symbolic links, you can build Perl outside
1906
of the source directory by
1906
of the source directory by
1907
1907
1908
	mkdir /tmp/perl/build/directory
1908
	mkdir perl/build/directory
1909
	cd /tmp/perl/build/directory
1909
	cd perl/build/directory
1910
	sh /path/to/perl/source/Configure -Dmksymlinks ...
1910
	sh /path/to/perl/source/Configure -Dmksymlinks ...
1911
1911
1912
This will create in /tmp/perl/build/directory a tree of symbolic links
1912
This will create in perl/build/directory a tree of symbolic links
1913
pointing to files in /path/to/perl/source.  The original files are left
1913
pointing to files in /path/to/perl/source.  The original files are left
1914
unaffected.  After Configure has finished, you can just say
1914
unaffected.  After Configure has finished, you can just say
1915
1915
1916
	make all test
1916
	make all test
1917
1917
1918
and Perl will be built and tested, all in /tmp/perl/build/directory.
1918
and Perl will be built and tested, all in perl/build/directory.
1919
[561]
1919
[561]
1920
1920
1921
=item *
1921
=item *
(-)perl-5.8.3.orig/pod/perldbmfilter.pod (-2 / +2 lines)
Lines 91-97 Link Here
91
    use Fcntl ;
91
    use Fcntl ;
92
92
93
    my %hash ;
93
    my %hash ;
94
    my $filename = "/tmp/filt" ;
94
    my $filename = "/var/run/filt" ;
95
    unlink $filename ;
95
    unlink $filename ;
96
96
97
    my $db = tie(%hash, 'SDBM_File', $filename, O_RDWR|O_CREAT, 0640)
97
    my $db = tie(%hash, 'SDBM_File', $filename, O_RDWR|O_CREAT, 0640)
Lines 137-143 Link Here
137
    use warnings ;
137
    use warnings ;
138
    use DB_File ;
138
    use DB_File ;
139
    my %hash ;
139
    my %hash ;
140
    my $filename = "/tmp/filt" ;
140
    my $filename = "/var/run/filt" ;
141
    unlink $filename ;
141
    unlink $filename ;
142
142
143
143
(-)perl-5.8.3.orig/pod/perldebug.pod (-1 / +1 lines)
Lines 700-706 Link Here
700
with two methods: C<IN> and C<OUT>.  These should return filehandles to use
700
with two methods: C<IN> and C<OUT>.  These should return filehandles to use
701
for debugging input and output correspondingly.  The C<new> method should
701
for debugging input and output correspondingly.  The C<new> method should
702
inspect an argument containing the value of C<$ENV{PERLDB_NOTTY}> at
702
inspect an argument containing the value of C<$ENV{PERLDB_NOTTY}> at
703
startup, or C<"/tmp/perldbtty$$"> otherwise.  This file is not 
703
startup, or C<"/var/run/perldbtty$$"> otherwise.  This file is not 
704
inspected for proper ownership, so security hazards are theoretically
704
inspected for proper ownership, so security hazards are theoretically
705
possible.
705
possible.
706
706
(-)perl-5.8.3.orig/pod/perlfaq5.pod (-3 / +4 lines)
Lines 141-146 Link Here
141
	    my $count = 0;
141
	    my $count = 0;
142
	    until (defined(fileno(FH)) || $count++ > 100) {
142
	    until (defined(fileno(FH)) || $count++ > 100) {
143
		$base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
143
		$base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
144
		# O_EXCL is required for security reasons.
144
		sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
145
		sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
145
	    }
146
	    }
146
	    if (defined(fileno(FH))
147
	    if (defined(fileno(FH))
Lines 427-434 Link Here
427
428
428
To open a file without blocking, creating if necessary:
429
To open a file without blocking, creating if necessary:
429
430
430
    sysopen(FH, "/tmp/somefile", O_WRONLY|O_NDELAY|O_CREAT)
431
    sysopen(FH, "/foo/somefile", O_WRONLY|O_NDELAY|O_CREAT)
431
	    or die "can't open /tmp/somefile: $!":
432
	    or die "can't open /foo/somefile: $!":
432
433
433
Be warned that neither creation nor deletion of files is guaranteed to
434
Be warned that neither creation nor deletion of files is guaranteed to
434
be an atomic operation over NFS.  That is, two processes might both
435
be an atomic operation over NFS.  That is, two processes might both
Lines 924-930 Link Here
924
If you check L<perlfunc/open>, you'll see that several of the ways
925
If you check L<perlfunc/open>, you'll see that several of the ways
925
to call open() should do the trick.  For example:
926
to call open() should do the trick.  For example:
926
927
927
    open(LOG, ">>/tmp/logfile");
928
    open(LOG, ">>/foo/logfile");
928
    open(STDERR, ">&LOG");
929
    open(STDERR, ">&LOG");
929
930
930
Or even with a literal numeric descriptor:
931
Or even with a literal numeric descriptor:
(-)perl-5.8.3.orig/pod/perlfaq8.pod (-5 / +5 lines)
Lines 749-758 Link Here
749
    while (<PH>) { }                            #    plus a read
749
    while (<PH>) { }                            #    plus a read
750
750
751
To read both a command's STDOUT and its STDERR separately, it's easiest
751
To read both a command's STDOUT and its STDERR separately, it's easiest
752
and safest to redirect them separately to files, and then read from those
752
to redirect them separately to files, and then read from those files
753
files when the program is done:
753
when the program is done:
754
754
755
    system("program args 1>/tmp/program.stdout 2>/tmp/program.stderr");
755
    system("program args 1>program.stdout 2>program.stderr");
756
756
757
Ordering is important in all these examples.  That's because the shell
757
Ordering is important in all these examples.  That's because the shell
758
processes file descriptor redirections in strictly left to right order.
758
processes file descriptor redirections in strictly left to right order.
Lines 1063-1070 Link Here
1063
sysopen():
1063
sysopen():
1064
1064
1065
    use Fcntl;
1065
    use Fcntl;
1066
    sysopen(FH, "/tmp/somefile", O_WRONLY|O_NDELAY|O_CREAT, 0644)
1066
    sysopen(FH, "/foo/somefile", O_WRONLY|O_NDELAY|O_CREAT, 0644)
1067
        or die "can't open /tmp/somefile: $!":
1067
        or die "can't open /foo/somefile: $!":
1068
1068
1069
=head2 How do I install a module from CPAN?
1069
=head2 How do I install a module from CPAN?
1070
1070
(-)perl-5.8.3.orig/pod/perlfunc.pod (-1 / +1 lines)
Lines 2928-2934 Link Here
2928
    open(ARTICLE, "caesar <$article |")		# ditto
2928
    open(ARTICLE, "caesar <$article |")		# ditto
2929
	or die "Can't start caesar: $!";
2929
	or die "Can't start caesar: $!";
2930
2930
2931
    open(EXTRACT, "|sort >/tmp/Tmp$$")		# $$ is our process id
2931
    open(EXTRACT, "|sort >Tmp$$")		# $$ is our process id
2932
	or die "Can't start sort: $!";
2932
	or die "Can't start sort: $!";
2933
2933
2934
    # in memory files
2934
    # in memory files
(-)perl-5.8.3.orig/pod/perlipc.pod (-2 / +2 lines)
Lines 1030-1036 Link Here
1030
    use strict;
1030
    use strict;
1031
    my ($rendezvous, $line);
1031
    my ($rendezvous, $line);
1032
1032
1033
    $rendezvous = shift || '/tmp/catsock';
1033
    $rendezvous = shift || 'catsock';
1034
    socket(SOCK, PF_UNIX, SOCK_STREAM, 0)	|| die "socket: $!";
1034
    socket(SOCK, PF_UNIX, SOCK_STREAM, 0)	|| die "socket: $!";
1035
    connect(SOCK, sockaddr_un($rendezvous))	|| die "connect: $!";
1035
    connect(SOCK, sockaddr_un($rendezvous))	|| die "connect: $!";
1036
    while (defined($line = <SOCK>)) {
1036
    while (defined($line = <SOCK>)) {
Lines 1051-1057 Link Here
1051
    sub spawn;  # forward declaration
1051
    sub spawn;  # forward declaration
1052
    sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" }
1052
    sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" }
1053
1053
1054
    my $NAME = '/tmp/catsock';
1054
    my $NAME = 'catsock';
1055
    my $uaddr = sockaddr_un($NAME);
1055
    my $uaddr = sockaddr_un($NAME);
1056
    my $proto = getprotobyname('tcp');
1056
    my $proto = getprotobyname('tcp');
1057
1057
(-)perl-5.8.3.orig/pod/perllexwarn.pod (-2 / +2 lines)
Lines 381-389 Link Here
381
    sub open {
381
    sub open {
382
        my $path = shift ;
382
        my $path = shift ;
383
        if ($path !~ m#^/#) {
383
        if ($path !~ m#^/#) {
384
            warnings::warn("changing relative path to /tmp/")
384
            warnings::warn("changing relative path to /var/abc")
385
                if warnings::enabled();
385
                if warnings::enabled();
386
            $path = "/tmp/$path" ; 
386
            $path = "/var/abc/$path";
387
        }
387
        }
388
    }
388
    }
389
389
(-)perl-5.8.3.orig/pod/perlobj.pod (-8 / +8 lines)
Lines 535-549 Link Here
535
    warn "time to die...";
535
    warn "time to die...";
536
    exit;
536
    exit;
537
537
538
When run as F</tmp/test>, the following output is produced:
538
When run as F</foo/test>, the following output is produced:
539
539
540
    starting program at /tmp/test line 18.
540
    starting program at /foo/test line 18.
541
    CREATING SCALAR(0x8e5b8) at /tmp/test line 7.
541
    CREATING SCALAR(0x8e5b8) at /foo/test line 7.
542
    CREATING SCALAR(0x8e57c) at /tmp/test line 7.
542
    CREATING SCALAR(0x8e57c) at /foo/test line 7.
543
    leaving block at /tmp/test line 23.
543
    leaving block at /foo/test line 23.
544
    DESTROYING Subtle=SCALAR(0x8e5b8) at /tmp/test line 13.
544
    DESTROYING Subtle=SCALAR(0x8e5b8) at /foo/test line 13.
545
    just exited block at /tmp/test line 26.
545
    just exited block at /foo/test line 26.
546
    time to die... at /tmp/test line 27.
546
    time to die... at /foo/test line 27.
547
    DESTROYING Subtle=SCALAR(0x8e57c) during global destruction.
547
    DESTROYING Subtle=SCALAR(0x8e57c) during global destruction.
548
548
549
Notice that "global destruction" bit there?  That's the thread
549
Notice that "global destruction" bit there?  That's the thread
(-)perl-5.8.3.orig/pod/perlop.pod (-3 / +3 lines)
Lines 1160-1169 Link Here
1160
    $output = `cmd 3>&1 1>&2 2>&3 3>&-`;
1160
    $output = `cmd 3>&1 1>&2 2>&3 3>&-`;
1161
1161
1162
To read both a command's STDOUT and its STDERR separately, it's easiest
1162
To read both a command's STDOUT and its STDERR separately, it's easiest
1163
and safest to redirect them separately to files, and then read from those
1163
to redirect them separately to files, and then read from those files
1164
files when the program is done:
1164
when the program is done:
1165
1165
1166
    system("program args 1>/tmp/program.stdout 2>/tmp/program.stderr");
1166
    system("program args 1>program.stdout 2>program.stderr");
1167
1167
1168
Using single-quote as a delimiter protects the command from Perl's
1168
Using single-quote as a delimiter protects the command from Perl's
1169
double-quote interpolation, passing it on to the shell instead:
1169
double-quote interpolation, passing it on to the shell instead:
(-)perl-5.8.3.orig/pod/perlopentut.pod (-4 / +4 lines)
Lines 192-202 Link Here
192
    open(WTMP, "+< /usr/adm/wtmp") 
192
    open(WTMP, "+< /usr/adm/wtmp") 
193
        || die "can't open /usr/adm/wtmp: $!";
193
        || die "can't open /usr/adm/wtmp: $!";
194
194
195
    open(SCREEN, "+> /tmp/lkscreen")
195
    open(SCREEN, "+> lkscreen")
196
        || die "can't open /tmp/lkscreen: $!";
196
        || die "can't open lkscreen: $!";
197
197
198
    open(LOGFILE, "+>> /tmp/applog"
198
    open(LOGFILE, "+>> /var/log/applog"
199
        || die "can't open /tmp/applog: $!";
199
        || die "can't open /var/log/applog: $!";
200
200
201
The first one won't create a new file, and the second one will always
201
The first one won't create a new file, and the second one will always
202
clobber an old one.  The third one will create a new file if necessary
202
clobber an old one.  The third one will create a new file if necessary
(-)perl-5.8.3.orig/utils/c2ph.PL (-8 / +16 lines)
Lines 280-285 Link Here
280
280
281
$RCSID = '$Id: c2ph,v 1.7 95/10/28 10:41:47 tchrist Exp Locker: tchrist $';
281
$RCSID = '$Id: c2ph,v 1.7 95/10/28 10:41:47 tchrist Exp Locker: tchrist $';
282
282
283
use File::Temp;
283
284
284
######################################################################
285
######################################################################
285
286
Lines 480-485 Link Here
480
    printf "%-16s%-15s  %s\n", $var, eval "\$$var", $msg;
481
    printf "%-16s%-15s  %s\n", $var, eval "\$$var", $msg;
481
}
482
}
482
483
484
sub safedir {
485
    $SAFEDIR = File::Temp::tempdir("c2ph.XXXXXX", TMPDIR => 1, CLEANUP => 1)
486
      unless (defined($SAFEDIR));
487
}
488
489
undef $SAFEDIR;
490
483
$recurse = 1;
491
$recurse = 1;
484
492
485
if (@ARGV) {
493
if (@ARGV) {
Lines 495-509 Link Here
495
    }
503
    }
496
    elsif (@ARGV == 1 && $ARGV[0] =~ /\.c$/) {
504
    elsif (@ARGV == 1 && $ARGV[0] =~ /\.c$/) {
497
	local($dir, $file) = $ARGV[0] =~ m#(.*/)?(.*)$#;
505
	local($dir, $file) = $ARGV[0] =~ m#(.*/)?(.*)$#;
498
	$chdir = "cd $dir; " if $dir;
506
	$chdir = "cd $dir && " if $dir;
499
	&system("$chdir$CC $CFLAGS $DEFINES $file") && exit 1;
507
	&system("$chdir$CC $CFLAGS $DEFINES $file") && exit 1;
500
	$ARGV[0] =~ s/\.c$/.s/;
508
	$ARGV[0] =~ s/\.c$/.s/;
501
    }
509
    }
502
    else {
510
    else {
503
	$TMPDIR = tempdir(CLEANUP => 1);
511
	&safedir;
504
	$TMP = "$TMPDIR/c2ph.$$.c";
512
	$TMP = "$SAFEDIR/c2ph.$$.c";
505
	&system("cat @ARGV > $TMP") && exit 1;
513
	&system("cat @ARGV > $TMP") && exit 1;
506
	&system("cd $TMPDIR; $CC $CFLAGS $DEFINES $TMP") && exit 1;
514
	&system("cd $SAFEDIR && $CC $CFLAGS $DEFINES $TMP") && exit 1;
507
	unlink $TMP;
515
	unlink $TMP;
508
	$TMP =~ s/\.c$/.s/;
516
	$TMP =~ s/\.c$/.s/;
509
	@ARGV = ($TMP);
517
	@ARGV = ($TMP);
Lines 1274-1281 Link Here
1274
}
1282
}
1275
1283
1276
sub compute_intrinsics {
1284
sub compute_intrinsics {
1277
    $TMPDIR ||= tempdir(CLEANUP => 1);
1285
    &safedir;
1278
    local($TMP) = "$TMPDIR/c2ph-i.$$.c";
1286
    local($TMP) = "$SAFEDIR/c2ph-i.$$.c";
1279
    open (TMP, ">$TMP") || die "can't open $TMP: $!";
1287
    open (TMP, ">$TMP") || die "can't open $TMP: $!";
1280
    select(TMP);
1288
    select(TMP);
1281
1289
Lines 1303-1309 Link Here
1303
    close TMP;
1311
    close TMP;
1304
1312
1305
    select(STDOUT);
1313
    select(STDOUT);
1306
    open(PIPE, "cd $TMPDIR && $CC $TMP && $TMPDIR/a.out|");
1314
    open(PIPE, "cd $SAFEDIR && $CC $TMP && $SAFEDIR/a.out|");
1307
    while (<PIPE>) {
1315
    while (<PIPE>) {
1308
	chop;
1316
	chop;
1309
	split(' ',$_,2);;
1317
	split(' ',$_,2);;
Lines 1312-1318 Link Here
1312
	$intrinsics{$_[1]} = $template{$_[0]};
1320
	$intrinsics{$_[1]} = $template{$_[0]};
1313
    }
1321
    }
1314
    close(PIPE) || die "couldn't read intrinsics!";
1322
    close(PIPE) || die "couldn't read intrinsics!";
1315
    unlink($TMP, '$TMPDIR/a.out');
1323
    unlink($TMP, '$SAFEDIR/a.out');
1316
    print STDERR "done\n" if $trace;
1324
    print STDERR "done\n" if $trace;
1317
}
1325
}
1318
1326
(-)perl-5.8.3.orig/utils/perlbug.PL (-5 / +4 lines)
Lines 78-84 Link Here
78
print OUT <<'!NO!SUBS!';
78
print OUT <<'!NO!SUBS!';
79
79
80
use Config;
80
use Config;
81
use File::Spec;		# keep perlbug Perl 5.005 compatible
81
use File::Temp;
82
use Getopt::Std;
82
use Getopt::Std;
83
use strict;
83
use strict;
84
84
Lines 958-967 Link Here
958
}
958
}
959
959
960
sub filename {
960
sub filename {
961
    my $dir = File::Spec->tmpdir();
961
    my ($fh, $filename) = File::Temp::tempfile(UNLINK => 1);
962
    $filename = "bugrep0$$";
962
    close($fh);
963
    $filename++ while -e File::Spec->catfile($dir, $filename);
963
    return $filename;
964
    $filename = File::Spec->catfile($dir, $filename);
965
}
964
}
966
965
967
sub paraprint {
966
sub paraprint {

Return to bug 66360