[git] GnuPG - branch, master, updated. gnupg-2.1.1-7-g7614014

by Werner Koch cvs at cvs.gnupg.org
Fri Dec 19 13:27:44 CET 2014


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  76140141699b545f7a988bf5fc101063917e8ce3 (commit)
      from  14601eacb51f6c8a60d3d57aee1be11debd94c68 (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 76140141699b545f7a988bf5fc101063917e8ce3
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Dec 19 13:28:14 2014 +0100

    agent: Make sure --max-cache-ttl is >= --default-cache-ttl.
    
    * agent/gpg-agent.c (finalize_rereadable_options): New.
    (main, reread_configuration): Call it.
    --
    
    This change should help to avoid surprising behaviour.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/NEWS b/NEWS
index 4bf2a44..f4a6918 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,10 @@
 Noteworthy changes in version 2.1.2 (unreleased)
 ------------------------------------------------
 
+ * agent: When setting --default-cache-ttl the value for
+   --max-cache-ttl is adjusted to be not lower than the former.
+
+
 Noteworthy changes in version 2.1.1 (2014-12-16)
 ------------------------------------------------
 
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index b053fc5..918c72b 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -628,6 +628,20 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
 }
 
 
+/* Fixup some options after all have been processed.  */
+static void
+finalize_rereadable_options (void)
+{
+  /* It would be too surprising if the max-cache-ttl is lower than the
+     default-cache-ttl - thus we silently correct that.  */
+  if (opt.def_cache_ttl > opt.max_cache_ttl)
+    opt.max_cache_ttl = opt.def_cache_ttl;
+  if (opt.def_cache_ttl_ssh > opt.max_cache_ttl_ssh)
+    opt.max_cache_ttl_ssh = opt.def_cache_ttl_ssh;
+}
+
+
+
 /* The main entry point.  */
 int
 main (int argc, char **argv )
@@ -916,6 +930,8 @@ main (int argc, char **argv )
   if (log_get_errorcount(0))
     exit(2);
 
+  finalize_rereadable_options ();
+
   /* Turn the homedir into an absolute one. */
   opt.homedir = make_absfilename (opt.homedir, NULL);
 
@@ -1461,6 +1477,7 @@ reread_configuration (void)
         parse_rereadable_options (&pargs, 1);
     }
   fclose (fp);
+  finalize_rereadable_options ();
   set_debug ();
 }
 

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

Summary of changes:
 NEWS              |    4 ++++
 agent/gpg-agent.c |   17 +++++++++++++++++
 2 files changed, 21 insertions(+)


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




More information about the Gnupg-commits mailing list