From ed54fd53d1dc786c350b0c41e71afe349518f580 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 21 Sep 2022 09:39:48 +0200 Subject: [PATCH] tools: Need to set the dir for common.conf * tools/gpg-connect-agent.c (main): Set dirs. * tools/gpg-card.c (main): Ditto. -- Fixes-commit: 203dcc19eb48228c60036691fe87fb37e29369a4 --- g13/g13-syshelp.c | 4 ++-- tools/gpg-card.c | 2 ++ tools/gpg-connect-agent.c | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/g13/g13-syshelp.c b/g13/g13-syshelp.c index 4bfd927a7..6a4d3a446 100644 --- a/g13/g13-syshelp.c +++ b/g13/g13-syshelp.c @@ -291,8 +291,8 @@ main (int argc, char **argv) maybe_setuid = 0; /* - Now we are now working under our real uid - */ + * Now we are working under our real uid + */ /* Setup malloc hooks. */ { diff --git a/tools/gpg-card.c b/tools/gpg-card.c index 1ccace478..d851f99fc 100644 --- a/tools/gpg-card.c +++ b/tools/gpg-card.c @@ -294,6 +294,8 @@ main (int argc, char **argv) exit (2); /* Process common component options. */ + gpgrt_set_confdir (GPGRT_CONFDIR_SYS, gnupg_sysconfdir ()); + gpgrt_set_confdir (GPGRT_CONFDIR_USER, gnupg_homedir ()); if (parse_comopt (GNUPG_MODULE_NAME_CARD, opt.debug)) { gnupg_status_printf (STATUS_FAILURE, "option-parser %u", diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c index 8d9e83fa8..eb897287c 100644 --- a/tools/gpg-connect-agent.c +++ b/tools/gpg-connect-agent.c @@ -1257,7 +1257,10 @@ main (int argc, char **argv) if (log_get_errorcount (0)) exit (2); - /* Process common component options. */ + /* Process common component options. Note that we set the config + * dir only here so that --homedir will have an effect. */ + gpgrt_set_confdir (GPGRT_CONFDIR_SYS, gnupg_sysconfdir ()); + gpgrt_set_confdir (GPGRT_CONFDIR_USER, gnupg_homedir ()); if (parse_comopt (GNUPG_MODULE_NAME_CONNECT_AGENT, opt.verbose > 1)) exit(2);