diff options
Diffstat (limited to 'agent')
-rw-r--r-- | agent/ChangeLog | 6 | ||||
-rw-r--r-- | agent/gpg-agent.c | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog index 3c95cb4f2..6e1b45eee 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,9 @@ +2010-09-24 Werner Koch <[email protected]> + + * gpg-agent.c (main, reread_configuration): Always test whether + the default configuration file has been created in the meantime. + Fixes bug#1285. + 2010-08-11 Werner Koch <[email protected]> * call-pinentry.c (agent_askpin, agent_get_passphrase): Fix diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 1aa706d24..7e359479a 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -724,6 +724,12 @@ main (int argc, char **argv ) if( parse_debug ) log_info (_("NOTE: no default option file `%s'\n"), configname ); + /* Save the default conf file name so that + reread_configuration is able to test whether the + config file has been created in the meantime. */ + xfree (config_filename); + config_filename = configname; + configname = NULL; } else { @@ -811,10 +817,15 @@ main (int argc, char **argv ) fclose( configfp ); configfp = NULL; /* Keep a copy of the name so that it can be read on SIGHUP. */ - config_filename = configname; + if (config_filename != configname) + { + xfree (config_filename); + config_filename = configname; + } configname = NULL; goto next_pass; } + xfree (configname); configname = NULL; if (log_get_errorcount(0)) @@ -1332,8 +1343,8 @@ reread_configuration (void) fp = fopen (config_filename, "r"); if (!fp) { - log_error (_("option file `%s': %s\n"), - config_filename, strerror(errno) ); + log_info (_("option file `%s': %s\n"), + config_filename, strerror(errno) ); return; } |