perl/perl.patch

changeset 439
085c98460a58
parent 23
1eecce5d3fe6
child 501
4d4d275a712a
equal deleted inserted replaced
1:820322f1137d 2:2991bcd0aa90
2 procedure forgot to create its top-level paths, too. In OpenPKG we use 2 procedure forgot to create its top-level paths, too. In OpenPKG we use
3 the "vendor" area, so make sure it is created the same way the "site" 3 the "vendor" area, so make sure it is created the same way the "site"
4 area is. 4 area is.
5 5
6 Index: installperl 6 Index: installperl
7 --- installperl.orig 2007-12-18 11:47:07 +0100 7 --- installperl.orig 2011-06-09 22:04:29.000000000 +0200
8 +++ installperl 2008-03-28 15:23:47 +0100 8 +++ installperl 2011-06-17 15:20:48.000000000 +0200
9 @@ -211,6 +211,8 @@ 9 @@ -200,6 +200,8 @@
10 my $installarchlib = "$destdir$Config{installarchlib}"; 10 my $installarchlib = "$opts{destdir}$Config{installarchlib}";
11 my $installsitelib = "$destdir$Config{installsitelib}"; 11 my $installsitelib = "$opts{destdir}$Config{installsitelib}";
12 my $installsitearch = "$destdir$Config{installsitearch}"; 12 my $installsitearch = "$opts{destdir}$Config{installsitearch}";
13 +my $installvendorlib = "$destdir$Config{installvendorlib}"; 13 +my $installvendorlib = "$opts{destdir}$Config{installvendorlib}";
14 +my $installvendorarch = "$destdir$Config{installvendorarch}"; 14 +my $installvendorarch = "$opts{destdir}$Config{installvendorarch}";
15 my $installman1dir = "$destdir$Config{installman1dir}"; 15 my $installman1dir = "$opts{destdir}$Config{installman1dir}";
16 my $man1ext = $Config{man1ext}; 16 my $man1ext = $Config{man1ext};
17 my $libperl = $Config{libperl}; 17 my $libperl = $Config{libperl};
18 @@ -372,6 +374,8 @@ 18 @@ -349,6 +351,8 @@
19 mkpath($installarchlib, $verbose, 0777); 19 mkpath($installarchlib, $opts{verbose}, 0777);
20 mkpath($installsitelib, $verbose, 0777) if ($installsitelib); 20 mkpath($installsitelib, $opts{verbose}, 0777) if ($installsitelib);
21 mkpath($installsitearch, $verbose, 0777) if ($installsitearch); 21 mkpath($installsitearch, $opts{verbose}, 0777) if ($installsitearch);
22 +mkpath($installvendorlib, $verbose, 0777) if ($installvendorlib); 22 +mkpath($installvendorlib, $opts{verbose}, 0777) if ($installvendorlib);
23 +mkpath($installvendorarch, $verbose, 0777) if ($installvendorarch); 23 +mkpath($installvendorarch, $opts{verbose}, 0777) if ($installvendorarch);
24 24
25 if (chdir "lib") { 25 if (chdir "lib") {
26 $do_installarchlib = ! samepath($installarchlib, '.'); 26 $do_installarchlib = ! samepath($installarchlib, '.');
27
28 -----------------------------------------------------------------------------
29
30 By default, the Perl module search order is "use lib, -I, PERL[5]LIB,
31 perl, site, vendor, other". This means that in OpenPKG both the modules
32 installed via CPAN shell (in "site" area) and the "perl-xxx" packages
33 (in "vendor" area) cannot override the (sometimes obsoleted) module
34 versions distributed with Perl (in "perl" area). Hence, we change
35 the search order to a more reasonable one for OpenPKG: "use lib, -I,
36 PERL[5]LIB, site, vendor, perl, other".
37
38 Index: perl.c
39 --- perl.c.orig 2007-12-18 11:47:08 +0100
40 +++ perl.c 2008-03-28 15:23:47 +0100
41 @@ -4753,39 +4753,6 @@
42 incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE);
43 #endif
44
45 -#ifdef ARCHLIB_EXP
46 - incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
47 -#endif
48 -#ifdef MACOS_TRADITIONAL
49 - {
50 - Stat_t tmpstatbuf;
51 - SV * privdir = newSV(0);
52 - char * macperl = PerlEnv_getenv("MACPERL");
53 -
54 - if (!macperl)
55 - macperl = "";
56 -
57 - Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
58 - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
59 - incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
60 - Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
61 - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
62 - incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
63 -
64 - SvREFCNT_dec(privdir);
65 - }
66 - if (!PL_tainting)
67 - incpush(":", FALSE, FALSE, TRUE, FALSE);
68 -#else
69 -#ifndef PRIVLIB_EXP
70 -# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
71 -#endif
72 -#if defined(WIN32)
73 - incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
74 -#else
75 - incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
76 -#endif
77 -
78 #ifdef SITEARCH_EXP
79 /* sitearch is always relative to sitelib on Windows for
80 * DLL-based path intuition to work correctly */
81 @@ -4828,6 +4795,39 @@
82 incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE);
83 #endif
84
85 +#ifdef ARCHLIB_EXP
86 + incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
87 +#endif
88 +#ifdef MACOS_TRADITIONAL
89 + {
90 + Stat_t tmpstatbuf;
91 + SV * privdir = newSV(0);
92 + char * macperl = PerlEnv_getenv("MACPERL");
93 +
94 + if (!macperl)
95 + macperl = "";
96 +
97 + Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
98 + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
99 + incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
100 + Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
101 + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
102 + incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
103 +
104 + SvREFCNT_dec(privdir);
105 + }
106 + if (!PL_tainting)
107 + incpush(":", FALSE, FALSE, TRUE, FALSE);
108 +#else
109 +#ifndef PRIVLIB_EXP
110 +# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
111 +#endif
112 +#if defined(WIN32)
113 + incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
114 +#else
115 + incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
116 +#endif
117 +
118 #ifdef PERL_OTHERLIBDIRS
119 incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE, TRUE);
120 #endif
121 27
122 ----------------------------------------------------------------------------- 28 -----------------------------------------------------------------------------
123 29
124 Port to [Open]Darwin 6.6.2: 30 Port to [Open]Darwin 6.6.2:
125 31
133 3. Darwin 6 no longer accepts the non-standard "#import" statements, 39 3. Darwin 6 no longer accepts the non-standard "#import" statements,
134 so replace with "#include" and circumvent some header problem 40 so replace with "#include" and circumvent some header problem
135 related to the non-standard "__private_extern__" attribute. 41 related to the non-standard "__private_extern__" attribute.
136 42
137 Index: hints/darwin.sh 43 Index: hints/darwin.sh
138 --- hints/darwin.sh.orig 2007-12-18 11:47:07 +0100 44 --- hints/darwin.sh.orig 2011-06-09 22:04:29.000000000 +0200
139 +++ hints/darwin.sh 2008-03-28 15:23:47 +0100 45 +++ hints/darwin.sh 2011-06-17 15:20:48.000000000 +0200
140 @@ -120,9 +120,6 @@ 46 @@ -189,8 +189,7 @@
141 *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;;
142 esac
143
144 -# Avoid Apple's cpp precompiler, better for extensions
145 -cppflags="${cppflags} -no-cpp-precomp"
146 -
147 # This is necessary because perl's build system doesn't
148 # apply cppflags to cc compile lines as it should.
149 ccflags="${ccflags} ${cppflags}"
150 @@ -182,8 +179,7 @@
151 esac 47 esac
152 ldlibpthname='DYLD_LIBRARY_PATH'; 48 ldlibpthname='DYLD_LIBRARY_PATH';
153 49
154 -# useshrplib=true results in much slower startup times. 50 -# useshrplib=true results in much slower startup times.
155 -# 'false' is the default value. Use Configure -Duseshrplib to override. 51 -# 'false' is the default value. Use Configure -Duseshrplib to override.
156 +useshrplib='true' 52 +useshrplib='true'
157 53
158 cat > UU/archname.cbu <<'EOCBU' 54 cat > UU/archname.cbu <<'EOCBU'
159 # This script UU/archname.cbu will get 'called-back' by Configure 55 # This script UU/archname.cbu will get 'called-back' by Configure
56 Index: ext/DynaLoader/dl_dyld.xs
57 --- ext/DynaLoader/dl_dyld.xs.orig 2011-04-13 13:36:34.000000000 +0200
58 +++ ext/DynaLoader/dl_dyld.xs 2011-06-17 15:20:48.000000000 +0200
59 @@ -47,7 +47,13 @@
60
61 #undef environ
62 #undef bool
63 +#ifdef PERL_DARWIN
64 +#define __private_extern__ extern
65 +#include <mach-o/dyld.h>
66 +#undef __private_extern__
67 +#else
68 #import <mach-o/dyld.h>
69 +#endif
70
71 static char *dlerror()
72 {
160 Index: perlio.c 73 Index: perlio.c
161 --- perlio.c.orig 2007-12-18 11:47:08 +0100 74 --- perlio.c.orig 2011-06-09 22:04:29.000000000 +0200
162 +++ perlio.c 2008-03-28 15:23:47 +0100 75 +++ perlio.c 2011-06-17 15:20:48.000000000 +0200
163 @@ -472,7 +472,14 @@ 76 @@ -476,7 +476,14 @@
164 #include <unistd.h> 77 #include <unistd.h>
165 #endif 78 #endif
166 #ifdef HAS_MMAP 79 #ifdef HAS_MMAP
167 +#ifdef PERL_DARWIN 80 +#ifdef PERL_DARWIN
168 +#define environ_safe environ 81 +#define environ_safe environ
173 +#include <sys/mman.h> 86 +#include <sys/mman.h>
174 +#endif 87 +#endif
175 #endif 88 #endif
176 89
177 void 90 void
178 Index: ext/DynaLoader/dl_dyld.xs
179 --- ext/DynaLoader/dl_dyld.xs.orig 2007-12-18 11:47:07 +0100
180 +++ ext/DynaLoader/dl_dyld.xs 2008-03-28 15:23:47 +0100
181 @@ -45,7 +45,13 @@
182
183 #undef environ
184 #undef bool
185 +#ifdef PERL_DARWIN
186 +#define __private_extern__ extern
187 +#include <mach-o/dyld.h>
188 +#undef __private_extern__
189 +#else
190 #import <mach-o/dyld.h>
191 +#endif
192
193 static char *dlerror()
194 {
195 91
196 ----------------------------------------------------------------------------- 92 -----------------------------------------------------------------------------
197 93
198 Port to Tru64 5.1: 94 Port to Tru64 5.1:
199 95
202 optimization flags to ld(1). Under a brain-dead platform like Tru64 we 98 optimization flags to ld(1). Under a brain-dead platform like Tru64 we
203 really don't need any more optimization because we are already happy if 99 really don't need any more optimization because we are already happy if
204 it works at all. 100 it works at all.
205 101
206 Index: hints/dec_osf.sh 102 Index: hints/dec_osf.sh
207 --- hints/dec_osf.sh.orig 2007-12-18 11:47:07 +0100 103 --- hints/dec_osf.sh.orig 2011-06-17 02:06:09.000000000 +0200
208 +++ hints/dec_osf.sh 2008-03-28 15:23:47 +0100 104 +++ hints/dec_osf.sh 2011-06-17 15:20:48.000000000 +0200
209 @@ -73,15 +73,6 @@ 105 @@ -73,15 +73,6 @@
210 *) if $test "X$optimize" = "X$undef"; then 106 *) if $test "X$optimize" = "X$undef"; then
211 lddlflags="$lddlflags -msym" 107 lddlflags="$lddlflags -msym"
212 else 108 else
213 - case "$myosvers" in 109 - case "$myosvers" in
223 # keep the module symbols with the modules. 119 # keep the module symbols with the modules.
224 lddlflags="$lddlflags -msym $_lddlflags_strict_ansi" 120 lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"
225 121
226 ----------------------------------------------------------------------------- 122 -----------------------------------------------------------------------------
227 123
228 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0976 124 Linker flag change for Solaris.
229 Multiple scripts in the perl package in Trustix Secure Linux 1.5
230 through 2.1, and possibly other operating systems, allows local
231 users to overwrite files via a symlink attack on temporary files.
232
233 Index: lib/CGI/Cookie.pm
234 --- lib/CGI/Cookie.pm.orig 2007-12-18 11:47:07 +0100
235 +++ lib/CGI/Cookie.pm 2008-03-28 15:23:47 +0100
236 @@ -470,7 +470,7 @@
237 You may also retrieve cookies that were stored in some external
238 form using the parse() class method:
239
240 - $COOKIES = `cat /usr/tmp/Cookie_stash`;
241 + $COOKIES = `cat /var/run/www/Cookie_stash`;
242 %cookies = parse CGI::Cookie($COOKIES);
243
244 If you are in a mod_perl environment, you can save some overhead by
245 Index: lib/Shell.pm
246 --- lib/Shell.pm.orig 2007-12-18 11:47:07 +0100
247 +++ lib/Shell.pm 2008-03-28 15:23:47 +0100
248 @@ -151,7 +151,7 @@
249 use Shell qw(cat ps cp);
250 $passwd = cat('</etc/passwd');
251 @pslines = ps('-ww'),
252 - cp("/etc/passwd", "/tmp/passwd");
253 + cp("/etc/passwd", "/etc/passwd.orig");
254
255 # object oriented
256 my $sh = Shell->new;
257
258 -----------------------------------------------------------------------------
259 125
260 Index: Configure 126 Index: Configure
261 --- Configure.orig 2007-12-18 11:47:07 +0100 127 --- Configure.orig 2011-06-09 22:04:29.000000000 +0200
262 +++ Configure 2008-03-28 15:23:47 +0100 128 +++ Configure 2011-06-17 15:20:48.000000000 +0200
263 @@ -7871,7 +7871,7 @@ 129 @@ -8078,9 +8058,9 @@
264 ;; 130 ;;
265 linux|irix*|gnu*) dflt="-shared $optimize" ;; 131 linux|irix*|gnu*) dflt="-shared $optimize" ;;
266 next) dflt='none' ;; 132 next) dflt='none' ;;
267 - solaris) dflt='-G' ;; 133 - solaris) dflt='-G' ;;
268 + solaris) dflt='-shared' ;; 134 + solaris) dflt='-shared' ;;
269 sunos) dflt='-assert nodefinitions' ;; 135 sunos) dflt='-assert nodefinitions' ;;
270 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;; 136 - svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
137 + svr4*|esix*|nonstopux) dflt="-shared $ldflags" ;;
271 *) dflt='none' ;; 138 *) dflt='none' ;;
139 esac
140 ;;
272 141
273 ----------------------------------------------------------------------------- 142 -----------------------------------------------------------------------------
274 143
275 Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl) 144 Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
276 145
277 Index: sv.c 146 Index: sv.c
278 --- sv.c.orig 2007-12-18 11:47:08 +0100 147 --- sv.c.orig 2011-06-17 02:06:09.000000000 +0200
279 +++ sv.c 2008-03-28 15:23:47 +0100 148 +++ sv.c 2011-06-17 15:20:48.000000000 +0200
280 @@ -8667,7 +8667,10 @@ 149 @@ -10198,7 +10198,10 @@
281 if ( (width = expect_number(&q)) ) { 150 if ( (width = expect_number(&q)) ) {
282 if (*q == '$') { 151 if (*q == '$') {
283 ++q; 152 ++q;
284 - efix = width; 153 - efix = width;
285 + if (width > PERL_INT_MAX) 154 + if (width > PERL_INT_MAX)
290 goto gotwidth; 159 goto gotwidth;
291 } 160 }
292 161
293 ----------------------------------------------------------------------------- 162 -----------------------------------------------------------------------------
294 163
295 Detect NetBSD 5.x as well 164 Do not use -fstack-protector as it causes too much portability issues.
296 165
297 Index: hints/netbsd.sh 166 Index: Configure
298 --- hints/netbsd.sh.orig 2007-12-18 11:47:07.000000000 +0100 167 --- Configure.orig 2011-06-09 22:04:29.000000000 +0200
299 +++ hints/netbsd.sh 2008-12-24 10:51:08.000000000 +0100 168 +++ Configure 2011-06-17 15:20:48.000000000 +0200
300 @@ -79,7 +79,7 @@ 169 @@ -5158,17 +5158,6 @@
170 ;;
171 esac
172
173 - # on x86_64 (at least) we require an extra library (libssp) in the
174 - # link command line. This library is not named, so I infer that it is
175 - # an implementation detail that may change. Hence the safest approach
176 - # is to add the flag to the flags passed to the compiler at link time,
177 - # as that way the compiler can do the right implementation dependant
178 - # thing. (NWC)
179 - case "$gccversion" in
180 - ?*) set stack-protector -fstack-protector
181 - eval $checkccflag
182 - ;;
183 - esac
301 ;; 184 ;;
302 esac 185 esac
303 case "$osvers" in 186
304 -0.9*|1.*|2.*|3.*|4.*) 187 @@ -5307,15 +5296,6 @@
305 +0.9*|1.*|2.*|3.*|4.*|5.*) 188 ;;
306 d_getprotoent_r="$undef" 189 *) dflt="$ldflags";;
307 d_getprotobyname_r="$undef" 190 esac
308 d_getprotobynumber_r="$undef" 191 -# See note above about -fstack-protector
309 192 -case "$ccflags" in
310 ----------------------------------------------------------------------------- 193 -*-fstack-protector*)
311 194 - case "$dflt" in
312 Corrections for Solaris 11: 195 - *-fstack-protector*) ;; # Don't add it again
313 196 - *) dflt="$dflt -fstack-protector" ;;
314 Index: perl.h 197 - esac
315 diff -Nau perl.h.orig perl.h 198 - ;;
316 --- perl.h.orig 2007-12-18 11:47:08.000000000 +0100 199 -esac
317 +++ perl.h 2009-01-06 15:28:45.843276063 +0100 200
318 @@ -1393,6 +1393,7 @@ 201 : Try to guess additional flags to pick up local libraries.
319 */ 202 for thislibdir in $libpth; do
320 203 @@ -8107,14 +8087,6 @@
321 #if defined(I_SYSMODE) && !defined(PERL_MICRO) 204 ''|' ') dflt='none' ;;
322 +#include <sys/vnode.h> 205 esac
323 #include <sys/mode.h> 206
324 #endif 207 - case "$ldflags" in
325 208 - *-fstack-protector*)
209 - case "$dflt" in
210 - *-fstack-protector*) ;; # Don't add it again
211 - *) dflt="$dflt -fstack-protector" ;;
212 - esac
213 - ;;
214 - esac
215
216
217 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
218
219 -----------------------------------------------------------------------------
220
221 Make sure we install into <prefix>/lib/perl/ and not <prefix>/lib/perl5/
222
223 Index: Configure
224 --- Configure.orig 2009-08-24 18:33:49 +0200
225 +++ Configure 2009-08-24 18:44:39 +0200
226 @@ -1769,7 +1769,7 @@
227 touch posthint.sh
228
229 : set package name
230 -package='perl5'
231 +package='perl'
232 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
233 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
234 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
235
236 -----------------------------------------------------------------------------
237
238 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0976
239 Multiple scripts in the perl package in Trustix Secure Linux 1.5
240 through 2.1, and possibly other operating systems, allows local
241 users to overwrite files via a symlink attack on temporary files.
242
243 Index: cpan/CGI/lib/CGI/Cookie.pm
244 --- cpan/CGI/lib/CGI/Cookie.pm.orig 2011-06-09 22:04:29.000000000 +0200
245 +++ cpan/CGI/lib/CGI/Cookie.pm 2011-06-17 15:22:59.000000000 +0200
246 @@ -464,7 +464,7 @@
247 You may also retrieve cookies that were stored in some external
248 form using the parse() class method:
249
250 - $COOKIES = `cat /usr/tmp/Cookie_stash`;
251 + $COOKIES = `cat /var/run/www/Cookie_stash`;
252 %cookies = CGI::Cookie->parse($COOKIES);
253
254 If you are in a mod_perl environment, you can save some overhead by
255 Index: cpan/Shell/Shell.pm
256 --- cpan/Shell/Shell.pm.orig 2011-06-17 02:06:09.000000000 +0200
257 +++ cpan/Shell/Shell.pm 2011-06-17 15:20:48.000000000 +0200
258 @@ -153,7 +153,7 @@
259 use Shell qw(cat ps cp);
260 $passwd = cat('</etc/passwd');
261 @pslines = ps('-ww'),
262 - cp("/etc/passwd", "/tmp/passwd");
263 + cp("/etc/passwd", "/etc/passwd.orig");
264
265 # object oriented
266 my $sh = Shell->new;
267
268 -----------------------------------------------------------------------------
269
270 Linking against just libgdbm_compat under at least SUSE fails
271 because it also needs libgdbm (which Perl doesn't pick up, too)
272
273 Index: hints/linux.sh
274 --- hints/linux.sh.orig 2011-06-09 22:04:29.000000000 +0200
275 +++ hints/linux.sh 2011-06-17 15:20:48.000000000 +0200
276 @@ -55,7 +55,9 @@
277 libswanted="$*"
278
279 # Debian 4.0 puts ndbm in the -lgdbm_compat library.
280 -libswanted="$libswanted gdbm_compat"
281 +if [ -f /etc/debian_version -o -f /etc/ubuntu_version ]; then
282 + libswanted="$libswanted gdbm_compat"
283 +fi
284
285 # If you have glibc, then report the version for ./myconfig bug reporting.
286 # (Configure doesn't need to know the specific version since it just uses
287

mercurial