[git] GnuPG - branch, master, updated. gnupg-2.1.22-9-gebc65ff

by Marcus Brinkmann cvs at cvs.gnupg.org
Tue Aug 1 17:46:46 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  ebc65ff459e6c228fb7406e375819a9fe5637abe (commit)
      from  a8d0b8d2333ddab703d1e346e06c106eeeedfd53 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ebc65ff459e6c228fb7406e375819a9fe5637abe
Author: Marcus Brinkmann <marcus.brinkmann at ruhr-uni-bochum.de>
Date:   Tue Aug 1 17:41:03 2017 +0200

    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 <mb at g10code.com>
    GnuPG-bug-id: 3015

diff --git a/g10/dearmor.c b/g10/dearmor.c
index 92239cc..839227a 100644
--- a/g10/dearmor.c
+++ b/g10/dearmor.c
@@ -63,7 +63,7 @@ dearmor_file( const char *fname )
 
     push_armor_filter ( afx, inp );
 
-    if( (rc = open_outfile (-1, fname, 0, 0, &out)) )
+    if( (rc = open_outfile (-1, fname, 0, 0, &out, 0)) )
 	goto leave;
 
     while( (c = iobuf_get(inp)) != -1 )
@@ -109,7 +109,7 @@ enarmor_file( const char *fname )
     }
 
 
-    if( (rc = open_outfile (-1, fname, 1, 0, &out )) )
+    if( (rc = open_outfile (-1, fname, 1, 0, &out, 0 )) )
 	goto leave;
 
     afx->what = 4;
diff --git a/g10/encrypt.c b/g10/encrypt.c
index c68d6d5..6495280 100644
--- a/g10/encrypt.c
+++ b/g10/encrypt.c
@@ -276,7 +276,7 @@ encrypt_simple (const char *filename, int mode, int use_seskey)
       do_compress = 0;
     }
 
-  if ( rc || (rc = open_outfile (-1, filename, opt.armor? 1:0, 0, &out )))
+  if ( rc || (rc = open_outfile (-1, filename, opt.armor? 1:0, 0, &out, 0 )))
     {
       iobuf_cancel (inp);
       xfree (cfx.dek);
@@ -574,7 +574,7 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
   if (opt.textmode)
     iobuf_push_filter (inp, text_filter, &tfx);
 
-  rc = open_outfile (outputfd, filename, opt.armor? 1:0, 0, &out);
+  rc = open_outfile (outputfd, filename, opt.armor? 1:0, 0, &out, 0);
   if (rc)
     goto leave;
 
diff --git a/g10/export.c b/g10/export.c
index 8f6371b..b194a2a 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -352,7 +352,7 @@ do_export (ctrl_t ctrl, strlist_t users, int secret, unsigned int options,
 
   memset( &zfx, 0, sizeof zfx);
 
-  rc = open_outfile (-1, NULL, 0, !!secret, &out );
+  rc = open_outfile (-1, NULL, 0, !!secret, &out, 0 );
   if (rc)
     return rc;
 
diff --git a/g10/main.h b/g10/main.h
index 87417ee..5862cdf 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -324,7 +324,7 @@ int overwrite_filep( const char *fname );
 char *make_outfile_name( const char *iname );
 char *ask_outfile_name( const char *name, size_t namelen );
 int open_outfile (int inp_fd, const char *iname, int mode,
-                  int restrictedperm, iobuf_t *a);
+                  int restrictedperm, iobuf_t *a, int no_outfile);
 char *get_matching_datafile (const char *sigfilename);
 iobuf_t open_sigfile (const char *sigfilename, progress_filter_context_t *pfx);
 void try_make_homedir( const char *fname );
diff --git a/g10/openfile.c b/g10/openfile.c
index 78f4dbb..03b114d 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
diff --git a/g10/revoke.c b/g10/revoke.c
index 1dea6ae..db3c495 100644
--- a/g10/revoke.c
+++ b/g10/revoke.c
@@ -334,7 +334,7 @@ gen_desig_revoke (ctrl_t ctrl, const char *uname, strlist_t locusr)
 	    if( !opt.armor )
 	      tty_printf(_("ASCII armored output forced.\n"));
 
-	    if( (rc = open_outfile (-1, NULL, 0, 1, &out )) )
+	    if( (rc = open_outfile (-1, NULL, 0, 1, &out, 0 )) )
 	      goto leave;
 
 	    afx->what = 1;
@@ -461,7 +461,7 @@ create_revocation (ctrl_t ctrl,
 
   afx = new_armor_context ();
 
-  if ((rc = open_outfile (-1, filename, suffix, 1, &out)))
+  if ((rc = open_outfile (-1, filename, suffix, 1, &out, !!filename)))
     goto leave;
 
   if (leadintext )
diff --git a/g10/sign.c b/g10/sign.c
index 4cf0cd3..0e379bc 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -889,7 +889,7 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr,
 	    log_info(_("writing to '%s'\n"), outfile );
     }
     else if( (rc = open_outfile (-1, fname,
-                                 opt.armor? 1: detached? 2:0, 0, &out)))
+                                 opt.armor? 1: detached? 2:0, 0, &out, 0)))
 	goto leave;
 
     /* prepare to calculate the MD over the input */
@@ -1191,7 +1191,7 @@ clearsign_file (ctrl_t ctrl,
 	else if( opt.verbose )
 	    log_info(_("writing to '%s'\n"), outfile );
     }
-    else if ((rc = open_outfile (-1, fname, 1, 0, &out)))
+    else if ((rc = open_outfile (-1, fname, 1, 0, &out, 0)))
 	goto leave;
 
     iobuf_writestr(out, "-----BEGIN PGP SIGNED MESSAGE-----" LF );
@@ -1340,7 +1340,7 @@ sign_symencrypt_file (ctrl_t ctrl, const char *fname, strlist_t locusr)
     cfx.dek->use_mdc = use_mdc (NULL, cfx.dek->algo);
 
     /* now create the outfile */
-    rc = open_outfile (-1, fname, opt.armor? 1:0, 0, &out);
+    rc = open_outfile (-1, fname, opt.armor? 1:0, 0, &out, 0);
     if (rc)
 	goto leave;
 

-----------------------------------------------------------------------

Summary of changes:
 g10/dearmor.c  |  4 ++--
 g10/encrypt.c  |  4 ++--
 g10/export.c   |  2 +-
 g10/main.h     |  2 +-
 g10/openfile.c | 12 +++++++-----
 g10/revoke.c   |  4 ++--
 g10/sign.c     |  6 +++---
 7 files changed, 18 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list