mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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@gnupg.org>
This commit is contained in:
parent
14601eacb5
commit
7614014169
2 changed files with 21 additions and 0 deletions
|
@ -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 ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue