]> git.ipfire.org Git - thirdparty/git.git/commit - gpg-interface.c
sign_buffer: use pipe_command
authorJeff King <peff@peff.net>
Fri, 17 Jun 2016 23:38:55 +0000 (19:38 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sat, 18 Jun 2016 00:03:57 +0000 (17:03 -0700)
commit0581b546419627d4e82f7df8b195fa207ef42f6a
tree25e43e9f84f459d04051da6d35efc8b18e8c59b3
parent0d2b664efd815a3f6432723adb41732d90cc9be1
sign_buffer: use pipe_command

Similar to the prior commit for verify_signed_buffer, the
motivation here is both to make the code simpler, and to
avoid any possible deadlocks with gpg.

In this case we have the same "write to stdin, then read
from stdout" that the verify case had. This is unlikely to
be a problem in practice, since stdout has the detached
signature, which it cannot compute until it has read all of
stdin (if it were a non-detached signature, that would be a
problem, though).

We don't read from stderr at all currently. However, we will
want to in a future patch, so this also prepares us there
(and in that case gpg _does_ write before reading all of the
input, though again, it is unlikely that a key uid will fill
up a pipe buffer).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gpg-interface.c