]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Receive.pm
(no commit message)
[git.ikiwiki.info.git] / IkiWiki / Receive.pm
index c73adfbbb84b34462eaa474ca315570aba85cc44..332ba7c2c378d45123c915115c243379940e9bbf 100644 (file)
@@ -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;