perl/perl.patch

changeset 22
0d4f475bfc81
child 23
1eecce5d3fe6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/perl/perl.patch	Wed Jan 07 14:58:25 2009 +0100
     1.3 @@ -0,0 +1,309 @@
     1.4 +By default, the "vendor" area is not used, so Perl's installation
     1.5 +procedure forgot to create its top-level paths, too. In OpenPKG we use
     1.6 +the "vendor" area, so make sure it is created the same way the "site"
     1.7 +area is.
     1.8 +
     1.9 +Index: installperl
    1.10 +--- installperl.orig	2007-12-18 11:47:07 +0100
    1.11 ++++ installperl	2008-03-28 15:23:47 +0100
    1.12 +@@ -211,6 +211,8 @@
    1.13 + my $installarchlib = "$destdir$Config{installarchlib}";
    1.14 + my $installsitelib = "$destdir$Config{installsitelib}";
    1.15 + my $installsitearch = "$destdir$Config{installsitearch}";
    1.16 ++my $installvendorlib = "$destdir$Config{installvendorlib}";
    1.17 ++my $installvendorarch = "$destdir$Config{installvendorarch}";
    1.18 + my $installman1dir = "$destdir$Config{installman1dir}";
    1.19 + my $man1ext = $Config{man1ext};
    1.20 + my $libperl = $Config{libperl};
    1.21 +@@ -372,6 +374,8 @@
    1.22 + mkpath($installarchlib, $verbose, 0777);
    1.23 + mkpath($installsitelib, $verbose, 0777) if ($installsitelib);
    1.24 + mkpath($installsitearch, $verbose, 0777) if ($installsitearch);
    1.25 ++mkpath($installvendorlib, $verbose, 0777) if ($installvendorlib);
    1.26 ++mkpath($installvendorarch, $verbose, 0777) if ($installvendorarch);
    1.27 + 
    1.28 + if (chdir "lib") {
    1.29 +     $do_installarchlib = ! samepath($installarchlib, '.');
    1.30 +
    1.31 +-----------------------------------------------------------------------------
    1.32 +
    1.33 +By default, the Perl module search order is "use lib, -I, PERL[5]LIB,
    1.34 +perl, site, vendor, other". This means that in OpenPKG both the modules
    1.35 +installed via CPAN shell (in "site" area) and the "perl-xxx" packages
    1.36 +(in "vendor" area) cannot override the (sometimes obsoleted) module
    1.37 +versions distributed with Perl (in "perl" area). Hence, we change
    1.38 +the search order to a more reasonable one for OpenPKG: "use lib, -I,
    1.39 +PERL[5]LIB, site, vendor, perl, other".
    1.40 +
    1.41 +Index: perl.c
    1.42 +--- perl.c.orig	2007-12-18 11:47:08 +0100
    1.43 ++++ perl.c	2008-03-28 15:23:47 +0100
    1.44 +@@ -4753,39 +4753,6 @@
    1.45 +     incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE);
    1.46 + #endif
    1.47 + 
    1.48 +-#ifdef ARCHLIB_EXP
    1.49 +-    incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
    1.50 +-#endif
    1.51 +-#ifdef MACOS_TRADITIONAL
    1.52 +-    {
    1.53 +-	Stat_t tmpstatbuf;
    1.54 +-    	SV * privdir = newSV(0);
    1.55 +-	char * macperl = PerlEnv_getenv("MACPERL");
    1.56 +-	
    1.57 +-	if (!macperl)
    1.58 +-	    macperl = "";
    1.59 +-	
    1.60 +-	Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
    1.61 +-	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
    1.62 +-	    incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
    1.63 +-	Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
    1.64 +-	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
    1.65 +-	    incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
    1.66 +-	
    1.67 +-   	SvREFCNT_dec(privdir);
    1.68 +-    }
    1.69 +-    if (!PL_tainting)
    1.70 +-	incpush(":", FALSE, FALSE, TRUE, FALSE);
    1.71 +-#else
    1.72 +-#ifndef PRIVLIB_EXP
    1.73 +-#  define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
    1.74 +-#endif
    1.75 +-#if defined(WIN32)
    1.76 +-    incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
    1.77 +-#else
    1.78 +-    incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
    1.79 +-#endif
    1.80 +-
    1.81 + #ifdef SITEARCH_EXP
    1.82 +     /* sitearch is always relative to sitelib on Windows for
    1.83 +      * DLL-based path intuition to work correctly */
    1.84 +@@ -4828,6 +4795,39 @@
    1.85 +     incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE);
    1.86 + #endif
    1.87 + 
    1.88 ++#ifdef ARCHLIB_EXP
    1.89 ++    incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
    1.90 ++#endif
    1.91 ++#ifdef MACOS_TRADITIONAL
    1.92 ++    {
    1.93 ++	Stat_t tmpstatbuf;
    1.94 ++    	SV * privdir = newSV(0);
    1.95 ++	char * macperl = PerlEnv_getenv("MACPERL");
    1.96 ++	
    1.97 ++	if (!macperl)
    1.98 ++	    macperl = "";
    1.99 ++	
   1.100 ++	Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
   1.101 ++	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
   1.102 ++	    incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
   1.103 ++	Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
   1.104 ++	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
   1.105 ++	    incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
   1.106 ++	
   1.107 ++   	SvREFCNT_dec(privdir);
   1.108 ++    }
   1.109 ++    if (!PL_tainting)
   1.110 ++	incpush(":", FALSE, FALSE, TRUE, FALSE);
   1.111 ++#else
   1.112 ++#ifndef PRIVLIB_EXP
   1.113 ++#  define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
   1.114 ++#endif
   1.115 ++#if defined(WIN32)
   1.116 ++    incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
   1.117 ++#else
   1.118 ++    incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
   1.119 ++#endif
   1.120 ++
   1.121 + #ifdef PERL_OTHERLIBDIRS
   1.122 +     incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE, TRUE);
   1.123 + #endif
   1.124 +
   1.125 +-----------------------------------------------------------------------------
   1.126 +
   1.127 +Port to [Open]Darwin 6.6.2:
   1.128 +
   1.129 +1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not
   1.130 +   understand "-no-cpp-precomp", so remove this build option.
   1.131 +
   1.132 +2. The <sys/mman.h> indirectly includes system specific headers
   1.133 +   which in turn have fields named "environ" while Perl uses
   1.134 +   a define of "environ" internally. So wrap the inclusion.
   1.135 +
   1.136 +3. Darwin 6 no longer accepts the non-standard "#import" statements,
   1.137 +   so replace with "#include" and circumvent some header problem
   1.138 +   related to the non-standard "__private_extern__" attribute.
   1.139 +
   1.140 +Index: hints/darwin.sh
   1.141 +--- hints/darwin.sh.orig	2007-12-18 11:47:07 +0100
   1.142 ++++ hints/darwin.sh	2008-03-28 15:23:47 +0100
   1.143 +@@ -120,9 +120,6 @@
   1.144 +   *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;;
   1.145 + esac
   1.146 + 
   1.147 +-# Avoid Apple's cpp precompiler, better for extensions
   1.148 +-cppflags="${cppflags} -no-cpp-precomp"
   1.149 +-
   1.150 + # This is necessary because perl's build system doesn't
   1.151 + # apply cppflags to cc compile lines as it should.
   1.152 + ccflags="${ccflags} ${cppflags}"
   1.153 +@@ -182,8 +179,7 @@
   1.154 + esac
   1.155 + ldlibpthname='DYLD_LIBRARY_PATH';
   1.156 + 
   1.157 +-# useshrplib=true results in much slower startup times.
   1.158 +-# 'false' is the default value.  Use Configure -Duseshrplib to override.
   1.159 ++useshrplib='true'
   1.160 + 
   1.161 + cat > UU/archname.cbu <<'EOCBU'
   1.162 + # This script UU/archname.cbu will get 'called-back' by Configure 
   1.163 +Index: perlio.c
   1.164 +--- perlio.c.orig	2007-12-18 11:47:08 +0100
   1.165 ++++ perlio.c	2008-03-28 15:23:47 +0100
   1.166 +@@ -472,7 +472,14 @@
   1.167 + #include <unistd.h>
   1.168 + #endif
   1.169 + #ifdef HAS_MMAP
   1.170 ++#ifdef PERL_DARWIN
   1.171 ++#define environ_safe environ
   1.172 ++#undef environ
   1.173 + #include <sys/mman.h>
   1.174 ++#define environ environ_safe
   1.175 ++#else
   1.176 ++#include <sys/mman.h>
   1.177 ++#endif
   1.178 + #endif
   1.179 + 
   1.180 + void
   1.181 +Index: ext/DynaLoader/dl_dyld.xs
   1.182 +--- ext/DynaLoader/dl_dyld.xs.orig	2007-12-18 11:47:07 +0100
   1.183 ++++ ext/DynaLoader/dl_dyld.xs	2008-03-28 15:23:47 +0100
   1.184 +@@ -45,7 +45,13 @@
   1.185 + 
   1.186 + #undef environ
   1.187 + #undef bool
   1.188 ++#ifdef PERL_DARWIN
   1.189 ++#define __private_extern__ extern
   1.190 ++#include <mach-o/dyld.h>
   1.191 ++#undef __private_extern__
   1.192 ++#else
   1.193 + #import <mach-o/dyld.h>
   1.194 ++#endif
   1.195 + 
   1.196 + static char *dlerror()
   1.197 + {
   1.198 +
   1.199 +-----------------------------------------------------------------------------
   1.200 +
   1.201 +Port to Tru64 5.1:
   1.202 +
   1.203 +Under Tru64 our gcc has to be built without binutils and the system
   1.204 +ld(1) does not accept a "-O" option, so remove the whole passing of
   1.205 +optimization flags to ld(1). Under a brain-dead platform like Tru64 we
   1.206 +really don't need any more optimization because we are already happy if
   1.207 +it works at all.
   1.208 +
   1.209 +Index: hints/dec_osf.sh
   1.210 +--- hints/dec_osf.sh.orig	2007-12-18 11:47:07 +0100
   1.211 ++++ hints/dec_osf.sh	2008-03-28 15:23:47 +0100
   1.212 +@@ -73,15 +73,6 @@
   1.213 + *)            if $test "X$optimize" = "X$undef"; then
   1.214 +                       lddlflags="$lddlflags -msym"
   1.215 +               else
   1.216 +-		  case "$myosvers" in
   1.217 +-		  *4.0D*)
   1.218 +-		      # QAR 56761: -O4 + .so may produce broken code,
   1.219 +-		      # fixed in 4.0E or better.
   1.220 +-		      ;;
   1.221 +-		  *)
   1.222 +-                      lddlflags="$lddlflags $optimize"
   1.223 +-		      ;;
   1.224 +-		  esac
   1.225 + 		  # -msym: If using a sufficiently recent /sbin/loader,
   1.226 + 		  # keep the module symbols with the modules.
   1.227 +                   lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"
   1.228 +
   1.229 +-----------------------------------------------------------------------------
   1.230 +
   1.231 +http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0976
   1.232 +    Multiple scripts in the perl package in Trustix Secure Linux 1.5
   1.233 +    through 2.1, and possibly other operating systems, allows local
   1.234 +    users to overwrite files via a symlink attack on temporary files.
   1.235 +
   1.236 +Index: lib/CGI/Cookie.pm
   1.237 +--- lib/CGI/Cookie.pm.orig	2007-12-18 11:47:07 +0100
   1.238 ++++ lib/CGI/Cookie.pm	2008-03-28 15:23:47 +0100
   1.239 +@@ -470,7 +470,7 @@
   1.240 + You may also retrieve cookies that were stored in some external
   1.241 + form using the parse() class method:
   1.242 + 
   1.243 +-       $COOKIES = `cat /usr/tmp/Cookie_stash`;
   1.244 ++       $COOKIES = `cat /var/run/www/Cookie_stash`;
   1.245 +        %cookies = parse CGI::Cookie($COOKIES);
   1.246 + 
   1.247 + If you are in a mod_perl environment, you can save some overhead by
   1.248 +Index: lib/Shell.pm
   1.249 +--- lib/Shell.pm.orig	2007-12-18 11:47:07 +0100
   1.250 ++++ lib/Shell.pm	2008-03-28 15:23:47 +0100
   1.251 +@@ -151,7 +151,7 @@
   1.252 +    use Shell qw(cat ps cp);
   1.253 +    $passwd = cat('</etc/passwd');
   1.254 +    @pslines = ps('-ww'),
   1.255 +-   cp("/etc/passwd", "/tmp/passwd");
   1.256 ++   cp("/etc/passwd", "/etc/passwd.orig");
   1.257 + 
   1.258 +    # object oriented 
   1.259 +    my $sh = Shell->new;
   1.260 +
   1.261 +-----------------------------------------------------------------------------
   1.262 +
   1.263 +Index: Configure
   1.264 +--- Configure.orig	2007-12-18 11:47:07 +0100
   1.265 ++++ Configure	2008-03-28 15:23:47 +0100
   1.266 +@@ -7871,7 +7871,7 @@
   1.267 + 			      ;;
   1.268 + 			linux|irix*|gnu*)  dflt="-shared $optimize" ;;
   1.269 + 			next)  dflt='none' ;;
   1.270 +-			solaris) dflt='-G' ;;
   1.271 ++			solaris) dflt='-shared' ;;
   1.272 + 			sunos) dflt='-assert nodefinitions' ;;
   1.273 + 			svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
   1.274 + 	        *)     dflt='none' ;;
   1.275 +
   1.276 +-----------------------------------------------------------------------------
   1.277 +
   1.278 +Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
   1.279 +
   1.280 +Index: sv.c
   1.281 +--- sv.c.orig	2007-12-18 11:47:08 +0100
   1.282 ++++ sv.c	2008-03-28 15:23:47 +0100
   1.283 +@@ -8667,7 +8667,10 @@
   1.284 + 	if ( (width = expect_number(&q)) ) {
   1.285 + 	    if (*q == '$') {
   1.286 + 		++q;
   1.287 +-		efix = width;
   1.288 ++		if (width > PERL_INT_MAX)
   1.289 ++		    efix = PERL_INT_MAX;
   1.290 ++		else
   1.291 ++		    efix = width;
   1.292 + 	    } else {
   1.293 + 		goto gotwidth;
   1.294 + 	    }
   1.295 +
   1.296 +-----------------------------------------------------------------------------
   1.297 +
   1.298 +Detect NetBSD 5.x as well
   1.299 +
   1.300 +Index: hints/netbsd.sh
   1.301 +--- hints/netbsd.sh.orig	2007-12-18 11:47:07.000000000 +0100
   1.302 ++++ hints/netbsd.sh	2008-12-24 10:51:08.000000000 +0100
   1.303 +@@ -79,7 +79,7 @@
   1.304 + 	;;
   1.305 + esac
   1.306 + case "$osvers" in
   1.307 +-0.9*|1.*|2.*|3.*|4.*)
   1.308 ++0.9*|1.*|2.*|3.*|4.*|5.*)
   1.309 + 	d_getprotoent_r="$undef"
   1.310 + 	d_getprotobyname_r="$undef"
   1.311 + 	d_getprotobynumber_r="$undef"
   1.312 +

mercurial