[Pkg-gnupg-commit] [gnupg2] 49/159: gpg: Mark more options as coming from the config file (when this holds)

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Jan 27 13:23:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit 478ca6c75bbf529f95974224dfb7d71bd5860a96
Author: Neal H. Walfield <neal at g10code.com>
Date:   Thu Dec 17 10:44:55 2015 +0100

    gpg: Mark more options as coming from the config file (when this holds)
    
    * g10/gpg.c (main): When --default-key or --encrypt-to-default-key is
    taken from the config file, note this.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
    Regression-due-to: 28311d1
---
 g10/gpg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/g10/gpg.c b/g10/gpg.c
index ee38be4..2f96bd7 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -3056,6 +3056,8 @@ main (int argc, char **argv)
 	  case oDefaultKey:
             sl = add_to_strlist (&opt.def_secret_key, pargs.r.ret_str);
             sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
+            if (configfp)
+              sl->flags |= PK_LIST_CONFIG;
             break;
 	  case oDefRecipient:
             if( *pargs.r.ret_str )
@@ -3259,7 +3261,7 @@ main (int argc, char **argv)
               sl->flags |= PK_LIST_CONFIG;
 	    break;
           case oEncryptToDefaultKey:
-            opt.encrypt_to_default_key = 1;
+            opt.encrypt_to_default_key = configfp ? 2 : 1;
             break;
 	  case oRecipient: /* store the recipient */
 	    sl = add_to_strlist2( &remusr, pargs.r.ret_str, utf8_strings );
@@ -4250,6 +4252,8 @@ main (int argc, char **argv)
               sl = add_to_strlist2 (&remusr, default_key, utf8_strings);
               sl->flags = ((oEncryptToDefaultKey << PK_LIST_SHIFT)
                            | PK_LIST_ENCRYPT_TO);
+              if (opt.encrypt_to_default_key == 2)
+                sl->flags |= PK_LIST_CONFIG;
             }
           else if (have_def_secret_key)
             log_info (_("option '%s' given, but no valid default keys given\n"),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list