diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-13 23:56:17 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-13 23:56:17 +0100 |
commit | 21b839e606c173efa942dc282b3b6b542d7242f5 (patch) | |
tree | fe5770986ceb0aada8f0e07774b5aee1e0d1b5d0 /gpg-interface.c | |
parent | Merge branch 'gc/parse-tree-indirect-errors' (diff) | |
parent | t/lib-gpg: kill all gpg components, not just gpg-agent (diff) | |
download | git-21b839e606c173efa942dc282b3b6b542d7242f5.tar.xz git-21b839e606c173efa942dc282b3b6b542d7242f5.zip |
Merge branch 'fs/gpgsm-update'
Newer version of GPGSM changed its output in a backward
incompatible way to break our code that parses its output. It also
added more processes our tests need to kill when cleaning up.
Adjustments have been made to accommodate these changes.
* fs/gpgsm-update:
t/lib-gpg: kill all gpg components, not just gpg-agent
t/lib-gpg: reload gpg components after updating trustlist
gpg-interface/gpgsm: fix for v2.3
Diffstat (limited to 'gpg-interface.c')
-rw-r--r-- | gpg-interface.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gpg-interface.c b/gpg-interface.c index aa50224e67..280f1fa1a5 100644 --- a/gpg-interface.c +++ b/gpg-interface.c @@ -934,6 +934,7 @@ static int sign_buffer_gpg(struct strbuf *buffer, struct strbuf *signature, struct child_process gpg = CHILD_PROCESS_INIT; int ret; size_t bottom; + const char *cp; struct strbuf gpg_status = STRBUF_INIT; strvec_pushl(&gpg.args, @@ -953,7 +954,13 @@ static int sign_buffer_gpg(struct strbuf *buffer, struct strbuf *signature, signature, 1024, &gpg_status, 0); sigchain_pop(SIGPIPE); - ret |= !strstr(gpg_status.buf, "\n[GNUPG:] SIG_CREATED "); + for (cp = gpg_status.buf; + cp && (cp = strstr(cp, "[GNUPG:] SIG_CREATED ")); + cp++) { + if (cp == gpg_status.buf || cp[-1] == '\n') + break; /* found */ + } + ret |= !cp; strbuf_release(&gpg_status); if (ret) return error(_("gpg failed to sign the data")); |