summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-06-18 12:48:05 -0400
committerJoey Hess <joey@kitenet.net>2010-06-18 12:48:05 -0400
commit2797a659db82dd1a0021dacd005fa80212c41579 (patch)
tree785cd9ce22c0206aac701cbfee15391dad796569
parentcb4b99929757f970d5ae697f0d09514ad624ed46 (diff)
mercurial: Fix buggy getctime code.
The file passed to rcs_getctime is already absolute, and it was trying to stick the srcdir on the front. Also, eliminated potentially unsafe shelling.
-rw-r--r--IkiWiki/Plugin/mercurial.pm10
-rw-r--r--debian/changelog1
2 files changed, 5 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm
index 34e009c7a..a80bb2da5 100644
--- a/IkiWiki/Plugin/mercurial.pm
+++ b/IkiWiki/Plugin/mercurial.pm
@@ -236,15 +236,13 @@ sub rcs_diff ($) {
sub rcs_getctime ($) {
my ($file) = @_;
- # XXX filename passes through the shell here, should try to avoid
- # that just in case
my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v",
- "--style", "default", "$config{srcdir}/$file");
- open (my $out, "@cmdline |");
+ "--style", "default", $file);
+ open (my $out, "-|", @cmdline);
- my @log = mercurial_log($out);
+ my @log = (mercurial_log($out));
- if (length @log < 1) {
+ if (@log < 1) {
return 0;
}
diff --git a/debian/changelog b/debian/changelog
index 0d49df676..516b84063 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low
* attachment: Support Windows paths when taking basename of client-supplied
file name.
* theme: New plugin, allows easily theming a site via the underlay.
+ * mercurial: Fix buggy getctime code.
-- Joey Hess <joeyh@debian.org> Fri, 11 Jun 2010 13:39:15 -0400