[Pkg-gnupg-commit] [gpgme] 18/132: core: Always use runtime for gpgconf changes

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Apr 26 01:00:48 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gpgme.

commit 7103315829847163f1c6f52cad25d1ddb33358f0
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jan 2 13:11:10 2017 +0100

    core: Always use runtime for gpgconf changes
    
    * src/engine-gpgconf.c (gpgconf_write): Add --runtime.
    * src/gpgme.h.in (gpgme_conf_opt_change): Document this
    behavior.
    
    --
    If a tool uses GPGME for changing configuration values it
    needs a way to ensure that these changes take effect. Otherwise
    users may change and see config values and do not understand
    why they are not working.
---
 src/engine-gpgconf.c | 3 ++-
 src/gpgme.h.in       | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c
index 2ea8673..01a60eb 100644
--- a/src/engine-gpgconf.c
+++ b/src/engine-gpgconf.c
@@ -708,7 +708,7 @@ gpgconf_write (void *engine, const char *arg1, char *arg2, gpgme_data_t conf)
 #define BUFLEN 1024
   char buf[BUFLEN];
   int buflen = 0;
-  char *argv[6];
+  char *argv[7];
   int argc = 0;
   int rp[2];
   struct spawn_fd_item_s cfd[] = { {-1, 0 /* STDIN_FILENO */}, {-1, -1} };
@@ -724,6 +724,7 @@ gpgconf_write (void *engine, const char *arg1, char *arg2, gpgme_data_t conf)
       argv[argc++] = gpgconf->home_dir;
     }
 
+  argv[argc++] = (char*)"--runtime";
   argv[argc++] = (char*)arg1;
   argv[argc++] = arg2;
   argv[argc] = NULL;
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 7cfe8f6..4fc119f 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -2410,7 +2410,8 @@ void gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type);
 /* Register a change for the value of OPT to ARG.  If RESET is 1 (do
    not use any values but 0 or 1), ARG is ignored and the option is
    not changed (reverting a previous change).  Otherwise, if ARG is
-   NULL, the option is cleared or reset to its default.  */
+   NULL, the option is cleared or reset to its default. The change
+   is done with gpgconf's --runtime option to immediately take effect. */
 gpgme_error_t gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset,
 				     gpgme_conf_arg_t arg);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list