summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2010-01-10 13:07:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-10 18:05:34 (GMT)
commita5487ddf0f8a8190b0722cf46dbe4cdd6ca9fa51 (patch)
treef040ea63783875b502bc78d998df511593a9f92e /cache-tree.c
parent27a557a9ff9273ad47aa29c52e9903cf6405f7f7 (diff)
downloadgit-a5487ddf0f8a8190b0722cf46dbe4cdd6ca9fa51.zip
git-a5487ddf0f8a8190b0722cf46dbe4cdd6ca9fa51.tar.gz
git-a5487ddf0f8a8190b0722cf46dbe4cdd6ca9fa51.tar.bz2
start_command: report child process setup errors to the parent's stderr
When the child process's environment is set up in start_command(), error messages were written to wherever the parent redirected the child's stderr channel. However, even if the parent redirected the child's stderr, errors during this setup process, including the exec itself, are usually an indication of a problem in the parent's environment. Therefore, the error messages should go to the parent's stderr. Redirection of the child's error messages is usually only used to redirect hook error messages during client-server exchanges. In these cases, hook setup errors could be regarded as information leak. This patch makes a copy of stderr if necessary and uses a special die routine that is used for all die() calls in the child that sends the errors messages to the parent's stderr. The trace call that reported a failed execvp is removed (because it writes to stderr) and replaced by die_errno() with special treatment of ENOENT. The improvement in the error message can be seen with this sequence: mkdir .git/hooks/pre-commit git commit Previously, the error message was error: cannot run .git/hooks/pre-commit: No such file or directory and now it is fatal: cannot exec '.git/hooks/pre-commit': Permission denied Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache-tree.c')
0 files changed, 0 insertions, 0 deletions