X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/726270ad0017cfd1d1c36e9a765eb0638bec86f6..d4c7df992e4bac39b68a637cf541c351dce845f9:/IkiWiki/Receive.pm?ds=inline diff --git a/IkiWiki/Receive.pm b/IkiWiki/Receive.pm index 225f2b9ab..332ba7c2c 100644 --- a/IkiWiki/Receive.pm +++ b/IkiWiki/Receive.pm @@ -35,12 +35,19 @@ EOF } "u != $uid"; } @{$config{untrusted_committers}}). - ") exit(0);\n"; + ") {\n"; $ret.=<<"EOF"; - asprintf(&s, "CALLER_UID=%i", u); - newenviron[i++]=s; + /* Trusted user. + * Consume all stdin before exiting, as git may + * otherwise be unhappy. */ + char buf[256]; + while (read(0, &buf, 256) != 0) {} + exit(0); + } + asprintf(&s, "%i", u); + addenv("CALLER_UID", s); } EOF return $ret; @@ -73,7 +80,7 @@ sub test () { }) || error("failed adding user"); } - check_canchange( + IkiWiki::check_canchange( cgi => $cgi, session => $session, changes => [IkiWiki::rcs_receive()]