[Pkg-gnupg-commit] [gnupg2] 12/49: gpg: Make --dry-run and show-only work for secret keys.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Nov 8 19:30:52 UTC 2017


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

dkg pushed a commit to branch master
in repository gnupg2.

commit 68c8619114fd5f24cb6bfb9e0f25c428a8805323
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 19 17:05:39 2017 +0200

    gpg: Make --dry-run and show-only work for secret keys.
    
    * g10/import.c (import_secret_one): Check for dry-run before
    transferring keys.
    --
    
    The use of --dry-run or --import-option show-only had no effect when
    importing a secret key and the public key already existed.  If the
    public key did not exist an error message inhibited the import of the
    secret key.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 g10/import.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/g10/import.c b/g10/import.c
index 8dd6b50..255e48f 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -2532,7 +2532,8 @@ import_secret_one (ctrl_t ctrl, kbnode_t keyblock,
       /* At least we cancel the secret key import when the public key
 	 import was skipped due to MERGE_ONLY option and a new
 	 key.  */
-      if (stats->skipped_new_keys <= nr_prev)
+      if (!(opt.dry_run || (options & IMPORT_DRY_RUN))
+          && stats->skipped_new_keys <= nr_prev)
 	{
           /* Read the keyblock again to get the effects of a merge.  */
           /* Fixme: we should do this based on the fingerprint or

-- 
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