X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7ddea03684df47c861c264216b83e7653d6784fd..d0363a34a3eeb7af441fb793d28e54c03a1abdde:/IkiWiki/Receive.pm?ds=inline diff --git a/IkiWiki/Receive.pm b/IkiWiki/Receive.pm index 72668d26a..37b6f2a62 100644 --- a/IkiWiki/Receive.pm +++ b/IkiWiki/Receive.pm @@ -6,21 +6,21 @@ use warnings; use strict; use IkiWiki; -sub getuser () { #{{{ +sub getuser () { my $user=(getpwuid(exists $ENV{CALLER_UID} ? $ENV{CALLER_UID} : $<))[0]; if (! defined $user) { error("cannot determine username for $<"); } return $user; -} #}}} +} -sub trusted () { #{{{ +sub trusted () { my $user=getuser(); return ! ref $config{untrusted_committers} || ! grep { $_ eq $user } @{$config{untrusted_committers}}; -} #}}} +} -sub gen_wrapper () { #{{{ +sub gen_wrapper () { # Test for commits from untrusted committers in the wrapper, to # avoid loading ikiwiki at all for trusted commits. @@ -43,9 +43,9 @@ EOF } EOF return $ret; -} #}}} +} -sub test () { #{{{ +sub test () { exit 0 if trusted(); IkiWiki::lockwiki(); @@ -130,6 +130,6 @@ sub test () { #{{{ } exit 0; -} #}}} +} 1