[git] GPGME - branch, master, updated. gpgme-1.4.0-8-gde30df9

by Werner Koch cvs at cvs.gnupg.org
Wed May 1 14:49:20 CEST 2013


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 "GnuPG Made Easy".

The branch, master has been updated
       via  de30df9ce359202b2449697c7e16dc0311e9050f (commit)
       via  5075c0da7c464af2a45cd36db134ed7e88f155af (commit)
       via  ef5b4ae37d13142e89a051908dc080cda3d24baa (commit)
       via  f623a6b94c527795d0b6f7e66a3966e5d9e1c454 (commit)
       via  0ff0aa3fc8440420247fe4cff30c3ac9be1b2f7d (commit)
       via  867b950b9306904a0ff522d0ef4a43789393cfc4 (commit)
      from  12374cbecede047accd2d2267bba5927037ed16c (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 de30df9ce359202b2449697c7e16dc0311e9050f
Author: Werner Koch <wk at gnupg.org>
Date:   Wed May 1 14:27:08 2013 +0200

    Post release version bump.
    
    --

diff --git a/NEWS b/NEWS
index 39acc46..bf8c2f9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Noteworthy changes in version 1.4.2 (unreleased)
+------------------------------------------------
+
+
 Noteworthy changes in version 1.4.1 (2013-05-01)
 ------------------------------------------------
 
diff --git a/configure.ac b/configure.ac
index 5dee0aa..25dce1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,7 @@ min_automake_version="1.11"
 # for the LT versions.
 m4_define(mym4_version_major, [1])
 m4_define(mym4_version_minor, [4])
-m4_define(mym4_version_micro, [1])
+m4_define(mym4_version_micro, [2])
 
 # Below is m4 magic to extract and compute the revision number, the
 # decimalized short revision number, a beta version string, and a flag

commit 5075c0da7c464af2a45cd36db134ed7e88f155af
Author: Werner Koch <wk at gnupg.org>
Date:   Wed May 1 13:51:27 2013 +0200

    Release 1.4.1.
    
    * configure.ac: Bump LT version to C20/A9/R1.

diff --git a/NEWS b/NEWS
index 693a2b7..39acc46 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,12 @@
-Noteworthy changes in version 1.4.1 (unreleased)
+Noteworthy changes in version 1.4.1 (2013-05-01)
 ------------------------------------------------
 
- * Fix reading of gpg conf files with excessive use of the group
+ * Fixed reading of gpg.conf files with excessive use of the group
    option.
 
- * Fix building with the i686-w64-mingw32 toolchain.
+ * Fixed building with the i686-w64-mingw32 toolchain.
+
+ * Disabled FD passing by default for Apple.
 
 
 Noteworthy changes in version 1.4.0 (2013-02-26)
diff --git a/configure.ac b/configure.ac
index dcd2305..5dee0aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ LIBGPGME_LT_CURRENT=20
 # Subtract 2 from this value if you want to make the LFS transition an
 # ABI break.  [Note to self: Remove this comment with the next regular break.]
 LIBGPGME_LT_AGE=9
-LIBGPGME_LT_REVISION=0
+LIBGPGME_LT_REVISION=1
 
 # If the API is changed in an incompatible way: increment the next counter.
 GPGME_CONFIG_API_VERSION=1

commit ef5b4ae37d13142e89a051908dc080cda3d24baa
Author: Werner Koch <wk at gnupg.org>
Date:   Wed May 1 13:47:41 2013 +0200

    Disable fd-passing for Apple.
    
    * configure.ac: Disable fd-passing by default for Apple.
    --
    
    We have not yet tracked down the problem, thus we revert to the
    pre-1.4 behaviour for Apple.
    
    GnuPG-bug-id: 1483

diff --git a/configure.ac b/configure.ac
index d7ce215..dcd2305 100644
--- a/configure.ac
+++ b/configure.ac
@@ -872,7 +872,18 @@ AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
 #include <unistd.h>
        ])
 
-use_descriptor_passing=yes
+
+dnl There seems to be a problem with Apple and decriptor passing.
+dnl Until we found a solution we change the default to no.
+dnl See bug 1483.
+case "${host}" in
+    *-apple-darwin*)
+      use_descriptor_passing=no
+      ;;
+    *)
+      use_descriptor_passing=yes
+      ;;
+esac
 AC_ARG_ENABLE(fd-passing,
   AC_HELP_STRING([--disable-fd-passing], [do not use FD passing]),
   use_descriptor_passing=$enableval)

commit f623a6b94c527795d0b6f7e66a3966e5d9e1c454
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Apr 30 18:09:13 2013 +0200

    Allow reading of long gpgconf output lines.
    
    * src/engine-gpgconf.c (gpgconf_read): Rewrite to allow for line
    lengths up to 64k.

diff --git a/NEWS b/NEWS
index b55c113..693a2b7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,11 @@
 Noteworthy changes in version 1.4.1 (unreleased)
 ------------------------------------------------
 
+ * Fix reading of gpg conf files with excessive use of the group
+   option.
+
+ * Fix building with the i686-w64-mingw32 toolchain.
+
 
 Noteworthy changes in version 1.4.0 (2013-02-26)
 ------------------------------------------------
diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c
index fec0fc3..3a1c1c1 100644
--- a/src/engine-gpgconf.c
+++ b/src/engine-gpgconf.c
@@ -1,6 +1,7 @@
 /* engine-gpgconf.c - gpg-conf engine.
    Copyright (C) 2000 Werner Koch (dd9jn)
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 g10 Code GmbH
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008,
+                 2013 g10 Code GmbH
 
    This file is part of GPGME.
 
@@ -191,7 +192,10 @@ gpgconf_config_release (gpgme_conf_comp_t conf)
     }
 }
 
-
+/* Read from gpgconf and pass line after line to the hook function.
+   We put a limit of 64 k on the maximum size for a line.  This should
+   allow for quite a long "group" line, which is usually the longest
+   line (mine is currently ~3k).  */
 static gpgme_error_t
 gpgconf_read (void *engine, char *arg1, char *arg2,
 	      gpgme_error_t (*cb) (void *hook, char *line),
@@ -199,9 +203,9 @@ gpgconf_read (void *engine, char *arg1, char *arg2,
 {
   struct engine_gpgconf *gpgconf = engine;
   gpgme_error_t err = 0;
-#define LINELENGTH 1024
-  char linebuf[LINELENGTH] = "";
-  int linelen = 0;
+  char *linebuf;
+  size_t linebufsize;
+  int linelen;
   char *argv[4] = { NULL /* file_name */, NULL, NULL, NULL };
   int rp[2];
   struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */, -1, 0},
@@ -232,51 +236,80 @@ gpgconf_read (void *engine, char *arg1, char *arg2,
       return gpg_error_from_syserror ();
     }
 
-  do
+  linebufsize = 1024; /* Usually enough for conf lines.  */
+  linebuf = malloc (linebufsize);
+  if (!linebuf)
     {
-      nread = _gpgme_io_read (rp[0],
-                              linebuf + linelen, LINELENGTH - linelen - 1);
-      if (nread > 0)
-	{
-          char *line;
-          const char *lastmark = NULL;
-          size_t nused;
-
-	  linelen += nread;
-	  linebuf[linelen] = '\0';
+      err = gpg_error_from_syserror ();
+      goto leave;
+    }
+  linelen = 0;
 
-	  for (line=linebuf; (mark = strchr (line, '\n')); line = mark+1 )
-	    {
-              lastmark = mark;
-	      if (mark > line && mark[-1] == '\r')
-		mark[-1] = '\0';
-              else
-                mark[0] = '\0';
-
-	      /* Got a full line.  Due to the CR removal code (which
-                 occurs only on Windows) we might be one-off and thus
-                 would see empty lines.  Don't pass them to the
-                 callback. */
-	      err = *line? (*cb) (hook, line) : 0;
-	      if (err)
-		goto leave;
-	    }
+  while ((nread = _gpgme_io_read (rp[0], linebuf + linelen,
+                                  linebufsize - linelen - 1)))
+    {
+      char *line;
+      const char *lastmark = NULL;
+      size_t nused;
+
+      if (nread < 0)
+        {
+          err = gpg_error_from_syserror ();
+          goto leave;
+        }
+
+      linelen += nread;
+      linebuf[linelen] = '\0';
+
+      for (line=linebuf; (mark = strchr (line, '\n')); line = mark+1 )
+        {
+          lastmark = mark;
+          if (mark > line && mark[-1] == '\r')
+            mark[-1] = '\0';
+          else
+            mark[0] = '\0';
+
+          /* Got a full line.  Due to the CR removal code (which
+             occurs only on Windows) we might be one-off and thus
+             would see empty lines.  Don't pass them to the
+             callback. */
+          err = *line? (*cb) (hook, line) : 0;
+          if (err)
+            goto leave;
+        }
+
+      nused = lastmark? (lastmark + 1 - linebuf) : 0;
+      memmove (linebuf, linebuf + nused, linelen - nused);
+      linelen -= nused;
+
+      if (!(linelen < linebufsize - 1))
+        {
+          char *newlinebuf;
+
+          if (linelen <  8 * 1024 - 1)
+            linebufsize = 8 * 1024;
+          else if (linelen < 64 * 1024 - 1)
+            linebufsize = 64 * 1024;
+          else
+            {
+              /* We reached our limit - give up.  */
+              err = gpg_error (GPG_ERR_LINE_TOO_LONG);
+              goto leave;
+            }
 
-          nused = lastmark? (lastmark + 1 - linebuf) : 0;
-          memmove (linebuf, linebuf + nused, linelen - nused);
-          linelen -= nused;
-	}
+          newlinebuf = realloc (linebuf, linebufsize);
+          if (!newlinebuf)
+            {
+              err = gpg_error_from_syserror ();
+              goto leave;
+            }
+          linebuf = newlinebuf;
+        }
     }
-  while (nread > 0 && linelen < LINELENGTH - 1);
-
-  if (!err && nread < 0)
-    err = gpg_error_from_syserror ();
-  if (!err && nread > 0)
-    err = gpg_error (GPG_ERR_LINE_TOO_LONG);
 
  leave:
+  free (linebuf);
   _gpgme_io_close (rp[0]);
-
   return err;
 }
 

commit 0ff0aa3fc8440420247fe4cff30c3ac9be1b2f7d
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Apr 30 18:05:04 2013 +0200

    Syntax fix for gpgme.texi.
    
    --
    
    This fixes commit 12374cbecede047accd2d2267bba5927037ed16c.

diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 8eeaafc..b47d438 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -5816,7 +5816,7 @@ if this is not possible, by calling the function
 @code{gpgme_set_global_flag}.  The value is the trace level and
 an optional file name.
 
- at noindenr
+ at noindent
 For example
 @smallexample
 GPGME_DEBUG=9:/home/user/mygpgme.log

commit 867b950b9306904a0ff522d0ef4a43789393cfc4
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Apr 29 09:58:57 2013 +0200

    Fix for i686-w64-mingw32.
    
    * configure.ac (NEED__FILE_OFFSET_BITS): Do not define under Windows.

diff --git a/configure.ac b/configure.ac
index f096aa9..d7ce215 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,12 +270,14 @@ AC_TYPE_UINTPTR_T
 # A simple compile time check in gpgme.h for GNU/Linux systems that
 # prevents a file offset bits mismatch between gpgme and the application.
 NEED__FILE_OFFSET_BITS=0
-case "$ac_cv_sys_file_offset_bits" in
-  "" | no | unknown) ;;
-  *)
-  NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
-  ;;
-esac
+if test "$have_w32_system" != yes; then
+  case "$ac_cv_sys_file_offset_bits" in
+    "" | no | unknown) ;;
+    *)
+    NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
+    ;;
+  esac
+fi
 AC_SUBST(NEED__FILE_OFFSET_BITS)
 
 # Figure out platform dependent typedefs for gpgme.h

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

Summary of changes:
 NEWS                 |   13 +++++-
 configure.ac         |   31 +++++++++----
 doc/gpgme.texi       |    2 +-
 src/engine-gpgconf.c |  121 ++++++++++++++++++++++++++++++++------------------
 4 files changed, 112 insertions(+), 55 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list