]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/patchqueue/various_fixes.mdwn
responses
[git.ikiwiki.info.git] / doc / patchqueue / various_fixes.mdwn
1 Sorry if you don't appreciate me lumping all of these patches together.
3 These are various fixes I had to make when installing Ikiwiki. Some are
4 due it being a non-Debian system, the others are actual bugs.
6     --- upstream/IkiWiki/Rcs/svn.pm 2006-09-16 01:11:55.000000000 +0100
7     +++ main/IkiWiki/Rcs/svn.pm     2006-09-16 01:12:50.000000000 +0100
8     @@ -34,7 +34,7 @@
9             my $field=shift;
10             my $file=shift;
11     
12     -       my $info=`LANG=C svn info $file`;
13     +       my $info=`svn info $file`;
14             my ($ret)=$info=~/^$field: (.*)$/m;
15             return $ret;
16      } #}}}
17     @@ -140,7 +140,7 @@
18                     if $svn_version =~ /\d\.(\d)\.\d/ && $1 >= 2;
19     
20             my $svn_url=svn_info("URL", $config{srcdir});
21     -       my $xml = XMLin(scalar `svn $svn_limit --xml -v log '$svn_url'`,
22     +       my $xml = XMLin(scalar `svn $svn_limit --xml -v log '$svn_url' --config-dir /tmp`,
23                     ForceArray => [ 'logentry', 'path' ],
24                     GroupTags => { paths => 'path' },
25                     KeyAttr => { path => 'content' },
27 The first hunk of this patch is strange. It just failed to work with this
28 in place, and it took me a long time to figure it out. I realise what you
29 are trying to do, and it still works here as I use a similar LANG anyway.
31 For reference svn version 1.3.1 (r19032), my $LANG=en_GB.utf8, but I'm not 
32 sure what the CGI was running under. 
34 > That's strange. Is the problem to do with setting LANG=C or to do
35 > with the way it's set and exported on the same line as the svn info call?
36 > Can you reproduce the problem running svn info outside of ikiwiki?
37 > --[[Joey]]
39 The second removes problems with cannot access /home/$user/.svnsomething in
40 the logs. I think this problem was also fatal (I should have reported these
41 sooner). 
43 I can try and debug these problems if you could suggest some way to do so, 
44 but I am probably losing the server in a couple of days, so I can't be of too
45 much help I'm afraid.
47 > I imagine that passing --config-dir /tmp would be either insecure or 
48 > would limit ikiwiki use to one user per machine. 
49 > `--config-dir /etc/subversion` might be better, though still a hack,
50 > since a user's real ~/.subversion might be needed to access some repos.
51
52 > Maybe I didn't notice this problem since I have a ~/.subversion
53 > everywhere that I've used ikiwiki. Hmm, no, I don't reproduce it, svn
54 > happily recreated the directory during an ikiwiki run after I moved it
55 > out of the way here. Maybe an issue with old versions of svn? Although
56 > AFIACR, svn has auto-created ~/.subversion for years.
57
58 > What's the error message? --[[Joey]]
60 ----
62     --- IkiWiki/Plugin/search.pm
63     +++ IkiWiki/Plugin/search.pm
64     @@ -99,7 +99,7 @@
65             close TEMPLATE;
66             $cgi="$estdir/".IkiWiki::basename($config{cgiurl});
67             unlink($cgi);
68     -       symlink("/usr/lib/estraier/estseek.cgi", $cgi) ||
69     +       symlink("/usr/local/libexec/estseek.cgi", $cgi) ||
70                     error("symlink $cgi: $!");
71      } # }}}
73 obviously I'm not asking you to include this patch, but it would
74 be good if this sort of thing was configurable (at build time?). I can
75 have a go if you like, but I'm not sure what would be acceptable to
76 you.
78 > This should be made configurable via an option in %IkiWiki::config,
79 > the search plugin could register a getopt hook to handle it. --[[Joey]]
81 ----
83     --- IkiWiki.pm
84     +++ IkiWiki.pm
85     @@ -734,7 +734,18 @@
86             my $page=shift;
87             my $spec=shift;
88     
89     -       return eval pagespec_translate($spec);
90     +        my $pagespec = pagespec_translate($spec);
91     +
92     +        my $newpagespec;
93     +
94     +       local($1);
95     +       if ($pagespec =~ /(.*)/) {
96     +               $newpagespec = $1;
97     +       } else {
98     +               die "oh";
99     +       }
100     +
101     +       return eval $newpagespec;
102      } #}}}
103     
104      sub match_glob ($$) { #{{{
106 This works around a silly, but extremely annoying, taint bug in older
107 versions of perl. I'm not sure of the details, but it means that either
108 values become tainted from nowhere, or they don't get untainted possibly.
109 This also affects backports to sarge. `"oh"` is not going to be very 
110 informative if that code path is ever taken, but I hope that it never is.
112 > You're not the first person to report a problem here with older versions 
113 > of perl and pagespec tainting. I suspect that this would work around it:
114         return eval possibly_foolish_untaint(pagespec_translate($spec));
115 > I'm _very_ uncomfortable putting that in the shipping version of ikiwiki,
116 > because pagespecs are potentially _insanely_ dangerous, given how they're
117 > evaled and all. The tainting is the only sanity check there is that
118 > `pagespec_translate` manages to clean up any possibly harmful perl code
119 > in a pagespec. It's good to have belt and suspenders here. 
120
121 > For all I know, older versions of perl are keeping it tainted because
122 > `pagespec_translate` is somehow broken under old versions of perl and is
123 > in fact not fully untainting the pagespec. Ok, probably not, it's more
124 > likely that some of the regexps in there don't manage to clear the taint
125 > flag with old versions of perl, while still doing a perfectly ok job of
126 > sanitising the pagespec.
127
128 > I suppose that the version of perl ($^V) could be checked and the untaint 
129 > only be called for the old version. Though it seems it would be better
130 > to try to debug this some first. Maybe instrumenting `pagespec_translate`
131 > with calls to Scalar::Utils's tainted() function and seeing which parts
132 > of pagespecs arn't getting untainted would be a good start.
133
134 > --[[Joey]]
136 ----
138 As for backports there is a problem with the sarge version of libcgi-session-perl
139 and my sslcookie patch (complaints about a missing include file auto/CGI/Session/cookie.al IIRC).
140 This file does not and has not ever existed, but it appears to be fixed in 
141 the backport of libcgi-session-perl that I did. That puts the dependency
142 required at somewhere between 3.95-2 and 4.14-1. This could then be added
143 to debian/control. It would mean one more package to backport, but stops the
144 bug if anyone actually uses my sslcookie option except me.
146 > May as well, done --[[Joey]]
148 As for backports I managed with 
150  * ikiwiki_1.26
151  * libcgi-formbuilder-perl_3.03.01-1
152  * libcgi-session-perl_4.14-1
154 backported to sarge, with bpo in sources.list. This only covers Depends: though,
155 for instance hyperestraier needs to be backported, which I haven't got
156 round to yet as there is a chain to do.