Submitted by: William Immendorf (computerperson1 AT live DOT com)
Date: 2008-10-20
Initial Package Version: 5.10.0
Upstream Status: Accepted
Description: Perl fixes from upsteam.
diff -Naur perl-5.10.0-orig/lib/File/CVE-2008-2827.t perl-5.10.0/lib/File/CVE-2008-2827.t
old
|
new
|
|
| 1 | #!perl -w |
| 2 | |
| 3 | # Test case derived from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487319 |
| 4 | |
| 5 | my $foo = "foo-$$"; |
| 6 | my $bar = "bar-$$"; |
| 7 | |
| 8 | die "Not clean [$foo] [$bar]" if -e $foo || -e $bar; |
| 9 | |
| 10 | eval { |
| 11 | symlink($foo, $bar) || die "Can't symlink $foo --> $bar"; |
| 12 | }; |
| 13 | if ($@) { |
| 14 | print "1..0 # Skipped: Only systems that can do symlinks are affected\n"; |
| 15 | print "$@\n"; |
| 16 | exit; |
| 17 | } |
| 18 | |
| 19 | use Test; |
| 20 | plan tests => 5; |
| 21 | |
| 22 | umask(0027); |
| 23 | |
| 24 | # touch foo |
| 25 | open(my $fh, ">", $foo) || die "Can't create $foo\n"; |
| 26 | close($fh); |
| 27 | |
| 28 | my $m = (stat $foo)[2]; |
| 29 | ok(defined $m); |
| 30 | |
| 31 | require File::Path; |
| 32 | ok(File::Path::rmtree($bar)); |
| 33 | ok(!-e $bar); |
| 34 | |
| 35 | # If the mode of $foo changed as a result of removing $bar then we are vulnerable |
| 36 | ok($m, (stat $foo)[2]); |
| 37 | |
| 38 | unlink($foo); |
| 39 | ok(!-e $foo); |
diff -Naur perl-5.10.0-orig/ext/PerlIO/via/via.xs perl-5.10.0/ext/PerlIO/via/via.xs
old
|
new
|
|
89 | 89 | if (!s->fh) { |
90 | 90 | GV *gv = newGVgen(HvNAME_get(s->stash)); |
91 | 91 | GvIOp(gv) = newIO(); |
92 | | s->fh = newRV_noinc((SV *) gv); |
| 92 | s->fh = newRV((SV *) gv); |
93 | 93 | s->io = GvIOp(gv); |
94 | 94 | } |
95 | 95 | IoIFP(s->io) = PerlIONext(f); |
diff -Naur perl-5.10.0-orig/ext/POSIX/Makefile.PL perl-5.10.0/ext/POSIX/Makefile.PL
old
|
new
|
|
48 | 48 | MAX_INPUT MB_LEN_MAX MSG_CTRUNC MSG_DONTROUTE MSG_EOR MSG_OOB MSG_PEEK |
49 | 49 | MSG_TRUNC MSG_WAITALL NAME_MAX NCCS NGROUPS_MAX NOFLSH OPEN_MAX OPOST |
50 | 50 | PARENB PARMRK PARODD PATH_MAX PIPE_BUF RAND_MAX R_OK SCHAR_MAX |
51 | | SCHAR_MIN SEEK_CUR SEEK_END SEEK_SET SHRT_MAX SHRT_MIN SIGABRT SIGALRM |
| 51 | SCHAR_MIN SHRT_MAX SHRT_MIN SIGABRT SIGALRM |
52 | 52 | SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT |
53 | 53 | SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU |
54 | 54 | SIGUSR1 SIGUSR2 SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SSIZE_MAX |
55 | | STDERR_FILENO STDIN_FILENO STDOUT_FILENO STREAM_MAX |
56 | | S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID |
57 | | S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR TCIFLUSH TCIOFF |
| 55 | STDERR_FILENO STDIN_FILENO STDOUT_FILENO STREAM_MAX TCIFLUSH TCIOFF |
58 | 56 | TCIOFLUSH TCION TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW |
59 | 57 | TMP_MAX TOSTOP TZNAME_MAX VEOF VEOL VERASE VINTR VKILL VMIN VQUIT |
60 | 58 | VSTART VSTOP VSUSP VTIME WNOHANG WUNTRACED W_OK X_OK |
diff -Naur perl-5.10.0-orig/ext/POSIX/POSIX.pm perl-5.10.0/ext/POSIX/POSIX.pm
old
|
new
|
|
13 | 13 | use Fcntl qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK F_SETFD |
14 | 14 | F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND |
15 | 15 | O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC |
16 | | O_WRONLY); |
| 16 | O_WRONLY SEEK_CUR SEEK_END SEEK_SET |
| 17 | S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID |
| 18 | S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR); |
17 | 19 | |
18 | 20 | # Grandfather old foo_h form to new :foo_h form |
19 | 21 | my $loaded; |
diff -Naur perl-5.10.0-orig/lib/File/Path.pm perl-5.10.0/lib/File/Path.pm
old
|
new
|
|
350 | 350 | next ROOT_DIR; |
351 | 351 | } |
352 | 352 | |
353 | | my $nperm = $perm & 07777 | 0600; |
354 | | if ($nperm != $perm and not chmod $nperm, $root) { |
355 | | if ($Force_Writeable) { |
| 353 | if ($Force_Writeable) { |
| 354 | my $nperm = $perm & 07777 | 0600; |
| 355 | if ($nperm != $perm and not chmod $nperm, $root) { |
356 | 356 | _error($arg, "cannot make file writeable", $canon); |
357 | 357 | } |
358 | 358 | } |
diff -Naur perl-5.10.0-orig/pp_sort.c perl-5.10.0/pp_sort.c
old
|
new
|
|
1553 | 1553 | max = AvFILL(av) + 1; |
1554 | 1554 | if (SvMAGICAL(av)) { |
1555 | 1555 | MEXTEND(SP, max); |
1556 | | p2 = SP; |
1557 | 1556 | for (i=0; i < max; i++) { |
1558 | 1557 | SV **svp = av_fetch(av, i, FALSE); |
1559 | 1558 | *SP++ = (svp) ? *svp : NULL; |
1560 | 1559 | } |
| 1560 | SP--; |
| 1561 | p1 = p2 = SP - (max-1); |
1561 | 1562 | } |
1562 | 1563 | else { |
1563 | 1564 | if (SvREADONLY(av)) |
… |
… |
|
1713 | 1714 | SvREADONLY_off(av); |
1714 | 1715 | else if (av && !sorting_av) { |
1715 | 1716 | /* simulate pp_aassign of tied AV */ |
1716 | | SV** const base = ORIGMARK+1; |
| 1717 | SV** const base = MARK+1; |
1717 | 1718 | for (i=0; i < max; i++) { |
1718 | 1719 | base[i] = newSVsv(base[i]); |
1719 | 1720 | } |
diff -Naur perl-5.10.0-orig/t/lib/proxy_constant_subs.t perl-5.10.0/t/lib/proxy_constant_subs.t
old
|
new
|
|
7 | 7 | print "1..0 # Skip -- Perl configured without B module\n"; |
8 | 8 | exit 0; |
9 | 9 | } |
10 | | if ($Config::Config{'extensions'} !~ /\bPOSIX\b/) { |
11 | | print "1..0 # Skip -- Perl configured without POSIX\n"; |
| 10 | if ($Config::Config{'extensions'} !~ /\bFcntl\b/) { |
| 11 | print "1..0 # Skip -- Perl configured without Fcntl\n"; |
12 | 12 | exit 0; |
13 | 13 | } |
14 | | # errno is a real subroutine, and acts as control |
| 14 | # S_IFMT is a real subroutine, and acts as control |
15 | 15 | # SEEK_SET is a proxy constant subroutine. |
16 | | @symbols = qw(errno SEEK_SET); |
| 16 | @symbols = qw(S_IFMT SEEK_SET); |
17 | 17 | } |
18 | 18 | |
19 | 19 | use strict; |
20 | 20 | use warnings; |
21 | 21 | use Test::More tests => 4 * @symbols; |
22 | 22 | use B qw(svref_2object GVf_IMPORTED_CV); |
23 | | use POSIX @symbols; |
| 23 | use Fcntl @symbols; |
24 | 24 | |
25 | 25 | # GVf_IMPORTED_CV should not be set on the original, but should be set on the |
26 | 26 | # imported GV. |
… |
… |
|
29 | 29 | my ($ps, $ms); |
30 | 30 | { |
31 | 31 | no strict 'refs'; |
32 | | $ps = svref_2object(\*{"POSIX::$symbol"}); |
| 32 | $ps = svref_2object(\*{"Fcntl::$symbol"}); |
33 | 33 | $ms = svref_2object(\*{"::$symbol"}); |
34 | 34 | } |
35 | 35 | isa_ok($ps, 'B::GV'); |
diff -Naur perl-5.10.0.orig/mg.c perl-5.10.0/mg.c
old
|
new
|
|
1543 | 1543 | stash = GvSTASH( |
1544 | 1544 | SvTYPE(mg->mg_obj) == SVt_PVGV |
1545 | 1545 | ? (GV*)mg->mg_obj |
1546 | | : (GV*)SvMAGIC(mg->mg_obj)->mg_obj |
| 1546 | : (GV*)mg_find(mg->mg_obj, PERL_MAGIC_isa)->mg_obj |
1547 | 1547 | ); |
1548 | 1548 | |
1549 | 1549 | mro_isa_changed_in(stash); |