From e1463aece1c5cdd8b7a19da11663f15243619188 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Wed, 26 Sep 2007 20:55:38 -0400 Subject: [PATCH] Fix for commit e2067d9 and sending SIGUSR1. --- src/pwmd.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/pwmd.c b/src/pwmd.c index c6bc32d5..6b2b3b33 100644 --- a/src/pwmd.c +++ b/src/pwmd.c @@ -62,11 +62,28 @@ #include "cache.h" #include "pwmd.h" +static void clear_rcfile_key() +{ + gsize n; + gchar **groups; + gchar **p; + + groups = g_key_file_get_groups(keyfileh, &n); + + for (p = groups; *p; p++) { + GError *error = NULL; + + if (g_key_file_has_key(keyfileh, *p, "key", &error) == TRUE) + g_key_file_set_string(keyfileh, *p, "key", ""); + } +} + static void reload_rcfile() { log_write(N_("reloading configuration file '%s'"), rcfile); g_key_file_free(keyfileh); keyfileh = parse_rcfile(0); + clear_rcfile_key(); } gpg_error_t send_syserror(assuan_context_t ctx, int e) @@ -800,7 +817,6 @@ static gboolean parse_keyfile_key() do_cache_push(*p, str); g_free(str); - g_key_file_set_string(keyfileh, *p, "key", ""); continue; } @@ -1162,6 +1178,8 @@ int main(int argc, char *argv[]) if (parse_keyfile_key() == FALSE) goto do_exit; + clear_rcfile_key(); + /* * Set the cache entry for a file. Prompts for the password. */ -- 2.11.4.GIT