aboutsummaryrefslogtreecommitdiffstats
path: root/g10/openfile.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2017-08-01 15:41:03 +0000
committerMarcus Brinkmann <[email protected]>2017-08-01 15:41:03 +0000
commitebc65ff459e6c228fb7406e375819a9fe5637abe (patch)
treeb5db1cf2eae3cbc5b9be17ac37696aa97be2aa7d /g10/openfile.c
parentartwork: Add icons. (diff)
downloadgnupg-ebc65ff459e6c228fb7406e375819a9fe5637abe.tar.gz
gnupg-ebc65ff459e6c228fb7406e375819a9fe5637abe.zip
g10: Always save standard revocation certificate in file.
* g10/main.h (open_outfile): New parameter NO_OUTFILE. * g10/openfile.c (open_outfile): New parameter NO_OUTFILE. If given, never use opt.outfile. * g10/revoke.c (create_revocation): If FILENAME is true, also set NO_OUTFILE to true (for standard revocation certificates). * g10/dearmor.c, g10/encrypt.c, g10/export.c, g10/revoke.c, g10/sign.c: Adjust all other callers. Signed-off-by: Marcus Brinkmann <[email protected]> GnuPG-bug-id: 3015
Diffstat (limited to 'g10/openfile.c')
-rw-r--r--g10/openfile.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/g10/openfile.c b/g10/openfile.c
index 78f4dbbcb..03b114d58 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -174,13 +174,15 @@ ask_outfile_name( const char *name, size_t namelen )
* If INP_FD is not -1 the function simply creates an IOBUF for that
* file descriptor and ignore INAME and MODE. Note that INP_FD won't
* be closed if the returned IOBUF is closed. With RESTRICTEDPERM a
- * file will be created with mode 700 if possible.
+ * file will be created with mode 700 if possible. If NO_OUTFILE is
+ * true, don't use the outfile option even if it is set.
*/
int
open_outfile (int inp_fd, const char *iname, int mode, int restrictedperm,
- iobuf_t *a)
+ iobuf_t *a, int no_outfile)
{
int rc = 0;
+ const char outfile = no_outfile ? NULL : opt.outfile;
*a = NULL;
if (inp_fd != -1)
@@ -200,7 +202,7 @@ open_outfile (int inp_fd, const char *iname, int mode, int restrictedperm,
log_info (_("writing to '%s'\n"), xname);
}
}
- else if (iobuf_is_pipe_filename (iname) && !opt.outfile)
+ else if (iobuf_is_pipe_filename (iname) && !outfile)
{
*a = iobuf_create (NULL, 0);
if ( !*a )
@@ -218,8 +220,8 @@ open_outfile (int inp_fd, const char *iname, int mode, int restrictedperm,
if (opt.dry_run)
name = NAME_OF_DEV_NULL;
- else if (opt.outfile)
- name = opt.outfile;
+ else if (outfile)
+ name = outfile;
else
{
#ifdef USE_ONLY_8DOT3