Add fix for bug#1285
authorWerner Koch <wk@gnupg.org>
Fri, 24 Sep 2010 13:09:50 +0000 (13:09 +0000)
committerWerner Koch <wk@gnupg.org>
Fri, 24 Sep 2010 13:09:50 +0000 (13:09 +0000)
ChangeLog
Makefile.am
patches/gnupg2-2.0.16/06-reread-agent.patch [new file with mode: 0755]

index 98ae9da..83c0bf1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-09-24  Werner Koch  <wk@g10code.com>
+
+       * patches/gnupg2-2.0.16/06-reread-agent.patch: New.
+
 2010-09-23  Werner Koch  <wk@g10code.com>
 
        * packages/packages.current: Update bzip2.
index b335e0b..55d3d13 100644 (file)
@@ -64,6 +64,7 @@ EXTRA_DIST = autogen.sh README.SVN ONEWS \
         patches/gnupg2-2.0.16/03-kbx-realloc.patch \
        patches/gnupg2-2.0.16/04-gpgtar-2.patch \
        patches/gnupg2-2.0.16/05-err-codes.patch \
+       patches/gnupg2-2.0.16/06-reread-agent.patch \
        patches/dirmngr-1.0.3/01-ldaphttp.patch \
        patches/gpgol-0.9.91/01-gpgme.patch \
         patches/gpa-0.9.0/01-title-prop.patch \
diff --git a/patches/gnupg2-2.0.16/06-reread-agent.patch b/patches/gnupg2-2.0.16/06-reread-agent.patch
new file mode 100755 (executable)
index 0000000..bd33931
--- /dev/null
@@ -0,0 +1,55 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+2010-09-24  Werner Koch  <wk@g10code.com>
+
+       * gpg-agent.c (main, reread_configuration): Always test whether
+       the default configuration file has been created in the meantime.
+       Fixes bug#1285.
+
+
+--- agent/gpg-agent.c  (revision 5367)
++++ agent/gpg-agent.c  (working copy)
+@@ -724,6 +724,12 @@
+               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 @@
+       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 @@
+   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;
+     }
+