X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/63db4f9dc6616b75ada8c04fd17e2a4f9a61ffd0..11ac8f5e18bb18ddb86b47844e10f22e554bb4e7:/doc/patchqueue/lib-fixup.mdwn diff --git a/doc/patchqueue/lib-fixup.mdwn b/doc/patchqueue/lib-fixup.mdwn index ff5a0d5c7..bdf8566d8 100644 --- a/doc/patchqueue/lib-fixup.mdwn +++ b/doc/patchqueue/lib-fixup.mdwn @@ -2,34 +2,46 @@ I'm using Ikiwiki on a box where I don't have root access, so I install all of m I imagine that there's a clean and elegant solution to this, but the hack I'm currently using is to have `./make` alter `ikiwki.in` before it's run, by inserting `use lib ...` lines for each of the directories in `$ENV{PERL5LIB}`. Again, this is clearly ugly, but it allows me to run `./make`, so I'm submitting it FWIW. -
-Index: lib-fixup.pl -=================================================================== ---- lib-fixup.pl (revision 0) -+++ lib-fixup.pl (revision 0) -@@ -0,0 +1,7 @@ -+#!/usr/bin/perl -i.bak -p -+use strict; -+use warnings; -+my $libs = join('', map { "use lib '$_';\n" } split /:/, $ENV{PERL5LIB}); -+s/(use IkiWiki;)/$1\n$libs/; -+ -+ +> I don't like this patch because it's not expected that an environment +> variable will stick around outside the shell that it's set in. It could +> lead to suprising behavior if PERL5LIB happened to be set during build, +> and it's even possible for it to lead to security issues, imagine if I +> accidentially built the debian package of ikiwiki with PERL5LIB set -- +> then it would be hardcoded to look in /home/joey for libraries, which +> someone with a "joey" account elsewhere could use to exploit it. +> +> You could remove the taint switch locally, it's very unlikely to find +> tainting problems that nobody else has noticed. --[[Joey]] + +>> I completely understand rejecting this patch, but would you accept one to automate the removal of -T as a `make` option, then? I was trying to install Ikiwiki on a very popular +>> web host, and the aforementioned issue took quite a while to debug; I imagine many people would have simply given up. -- Ben + +>>> Well, the problem with an option is finding the option before you give +>>> up. Maybe an option and adding some docs to the [[setup]] or [[tips]] page +>>> about how to use ikiwiki with $BIG_HOSTING_PROVIDER, that can mention +>>> the option. --[[Joey]] + +>>>> I was going to write a guide for shared hosting setup anyway, so that sounds great. My `make`-fu is weak, so I don't know the Right Way to add an extra option, but here's a patch for removing the -T flag. -- Ben -Property changes on: lib-fixup.pl -___________________________________________________________________ -Name: svn:executable - + * -Index: Makefile.PL ++Index: pm_filter =================================================================== ---- Makefile.PL (revision 2626) -+++ Makefile.PL (working copy) -@@ -24,6 +24,7 @@ - ) +--- pm_filter (revision 2644) ++++ pm_filter (working copy) +@@ -4,6 +4,7 @@ + $prefix=shift; + $ver=shift; + $libdir=shift; ++ $notaint=shift; + } - extra_build: -+ LANG=C ./lib-fixup.pl ikiwki.in - LANG=C ./ikiwiki.in doc html --templatedir=templates \ - --underlaydir=basewiki \ - --wikiname="ikiwiki" --verbose --no-rcs \ -\ No newline at end of file + if (/INSTALLDIR_AUTOREPLACE/) { +@@ -19,4 +20,7 @@ + else { + $_="use lib '$libdir';\n"; + } ++} ++elsif ($. == 1 && $notaint && m{^(#!/usr/bin/perl) -T$}) { ++ $_=qq{$1\n}; + } +