X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/faf94b578729387f85af2b2b248959debe2fa4b8..5e741c434d72218f1608876d23b2ccd321955e11:/IkiWiki/Receive.pm?ds=sidebyside

diff --git a/IkiWiki/Receive.pm b/IkiWiki/Receive.pm
index 225f2b9ab..5908e09f9 100644
--- a/IkiWiki/Receive.pm
+++ b/IkiWiki/Receive.pm
@@ -35,10 +35,17 @@ EOF
 			}
 			"u != $uid";
 		} @{$config{untrusted_committers}}).
-		") exit(0);\n";
+		") {\n";
 
 	
 	$ret.=<<"EOF";
+			/* 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, "CALLER_UID=%i", u);
 		newenviron[i++]=s;
 	}
@@ -73,7 +80,7 @@ sub test () {
 		}) || error("failed adding user");
 	}
 
-	check_canchange(
+	IkiWiki::check_canchange(
 		cgi => $cgi,
 		session => $session,
 		changes => [IkiWiki::rcs_receive()]