perl.patch 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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 2003-09-02 15:40:21.000000000 +0200
  7. +++ installperl 2003-09-26 09:23:15.000000000 +0200
  8. @@ -189,6 +189,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. @@ -379,6 +381,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 2003-09-11 23:42:33.000000000 +0200
  35. +++ perl.c 2003-09-26 09:25:11.000000000 +0200
  36. @@ -3978,39 +3978,6 @@
  37. incpush(APPLLIB_EXP, TRUE, TRUE, TRUE);
  38. #endif
  39. -#ifdef ARCHLIB_EXP
  40. - incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE);
  41. -#endif
  42. -#ifdef MACOS_TRADITIONAL
  43. - {
  44. - Stat_t tmpstatbuf;
  45. - SV * privdir = NEWSV(55, 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);
  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);
  57. -
  58. - SvREFCNT_dec(privdir);
  59. - }
  60. - if (!PL_tainting)
  61. - incpush(":", FALSE, FALSE, TRUE);
  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);
  68. -#else
  69. - incpush(PRIVLIB_EXP, FALSE, FALSE, 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. @@ -4052,6 +4019,39 @@
  76. incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE);
  77. #endif
  78. +#ifdef ARCHLIB_EXP
  79. + incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE);
  80. +#endif
  81. +#ifdef MACOS_TRADITIONAL
  82. + {
  83. + Stat_t tmpstatbuf;
  84. + SV * privdir = NEWSV(55, 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);
  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);
  96. +
  97. + SvREFCNT_dec(privdir);
  98. + }
  99. + if (!PL_tainting)
  100. + incpush(":", FALSE, FALSE, TRUE);
  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);
  107. +#else
  108. + incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE);
  109. +#endif
  110. +
  111. #ifdef PERL_OTHERLIBDIRS
  112. incpush(PERL_OTHERLIBDIRS, 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 2004-05-25 22:52:21 +0200
  126. +++ hints/darwin.sh 2004-11-08 20:52:45 +0100
  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. @@ -162,8 +159,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 2003-09-24 22:50:22.000000000 +0200
  146. +++ perlio.c 2003-10-28 17:03:59.000000000 +0100
  147. @@ -432,7 +432,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. /*
  161. Index: ext/DynaLoader/dl_dyld.xs
  162. --- ext/DynaLoader/dl_dyld.xs.orig 2003-09-02 15:39:27.000000000 +0200
  163. +++ ext/DynaLoader/dl_dyld.xs 2003-10-28 17:07:31.000000000 +0100
  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 2004-03-24 23:59:53.000000000 +0100
  185. +++ hints/dec_osf.sh 2004-04-22 09:58:40.000000000 +0200
  186. @@ -237,15 +237,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 -std"
  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. --- lib/CGI/Cookie.pm 2001-03-04 06:53:20.000000000 +1100
  208. +++ lib/CGI/Cookie.pm 2004-12-22 22:29:46.000000000 +1100
  209. @@ -363,7 +363,7 @@
  210. You may also retrieve cookies that were stored in some external
  211. form using the parse() class method:
  212. - $COOKIES = `cat /usr/tmp/Cookie_stash`;
  213. + $COOKIES = `cat /var/run/www/Cookie_stash`;
  214. %cookies = parse CGI::Cookie($COOKIES);
  215. =head2 Manipulating Cookies
  216. --- lib/ExtUtils/MakeMaker.pm 2001-02-23 13:57:55.000000000 +1100
  217. +++ lib/ExtUtils/MakeMaker.pm 2004-12-22 22:33:57.000000000 +1100
  218. @@ -898,7 +898,7 @@
  219. The Makefile to be produced may be altered by adding arguments of the
  220. form C<KEY=VALUE>. E.g.
  221. - perl Makefile.PL PREFIX=/tmp/myperl5
  222. + perl Makefile.PL PREFIX=~/myperl5
  223. Other interesting targets in the generated Makefile are
  224. --- lib/Shell.pm.orig 2004-06-01 11:42:17 +0200
  225. +++ lib/Shell.pm 2005-01-11 15:07:37 +0100
  226. @@ -127,7 +127,7 @@
  227. use Shell qw(cat ps cp);
  228. $passwd = cat('</etc/passwd');
  229. @pslines = ps('-ww'),
  230. - cp("/etc/passwd", "/tmp/passwd");
  231. + cp("/etc/passwd", "/etc/passwd.orig");
  232. # object oriented
  233. my $sh = Shell->new;
  234. Index: Configure
  235. --- Configure.orig 2005-09-21 10:56:01.133363000 +0000
  236. +++ Configure 2005-09-21 12:15:36.836486000 +0000
  237. @@ -7630,7 +7630,7 @@
  238. ;;
  239. linux|irix*|gnu*) dflt='-shared' ;;
  240. next) dflt='none' ;;
  241. - solaris) dflt='-G' ;;
  242. + solaris) dflt='-shared' ;;
  243. sunos) dflt='-assert nodefinitions' ;;
  244. svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
  245. *) dflt='none' ;;
  246. Index: utils/h2ph.PL
  247. --- utils/h2ph.PL.orig 2005-04-04 23:47:17 +0200
  248. +++ utils/h2ph.PL 2005-09-21 17:08:46 +0200
  249. @@ -734,8 +734,9 @@
  250. # non-GCC?) C compilers, but gcc uses an additional include directory.
  251. sub inc_dirs
  252. {
  253. - my $from_gcc = `$Config{cc} -v 2>&1`;
  254. + my $from_gcc = `$Config{cc} -v 2>&1; $Config{cc} -print-search-dirs 2>&1`;
  255. $from_gcc =~ s:^Reading specs from (.*?)/specs\b.*:$1/include:s;
  256. + $from_gcc =~ s;^install:\s+([^\n\s]+).*;$1/include;s;
  257. length($from_gcc) ? ($from_gcc, $Config{usrinc}) : ($Config{usrinc});
  258. }
  259. Index: hints/solaris_2.sh
  260. --- hints/solaris_2.sh.orig 2005-04-04 22:03:12 +0200
  261. +++ hints/solaris_2.sh 2005-09-21 16:59:42 +0200
  262. @@ -211,7 +211,7 @@
  263. # Indent to avoid propagation to config.sh
  264. verbose=`${cc:-cc} -v -o try try.c 2>&1`
  265. -if echo "$verbose" | grep '^Reading specs from' >/dev/null 2>&1; then
  266. +if echo "$verbose" | egrep '^(Reading specs from|Using built-in specs)' >/dev/null 2>&1; then
  267. #
  268. # Using gcc.
  269. #
  270. -----------------------------------------------------------------------------
  271. Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
  272. Index: sv.c
  273. --- sv.c.orig 2005-05-27 12:38:11 +0200
  274. +++ sv.c 2005-12-03 13:49:26 +0100
  275. @@ -8519,7 +8519,10 @@
  276. if (EXPECT_NUMBER(q, width)) {
  277. if (*q == '$') {
  278. ++q;
  279. - efix = width;
  280. + if (width > PERL_INT_MAX)
  281. + efix = PERL_INT_MAX;
  282. + else
  283. + efix = width;
  284. } else {
  285. goto gotwidth;
  286. }