diff options
author | Werner Koch <[email protected]> | 2017-10-27 11:56:15 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-10-27 11:56:15 +0000 |
commit | f6ab97fd9620bb8f512ffb471a66e5f96098a7cc (patch) | |
tree | 99db33d56ef4f0c05f1d6af6ec7ffaffd9547e1b /tools/gpgconf-comp.c | |
parent | agent: Clean up pinentry access locking. (diff) | |
parent | agent, tests: Support --disable-scdaemon build case. (diff) | |
download | gnupg-f6ab97fd9620bb8f512ffb471a66e5f96098a7cc.tar.gz gnupg-f6ab97fd9620bb8f512ffb471a66e5f96098a7cc.zip |
Merge branch 'STABLE-BRANCH-2-2' into master
--
Resolved Conflicts:
configure.ac - Adjust due to new log_clock otions
Diffstat (limited to 'tools/gpgconf-comp.c')
-rw-r--r-- | tools/gpgconf-comp.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index e6ef4f4e3..9ce752b18 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -2085,9 +2085,12 @@ get_config_filename (gc_component_t component, gc_backend_t backend) /* Retrieve the options for the component COMPONENT from backend - BACKEND, which we already know is a program-type backend. */ + * BACKEND, which we already know is a program-type backend. With + * ONLY_INSTALLED set components which are not installed are silently + * ignored. */ static void -retrieve_options_from_program (gc_component_t component, gc_backend_t backend) +retrieve_options_from_program (gc_component_t component, gc_backend_t backend, + int only_installed) { gpg_error_t err; const char *pgmname; @@ -2107,6 +2110,11 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend) argv[0] = "--gpgconf-list"; argv[1] = NULL; + if (only_installed && access (pgmname, X_OK)) + { + return; /* The component is not installed. */ + } + err = gnupg_spawn_process (pgmname, argv, NULL, NULL, 0, NULL, &outfp, NULL, &pid); if (err) @@ -2378,7 +2386,7 @@ retrieve_options_from_file (gc_component_t component, gc_backend_t backend) /* Retrieve the currently active options and their defaults from all involved backends for this component. Using -1 for component will - retrieve all options from all components. */ + retrieve all options from all installed components. */ void gc_component_retrieve_options (int component) { @@ -2420,7 +2428,8 @@ gc_component_retrieve_options (int component) assert (backend != GC_BACKEND_ANY); if (gc_backend[backend].program) - retrieve_options_from_program (component, backend); + retrieve_options_from_program (component, backend, + process_all); else retrieve_options_from_file (component, backend); } |