diff options
author | Werner Koch <[email protected]> | 2020-03-19 12:01:42 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-03-19 12:01:42 +0000 |
commit | b92860a8b9d253661de0060623e920b3f58e4443 (patch) | |
tree | 3daf0a537bc9dbbdff5858bd275632bb5aef4606 | |
parent | po: Update Japanese Translation. (diff) | |
download | gnupg-b92860a8b9d253661de0060623e920b3f58e4443.tar.gz gnupg-b92860a8b9d253661de0060623e920b3f58e4443.zip |
gpgconf: Take care of --homedir when reading/updating options.
* tools/gpgconf-comp.c (gc_component_check_options): Take care of
--homedir.
(retrieve_options_from_program): Ditto.
--
Note that due to the large changes in master we could not backport the
patch from there.
GnuPG-bug-id: 4882
-rw-r--r-- | tools/gpgconf-comp.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index 5fda68983..135d8004d 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -1708,7 +1708,7 @@ gc_component_check_options (int component, estream_t out, const char *conf_file) gc_backend_t backend; gc_option_t *option; const char *pgmname; - const char *argv[4]; + const char *argv[6]; int i; pid_t pid; int exitcode; @@ -1740,6 +1740,14 @@ gc_component_check_options (int component, estream_t out, const char *conf_file) pgmname = gnupg_module_name (gc_backend[backend].module_name); i = 0; + if (!gnupg_default_homedir_p () + && backend != GC_BACKEND_ANY + && backend != GC_BACKEND_DIRMNGR_LDAP_SERVER_LIST + && backend != GC_BACKEND_PINENTRY) + { + argv[i++] = "--homedir"; + argv[i++] = gnupg_homedir (); + } if (conf_file) { argv[i++] = "--options"; @@ -2081,7 +2089,7 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend, { gpg_error_t err; const char *pgmname; - const char *argv[2]; + const char *argv[4]; estream_t outfp; int exitcode; pid_t pid; @@ -2090,12 +2098,22 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend, ssize_t length; estream_t config; char *config_filename; + int i; pgmname = (gc_backend[backend].module_name ? gnupg_module_name (gc_backend[backend].module_name) : gc_backend[backend].program ); - argv[0] = "--gpgconf-list"; - argv[1] = NULL; + i = 0; + if (!gnupg_default_homedir_p () + && backend != GC_BACKEND_ANY + && backend != GC_BACKEND_DIRMNGR_LDAP_SERVER_LIST + && backend != GC_BACKEND_PINENTRY) + { + argv[i++] = "--homedir"; + argv[i++] = gnupg_homedir (); + } + argv[i++] = "--gpgconf-list"; + argv[i++] = NULL; if (only_installed && access (pgmname, X_OK)) { |