aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/dirmngr.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-02-22 10:35:34 +0000
committerWerner Koch <[email protected]>2020-02-22 10:35:34 +0000
commit941a48f9b12b4c470686321bf4fd58c23b6cf86d (patch)
treef2fe5d0ad95524bdb3264458d2678d039b603cd8 /dirmngr/dirmngr.c
parentRemove the now obsolete argparse code. (diff)
downloadgnupg-941a48f9b12b4c470686321bf4fd58c23b6cf86d.tar.gz
gnupg-941a48f9b12b4c470686321bf4fd58c23b6cf86d.zip
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
Diffstat (limited to 'dirmngr/dirmngr.c')
-rw-r--r--dirmngr/dirmngr.c10
1 files changed, 8 insertions, 2 deletions
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 ();
}