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