From e193c75b7dd67cee731570c321a121cf79cb3c23 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 24 Dec 2016 14:35:01 +0000 Subject: [PATCH] git: do not fail to commit if committer is anonymous --- IkiWiki/Plugin/git.pm | 10 ++++++++-- debian/changelog | 2 ++ 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 Wed, 21 Dec 2016 13:03:07 +0000 -- 2.32.0.93.g670b81a890