run-command: do not pass child process data into callbacks
authorStefan Beller <sbeller@google.com>
Mon, 29 Feb 2016 21:57:06 +0000 (13:57 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Mar 2016 17:42:01 +0000 (09:42 -0800)
commit2a73b3dad09ef162eb5917e9e0d01d7c306f6b35
treed3566e6ddadb7f1cdeb0a520b125e9cbac164e77
parent62104ba14af4845c6c1ba1dab05fad4a289d806f
run-command: do not pass child process data into callbacks

The expected way to pass data into the callback is to pass them via
the customizable callback pointer. The error reporting in
default_{start_failure, task_finished} is not user friendly enough, that
we want to encourage using the child data for such purposes.

Furthermore the struct child data is cleaned by the run-command API,
before we access them in the callbacks, leading to use-after-free
situations.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c
run-command.h
submodule.c
test-run-command.c