]> git.kaiwu.me - haproxy.git/commit
DEV: patchbot: update: report the exact git error to the user
authorWilly Tarreau <w@1wt.eu>
Mon, 6 Jul 2026 21:13:29 +0000 (23:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2026 12:45:32 +0000 (14:45 +0200)
commitd5c6431907ffa0041306e8ee1233d16a414d4d92
treec6f9daecb8450ebe9a2ab40ecc65c2ee40d11afa
parent96f415006ee03656881d8b67746982d194511f02
DEV: patchbot: update: report the exact git error to the user

The "git commit failed" warning said nothing about the cause, leaving
the admin to guess between a missing identity, an ownership refusal, a
git binary absent from the restricted PATH the web server gives to its
CGIs, etc. run_git() now captures the command's stdout and stderr
through a pipe and the warning line carries git's own message (first
255 bytes, control chars flattened), so the admin directly sees the
cause; as the command runs through /bin/sh, an unfindable git yields
status 127 and the shell's message, reworded as "cannot execute git:
..." to directly point at the typical PATH issue. Capturing also
guarantees that git output can never corrupt the CGI response nor leak
to the client on servers which wire the CGI's stderr to the socket.
dev/patchbot/cgi/update.awk