]> scripts.mit.edu Git - www/ikiwiki.git/blob - doc/patchqueue/Wrapper_config_with_multiline_regexp.mdwn
web commit by http://ccshan.myopenid.com/
[www/ikiwiki.git] / doc / patchqueue / Wrapper_config_with_multiline_regexp.mdwn
1 Turning the wikilink regexp into an extended regexp on the svn trunk seems to have broken the setuid wrapper on my system, because of two reasons: First, the wrapper generator should turn each newline in $configstring into `\n` in the C code rather than `\` followed by a newline in the C code.  Second, the untainting of $configstring should allow newlines.
2
3     Modified: wiki-meta/perl/IkiWiki.pm
4     ==============================================================================
5     --- wiki-meta/perl/IkiWiki.pm (original)
6     +++ wiki-meta/perl/IkiWiki.pm Mon Jun 11 10:52:07 2007
7     @@ -205,7 +205,7 @@
8      
9      sub possibly_foolish_untaint ($) { #{{{
10       my $tainted=shift;
11     - my ($untainted)=$tainted=~/(.*)/;
12     + my ($untainted)=$tainted=~/(.*)/s;
13       return $untainted;
14      } #}}}
15      
16     
17     Modified: wiki-meta/perl/IkiWiki/Wrapper.pm
18     ==============================================================================
19     --- wiki-meta/perl/IkiWiki/Wrapper.pm (original)
20     +++ wiki-meta/perl/IkiWiki/Wrapper.pm Mon Jun 11 10:52:07 2007
21     @@ -62,7 +62,7 @@
22       }
23       $configstring=~s/\\/\\\\/g;
24       $configstring=~s/"/\\"/g;
25     - $configstring=~s/\n/\\\n/g;
26     + $configstring=~s/\n/\\n/g;
27      
28       #translators: The first parameter is a filename, and the second is
29       #translators: a (probably not translated) error message.