diff options
author | Werner Koch <[email protected]> | 2024-10-23 08:40:36 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2024-10-23 09:43:08 +0000 |
commit | 18081e2ecf43de2be6ad5a7ca3384e1e2b66914d (patch) | |
tree | 85aa3365b947da5bc7da0cea5610a60da6517eb3 /sm/gpgsm.h | |
parent | agent: Fix resource leak for PRIMARY_CTX. (diff) | |
download | gnupg-18081e2ecf43de2be6ad5a7ca3384e1e2b66914d.tar.gz gnupg-18081e2ecf43de2be6ad5a7ca3384e1e2b66914d.zip |
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.
GnuPG-bug-id: 6185
Diffstat (limited to 'sm/gpgsm.h')
-rw-r--r-- | sm/gpgsm.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sm/gpgsm.h b/sm/gpgsm.h index 916d0235c..cd45ec101 100644 --- a/sm/gpgsm.h +++ b/sm/gpgsm.h @@ -355,12 +355,14 @@ int gpgsm_parse_validation_model (const char *model); /*-- server.c --*/ void gpgsm_server (certlist_t default_recplist); +void gpgsm_init_statusfp (ctrl_t ctrl); gpg_error_t gpgsm_status (ctrl_t ctrl, int no, const char *text); gpg_error_t gpgsm_status2 (ctrl_t ctrl, int no, ...) GPGRT_ATTR_SENTINEL(0); gpg_error_t gpgsm_status_with_err_code (ctrl_t ctrl, int no, const char *text, gpg_err_code_t ec); gpg_error_t gpgsm_status_with_error (ctrl_t ctrl, int no, const char *text, gpg_error_t err); +void gpgsm_exit_failure_status (void); gpg_error_t gpgsm_progress_cb (ctrl_t ctrl, uint64_t current, uint64_t total); gpg_error_t gpgsm_proxy_pinentry_notify (ctrl_t ctrl, const unsigned char *line); |