aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-12-24 14:35:01 +0000
committerSimon McVittie <smcv@debian.org>2016-12-28 21:32:12 +0000
commite193c75b7dd67cee731570c321a121cf79cb3c23 (patch)
treec7d35a70ebd87ddc79512934a9703bef6e60e4d4
parenta67f4d39448e12369426c3509967dc0d4b7afaeb (diff)
downloadikiwiki-e193c75b7dd67cee731570c321a121cf79cb3c23.tar
ikiwiki-e193c75b7dd67cee731570c321a121cf79cb3c23.tar.gz
git: do not fail to commit if committer is anonymous
-rw-r--r--IkiWiki/Plugin/git.pm10
-rw-r--r--debian/changelog2
2 files changed, 10 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 331b48fda..aef0c6cb1 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -600,18 +600,24 @@ sub rcs_commit_helper (@) {
elsif (defined $params{session}->remote_addr()) {
$u=$params{session}->remote_addr();
}
- if (defined $u) {
+ if (length $u) {
$u=encode_utf8(IkiWiki::cloak($u));
$ENV{GIT_AUTHOR_NAME}=$u;
}
+ else {
+ $u = 'anonymous';
+ }
if (defined $params{session}->param("nickname")) {
$u=encode_utf8($params{session}->param("nickname"));
$u=~s/\s+/_/g;
$u=~s/[^-_0-9[:alnum:]]+//g;
}
- if (defined $u) {
+ if (length $u) {
$ENV{GIT_AUTHOR_EMAIL}="$u\@web";
}
+ else {
+ $ENV{GIT_AUTHOR_EMAIL}='anonymous@web';
+ }
}
ensure_committer();
diff --git a/debian/changelog b/debian/changelog
index 422876e3c..86d06bdc6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ ikiwiki (3.20161220) UNRELEASED; urgency=medium
* Add CVE references for CVE-2016-10026
* Add missing ikiwiki.setup for the manual test for CVE-2016-10026
* git: don't issue a warning if the rcsinfo CGI parameter is undefined
+ * git: do not fail to commit changes with a recent git version
+ and an anonymous committer
-- Simon McVittie <smcv@debian.org> Wed, 21 Dec 2016 13:03:07 +0000