1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-30 22:08:02 +02:00

gpg: Do not close stdout after --export-ssh-key

* g10/export.c (export_ssh_key): Do not close stdout.
--

stdout should never be closed; this fixes this minor bug.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-07-16 11:24:07 +02:00
parent 8abf065307
commit 5c514a274c
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -2482,7 +2482,7 @@ export_ssh_key (ctrl_t ctrl, const char *userid)
err = gpg_error_from_syserror ();
else
{
if (es_fclose (fp))
if (fp != es_stdout && es_fclose (fp))
err = gpg_error_from_syserror ();
fp = NULL;
}
@ -2491,6 +2491,7 @@ export_ssh_key (ctrl_t ctrl, const char *userid)
log_error (_("error writing '%s': %s\n"), fname, gpg_strerror (err));
leave:
if (fp != es_stdout)
es_fclose (fp);
release_kbnode (keyblock);
return err;