[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.1-18-g6e808ae

by Werner Koch cvs at cvs.gnupg.org
Tue Oct 24 12:09:28 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, STABLE-BRANCH-2-2 has been updated
       via  6e808ae4700dc5e95bf4cc2d5c063df582c234d0 (commit)
      from  560d85ecff4246133d185dc29395f07c918b5556 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6e808ae4700dc5e95bf4cc2d5c063df582c234d0
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Oct 24 12:01:07 2017 +0200

    gpgconf: Ignore non-installed components with --apply-profile.
    
    * tools/gpgconf-comp.c (retrieve_options_from_program): Add arg
    only_installed.
    (gc_component_retrieve_options): Use this if we want to process all
    components.
    --
    
    Note that this also also ignores them in --with-defaults.  This is
    useful for systems which come without scdaemon.
    
    GnuPG-bug-id: 3313
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
index e6ef4f4..9ce752b 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);
             }

-----------------------------------------------------------------------

Summary of changes:
 tools/gpgconf-comp.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list