Home GnuPG
Diffusion GnuPG 18081e2ecf43

gpgsm: Terminate key listing on output write error.

Description

gpgsm: Terminate key listing on output write error.

* sm/keylist.c (list_internal_keys): Detect write errors to the output
stream.
* sm/server.c (any_failure_printed): New var.
(gpgsm_status2): Handle new var.  Move statusfp init to ...
(gpgsm_init_statusfp): new function.
(gpgsm_exit_failure_status): New.
* sm/gpgsm.c (main): Explicit statusfp init.
(gpgsm_exit): Print failure status on error.

Test by using

gpgsm -k >/dev/full
gpgsm -k --wit-colons >/dev/full

and also by redirecting to a file on a small partition.

Details

Provenance
wernerAuthored on Wed, Oct 23, 10:40 AM
Parents
rG40707c8bff49: agent: Fix resource leak for PRIMARY_CTX.
Branches
Unknown
Tags
Unknown
References
HEAD -> master
Tasks
T6185: `gpg2 --list-keys --with-colons > /dev/full` exits with status 0