diff options
author | Werner Koch <wk@gnupg.org> | 2019-05-15 08:50:15 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2019-05-15 08:52:21 +0200 |
commit | a4be077abdbf286e3dcdeb0553ba0e74b7e2df5f (patch) | |
tree | 6342d518af331aae7d8daa9cdb498f0464a20c5e | |
parent | sm: Add a couple of debug calls to the keydb module. (diff) | |
download | gnupg2-a4be077abdbf286e3dcdeb0553ba0e74b7e2df5f.tar.xz gnupg2-a4be077abdbf286e3dcdeb0553ba0e74b7e2df5f.zip |
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>
-rw-r--r-- | doc/tools.texi | 2 | ||||
-rw-r--r-- | tools/gpgconf-comp.c | 25 |
2 files changed, 11 insertions, 16 deletions
diff --git a/doc/tools.texi b/doc/tools.texi index ba63506f3..7dcd84e2f 100644 --- a/doc/tools.texi +++ b/doc/tools.texi @@ -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 diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index a55d89874..a308c1c83 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -1156,12 +1156,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"; @@ -1199,12 +1195,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"; @@ -1243,12 +1235,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; } @@ -1270,7 +1258,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; @@ -1292,6 +1280,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"; |