1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

gpgconf: Support --homedir for --launch.

* tools/gpgconf-comp.c (gpg_agent_runtime_change): Simplify because
gnupg_homedir already returns abd absolute name.
(scdaemon_runtime_change): Ditto.
(dirmngr_runtime_change): Ditto.
(gc_component_launch): Support --homedir.
--

GnuPG-bug-id: 4496
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-05-15 08:50:15 +02:00
parent 110932925b
commit 31e26037bd
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 11 additions and 16 deletions

View File

@ -393,6 +393,8 @@ extends numerical field values by human-readable descriptions.
@opindex quiet
Try to be as quiet as possible.
@include opt-homedir.texi
@item -n
@itemx --dry-run
Do not actually change anything. This is currently only implemented

View File

@ -1152,12 +1152,8 @@ gpg_agent_runtime_change (int killflag)
pgmname = gnupg_module_name (GNUPG_MODULE_NAME_CONNECT_AGENT);
if (!gnupg_default_homedir_p ())
{
abs_homedir = make_absfilename_try (gnupg_homedir (), NULL);
if (!abs_homedir)
err = gpg_error_from_syserror ();
argv[i++] = "--homedir";
argv[i++] = abs_homedir;
argv[i++] = gnupg_homedir ();
}
argv[i++] = "--no-autostart";
argv[i++] = killflag? "KILLAGENT" : "RELOADAGENT";
@ -1195,12 +1191,8 @@ scdaemon_runtime_change (int killflag)
pgmname = gnupg_module_name (GNUPG_MODULE_NAME_CONNECT_AGENT);
if (!gnupg_default_homedir_p ())
{
abs_homedir = make_absfilename_try (gnupg_homedir (), NULL);
if (!abs_homedir)
err = gpg_error_from_syserror ();
argv[i++] = "--homedir";
argv[i++] = abs_homedir;
argv[i++] = gnupg_homedir ();
}
argv[i++] = "-s";
argv[i++] = "--no-autostart";
@ -1239,12 +1231,8 @@ dirmngr_runtime_change (int killflag)
argv[3] = NULL;
else
{
abs_homedir = make_absfilename_try (gnupg_homedir (), NULL);
if (!abs_homedir)
err = gpg_error_from_syserror ();
argv[3] = "--homedir";
argv[4] = abs_homedir;
argv[4] = gnupg_homedir ();
argv[5] = NULL;
}
@ -1266,7 +1254,7 @@ gc_component_launch (int component)
{
gpg_error_t err;
const char *pgmname;
const char *argv[3];
const char *argv[5];
int i;
pid_t pid;
@ -1288,6 +1276,11 @@ gc_component_launch (int component)
pgmname = gnupg_module_name (GNUPG_MODULE_NAME_CONNECT_AGENT);
i = 0;
if (!gnupg_default_homedir_p ())
{
argv[i++] = "--homedir";
argv[i++] = gnupg_homedir ();
}
if (component == GC_COMPONENT_DIRMNGR)
argv[i++] = "--dirmngr";
argv[i++] = "NOP";