perl.patch 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. By default, the "vendor" area is not used, so Perl's installation
  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"
  4. area is.
  5. Index: installperl
  6. --- installperl.orig 2006-08-15 14:37:41 +0200
  7. +++ installperl 2006-08-18 21:05:05 +0200
  8. @@ -211,6 +211,8 @@
  9. my $installarchlib = "$destdir$Config{installarchlib}";
  10. my $installsitelib = "$destdir$Config{installsitelib}";
  11. my $installsitearch = "$destdir$Config{installsitearch}";
  12. +my $installvendorlib = "$destdir$Config{installvendorlib}";
  13. +my $installvendorarch = "$destdir$Config{installvendorarch}";
  14. my $installman1dir = "$destdir$Config{installman1dir}";
  15. my $man1ext = $Config{man1ext};
  16. my $libperl = $Config{libperl};
  17. @@ -403,6 +405,8 @@
  18. mkpath($installarchlib, $verbose, 0777);
  19. mkpath($installsitelib, $verbose, 0777) if ($installsitelib);
  20. mkpath($installsitearch, $verbose, 0777) if ($installsitearch);
  21. +mkpath($installvendorlib, $verbose, 0777) if ($installvendorlib);
  22. +mkpath($installvendorarch, $verbose, 0777) if ($installvendorarch);
  23. if (chdir "lib") {
  24. $do_installarchlib = ! samepath($installarchlib, '.');
  25. -----------------------------------------------------------------------------
  26. By default, the Perl module search order is "use lib, -I, PERL[5]LIB,
  27. perl, site, vendor, other". This means that in OpenPKG both the modules
  28. installed via CPAN shell (in "site" area) and the "perl-xxx" packages
  29. (in "vendor" area) cannot override the (sometimes obsoleted) module
  30. versions distributed with Perl (in "perl" area). Hence, we change
  31. the search order to a more reasonable one for OpenPKG: "use lib, -I,
  32. PERL[5]LIB, site, vendor, perl, other".
  33. Index: perl.c
  34. --- perl.c.orig 2006-08-15 14:37:41 +0200
  35. +++ perl.c 2006-08-18 21:08:14 +0200
  36. @@ -4749,39 +4749,6 @@
  37. incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE);
  38. #endif
  39. -#ifdef ARCHLIB_EXP
  40. - incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
  41. -#endif
  42. -#ifdef MACOS_TRADITIONAL
  43. - {
  44. - Stat_t tmpstatbuf;
  45. - SV * privdir = newSV(0);
  46. - char * macperl = PerlEnv_getenv("MACPERL");
  47. -
  48. - if (!macperl)
  49. - macperl = "";
  50. -
  51. - Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
  52. - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
  53. - incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
  54. - Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
  55. - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
  56. - incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
  57. -
  58. - SvREFCNT_dec(privdir);
  59. - }
  60. - if (!PL_tainting)
  61. - incpush(":", FALSE, FALSE, TRUE, FALSE);
  62. -#else
  63. -#ifndef PRIVLIB_EXP
  64. -# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
  65. -#endif
  66. -#if defined(WIN32)
  67. - incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
  68. -#else
  69. - incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
  70. -#endif
  71. -
  72. #ifdef SITEARCH_EXP
  73. /* sitearch is always relative to sitelib on Windows for
  74. * DLL-based path intuition to work correctly */
  75. @@ -4824,6 +4791,39 @@
  76. incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE);
  77. #endif
  78. +#ifdef ARCHLIB_EXP
  79. + incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
  80. +#endif
  81. +#ifdef MACOS_TRADITIONAL
  82. + {
  83. + Stat_t tmpstatbuf;
  84. + SV * privdir = newSV(0);
  85. + char * macperl = PerlEnv_getenv("MACPERL");
  86. +
  87. + if (!macperl)
  88. + macperl = "";
  89. +
  90. + Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
  91. + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
  92. + incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
  93. + Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
  94. + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
  95. + incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
  96. +
  97. + SvREFCNT_dec(privdir);
  98. + }
  99. + if (!PL_tainting)
  100. + incpush(":", FALSE, FALSE, TRUE, FALSE);
  101. +#else
  102. +#ifndef PRIVLIB_EXP
  103. +# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
  104. +#endif
  105. +#if defined(WIN32)
  106. + incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
  107. +#else
  108. + incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
  109. +#endif
  110. +
  111. #ifdef PERL_OTHERLIBDIRS
  112. incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE, TRUE);
  113. #endif
  114. -----------------------------------------------------------------------------
  115. Port to [Open]Darwin 6.6.2:
  116. 1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not
  117. understand "-no-cpp-precomp", so remove this build option.
  118. 2. The <sys/mman.h> indirectly includes system specific headers
  119. which in turn have fields named "environ" while Perl uses
  120. a define of "environ" internally. So wrap the inclusion.
  121. 3. Darwin 6 no longer accepts the non-standard "#import" statements,
  122. so replace with "#include" and circumvent some header problem
  123. related to the non-standard "__private_extern__" attribute.
  124. Index: hints/darwin.sh
  125. --- hints/darwin.sh.orig 2006-08-15 14:37:41 +0200
  126. +++ hints/darwin.sh 2006-08-18 21:05:05 +0200
  127. @@ -120,9 +120,6 @@
  128. *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;;
  129. esac
  130. -# Avoid Apple's cpp precompiler, better for extensions
  131. -cppflags="${cppflags} -no-cpp-precomp"
  132. -
  133. # This is necessary because perl's build system doesn't
  134. # apply cppflags to cc compile lines as it should.
  135. ccflags="${ccflags} ${cppflags}"
  136. @@ -182,8 +179,7 @@
  137. esac
  138. ldlibpthname='DYLD_LIBRARY_PATH';
  139. -# useshrplib=true results in much slower startup times.
  140. -# 'false' is the default value. Use Configure -Duseshrplib to override.
  141. +useshrplib='true'
  142. cat > UU/archname.cbu <<'EOCBU'
  143. # This script UU/archname.cbu will get 'called-back' by Configure
  144. Index: perlio.c
  145. --- perlio.c.orig 2006-08-15 14:37:41 +0200
  146. +++ perlio.c 2006-08-18 21:05:05 +0200
  147. @@ -461,7 +461,14 @@
  148. #include <unistd.h>
  149. #endif
  150. #ifdef HAS_MMAP
  151. +#ifdef PERL_DARWIN
  152. +#define environ_safe environ
  153. +#undef environ
  154. #include <sys/mman.h>
  155. +#define environ environ_safe
  156. +#else
  157. +#include <sys/mman.h>
  158. +#endif
  159. #endif
  160. void
  161. Index: ext/DynaLoader/dl_dyld.xs
  162. --- ext/DynaLoader/dl_dyld.xs.orig 2006-08-15 14:37:40 +0200
  163. +++ ext/DynaLoader/dl_dyld.xs 2006-08-18 21:05:05 +0200
  164. @@ -45,7 +45,13 @@
  165. #undef environ
  166. #undef bool
  167. +#ifdef PERL_DARWIN
  168. +#define __private_extern__ extern
  169. +#include <mach-o/dyld.h>
  170. +#undef __private_extern__
  171. +#else
  172. #import <mach-o/dyld.h>
  173. +#endif
  174. static char *dlerror()
  175. {
  176. -----------------------------------------------------------------------------
  177. Port to Tru64 5.1:
  178. Under Tru64 our gcc has to be built without binutils and the system
  179. ld(1) does not accept a "-O" option, so remove the whole passing of
  180. optimization flags to ld(1). Under a brain-dead platform like Tru64 we
  181. really don't need any more optimization because we are already happy if
  182. it works at all.
  183. Index: hints/dec_osf.sh
  184. --- hints/dec_osf.sh.orig 2007-12-18 11:47:07 +0100
  185. +++ hints/dec_osf.sh 2007-12-19 12:31:37 +0100
  186. @@ -73,15 +73,6 @@
  187. *) if $test "X$optimize" = "X$undef"; then
  188. lddlflags="$lddlflags -msym"
  189. else
  190. - case "$myosvers" in
  191. - *4.0D*)
  192. - # QAR 56761: -O4 + .so may produce broken code,
  193. - # fixed in 4.0E or better.
  194. - ;;
  195. - *)
  196. - lddlflags="$lddlflags $optimize"
  197. - ;;
  198. - esac
  199. # -msym: If using a sufficiently recent /sbin/loader,
  200. # keep the module symbols with the modules.
  201. lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"
  202. -----------------------------------------------------------------------------
  203. http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0976
  204. Multiple scripts in the perl package in Trustix Secure Linux 1.5
  205. through 2.1, and possibly other operating systems, allows local
  206. users to overwrite files via a symlink attack on temporary files.
  207. Index: lib/CGI/Cookie.pm
  208. --- lib/CGI/Cookie.pm.orig 2006-08-15 14:37:41 +0200
  209. +++ lib/CGI/Cookie.pm 2006-08-18 21:05:05 +0200
  210. @@ -444,7 +444,7 @@
  211. You may also retrieve cookies that were stored in some external
  212. form using the parse() class method:
  213. - $COOKIES = `cat /usr/tmp/Cookie_stash`;
  214. + $COOKIES = `cat /var/run/www/Cookie_stash`;
  215. %cookies = parse CGI::Cookie($COOKIES);
  216. If you are in a mod_perl environment, you can save some overhead by
  217. Index: lib/Shell.pm
  218. --- lib/Shell.pm.orig 2006-08-15 14:37:41 +0200
  219. +++ lib/Shell.pm 2006-08-18 21:05:05 +0200
  220. @@ -154,7 +154,7 @@
  221. use Shell qw(cat ps cp);
  222. $passwd = cat('</etc/passwd');
  223. @pslines = ps('-ww'),
  224. - cp("/etc/passwd", "/tmp/passwd");
  225. + cp("/etc/passwd", "/etc/passwd.orig");
  226. # object oriented
  227. my $sh = Shell->new;
  228. -----------------------------------------------------------------------------
  229. Index: Configure
  230. --- Configure.orig 2006-08-15 14:37:40 +0200
  231. +++ Configure 2006-08-18 21:05:05 +0200
  232. @@ -7787,7 +7787,7 @@
  233. ;;
  234. linux|irix*|gnu*) dflt='-shared' ;;
  235. next) dflt='none' ;;
  236. - solaris) dflt='-G' ;;
  237. + solaris) dflt='-shared' ;;
  238. sunos) dflt='-assert nodefinitions' ;;
  239. svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
  240. *) dflt='none' ;;
  241. -----------------------------------------------------------------------------
  242. Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
  243. Index: sv.c
  244. --- sv.c.orig 2006-08-15 14:37:41 +0200
  245. +++ sv.c 2006-08-18 21:05:05 +0200
  246. @@ -8595,7 +8595,10 @@
  247. if ( (width = expect_number(&q)) ) {
  248. if (*q == '$') {
  249. ++q;
  250. - efix = width;
  251. + if (width > PERL_INT_MAX)
  252. + efix = PERL_INT_MAX;
  253. + else
  254. + efix = width;
  255. } else {
  256. goto gotwidth;
  257. }