From 941a48f9b12b4c470686321bf4fd58c23b6cf86d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sat, 22 Feb 2020 11:35:34 +0100 Subject: agent,dirmngr: Re-read the user specified config file. * agent/gpg-agent.c (reread_configuration): Use a two-part config file. * dirmngr/dirmngr.c (reread_configuration): Ditto. -- If --options is used to to set a specific options file, this file and not the default file needs to be re-read on SIGHUP. GnuPG-bug-id: 4788 --- dirmngr/dirmngr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'dirmngr/dirmngr.c') diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 875a42442..8424c4aca 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -1812,11 +1812,17 @@ static void reread_configuration (void) { gpgrt_argparse_t pargs; + char *twopart; int dummy; if (!opt.config_filename) return; /* No config file. */ + twopart = strconcat (DIRMNGR_NAME EXTSEP_S "conf" PATHSEP_S, + opt.config_filename, NULL); + if (!twopart) + return; /* Out of core. */ + parse_rereadable_options (NULL, 1); /* Start from the default values. */ memset (&pargs, 0, sizeof pargs); @@ -1825,7 +1831,7 @@ reread_configuration (void) pargs.flags = (ARGPARSE_FLAG_KEEP |ARGPARSE_FLAG_SYS |ARGPARSE_FLAG_USER); - while (gpgrt_argparser (&pargs, opts, DIRMNGR_NAME EXTSEP_S "conf") ) + while (gpgrt_argparser (&pargs, opts, twopart)) { if (pargs.r_opt == ARGPARSE_CONFFILE) { @@ -1838,7 +1844,7 @@ reread_configuration (void) parse_rereadable_options (&pargs, 1); } gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */ - + xfree (twopart); post_option_parsing (); } -- cgit v1.2.3