[git] Assuan - branch, master, updated. libassuan-2.3.0-8-gc2fca26

by Werner Koch cvs at cvs.gnupg.org
Tue Nov 3 15:52:57 CET 2015


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 "IPC library used by GnuPG".

The branch, master has been updated
       via  c2fca26e2d9fb9ba7a9d87300e735a53e2615a7a (commit)
       via  0beb1784e7b72e31ecec441ee0a8ba4cef63d853 (commit)
       via  6034cc02e38cb947800f904f678c4ef5ff9c2050 (commit)
       via  7279c3ce9283723bd7f670051cd8a2087f62cd7f (commit)
      from  dda9c84bc67326a6d2bef1e5c45b5de8b67eeb40 (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 c2fca26e2d9fb9ba7a9d87300e735a53e2615a7a
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Nov 3 15:49:17 2015 +0100

    Post release updates.
    
    --

diff --git a/NEWS b/NEWS
index 1c2ab56..63b6e64 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Noteworthy changes in version 2.4.1 (unreleased) [C7/A7/R_]
+------------------------------------------------
+
+
 Noteworthy changes in version 2.4.0 (2015-11-03) [C7/A7/R0]
 ------------------------------------------------
 
diff --git a/configure.ac b/configure.ac
index a4e7ee7..313dafc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ min_automake_version="1.14"
 m4_define([mym4_package],[libassuan])
 m4_define([mym4_major], [2])
 m4_define([mym4_minor], [4])
-m4_define([mym4_micro], [0])
+m4_define([mym4_micro], [1])
 
 # To start a new development series, i.e a new major or minor number
 # you need to mark an arbitrary commit before the first beta release

commit 0beb1784e7b72e31ecec441ee0a8ba4cef63d853
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Nov 3 15:42:10 2015 +0100

    Release 2.4.0
    
    * configure.ac: Bump LT version to C7/A7/Ro.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/NEWS b/NEWS
index 35a5725..1c2ab56 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,11 @@
-Noteworthy changes in version 2.4.0 (unreleased) [C6/A6/R_]
+Noteworthy changes in version 2.4.0 (2015-11-03) [C7/A7/R0]
 ------------------------------------------------
 
  * New flags "socks" and "tor-mode" for assuan_sock_{set,get}_flag.
 
  * New function assuan_sock_connect_byname.
 
- * Requires at least libgpg-error 1.17.
+ * Require at least libgpg-error 1.17.
 
  * Interface changes relative to the 2.3.0 release:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/configure.ac b/configure.ac
index c18c2d3..a4e7ee7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,8 +31,8 @@ min_automake_version="1.14"
 # for the LT versions.
 m4_define([mym4_package],[libassuan])
 m4_define([mym4_major], [2])
-m4_define([mym4_minor], [3])
-m4_define([mym4_micro], [1])
+m4_define([mym4_minor], [4])
+m4_define([mym4_micro], [0])
 
 # To start a new development series, i.e a new major or minor number
 # you need to mark an arbitrary commit before the first beta release
@@ -59,8 +59,8 @@ AC_INIT([mym4_package],[mym4_version], [http://bugs.gnupg.org])
 #   (Interfaces added:			AGE++)
 #   (Interfaces removed/changed:	AGE=0)
 #
-LIBASSUAN_LT_CURRENT=6
-LIBASSUAN_LT_AGE=6
+LIBASSUAN_LT_CURRENT=7
+LIBASSUAN_LT_AGE=7
 LIBASSUAN_LT_REVISION=0
 
 # If the API is changed in an incompatible way: increment the next counter.

commit 6034cc02e38cb947800f904f678c4ef5ff9c2050
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Nov 3 15:39:08 2015 +0100

    w32: Use assuan_fd_t with the new socket functions.
    
    * src/assuan-socket.c (socks5_connect): Use assuan_fd_t instead of
    int.
    (_assuan_sock_connect): Ditto.
    (_assuan_sock_connect_byname): Ditto.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/assuan-socket.c b/src/assuan-socket.c
index 12e9e38..89723b3 100644
--- a/src/assuan-socket.c
+++ b/src/assuan-socket.c
@@ -659,7 +659,8 @@ do_writen (assuan_context_t ctx, assuan_fd_t sockfd,
 
 /* Connect using the SOCKS5 protocol. */
 static int
-socks5_connect (assuan_context_t ctx, int sock, unsigned short socksport,
+socks5_connect (assuan_context_t ctx, assuan_fd_t sock,
+                unsigned short socksport,
                 const char *credentials,
                 const char *hostname, unsigned short hostport,
                 struct sockaddr *addr, socklen_t length)
@@ -704,7 +705,7 @@ socks5_connect (assuan_context_t ctx, int sock, unsigned short socksport,
   proxyaddr_in.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
   proxyaddr = (struct sockaddr *)&proxyaddr_in;
   proxyaddrlen = sizeof proxyaddr_in;
-  ret = _assuan_connect (ctx, sock, proxyaddr, proxyaddrlen);
+  ret = _assuan_connect (ctx, HANDLE2SOCKET (sock), proxyaddr, proxyaddrlen);
   if (ret)
     return ret;
   buffer[0] = 5; /* RFC-1928 VER field.  */
@@ -968,7 +969,7 @@ _assuan_sock_connect (assuan_context_t ctx, assuan_fd_t sockfd,
     }
   else if (use_socks (addr))
     {
-      return socks5_connect (ctx, HANDLE2SOCKET (sockfd), tor_mode,
+      return socks5_connect (ctx, sockfd, tor_mode,
                              NULL, NULL, 0, addr, addrlen);
     }
   else
@@ -1034,7 +1035,7 @@ _assuan_sock_connect_byname (assuan_context_t ctx, const char *host,
                              unsigned short port, int reserved,
                              const char *credentials, unsigned int flags)
 {
-  int fd;
+  assuan_fd_t fd;
   unsigned short socksport;
 
   if ((flags & ASSUAN_SOCK_TOR))
@@ -1057,7 +1058,7 @@ _assuan_sock_connect_byname (assuan_context_t ctx, const char *host,
       int save_errno = errno;
       assuan_sock_close (fd);
       gpg_err_set_errno (save_errno);
-      return -1;
+      return ASSUAN_INVALID_FD;
     }
 
   return fd;

commit 7279c3ce9283723bd7f670051cd8a2087f62cd7f
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Nov 3 15:26:29 2015 +0100

    Use asprintf function from libgpg-error.
    
    * configure.ac: Require libgpg-error 1.17.
    (vasprintf): Remove ac_replace.
    * src/assuan-defs.h [!HAVE_VASPRINTF]: Remove replace wrapper.
    * src/assuan-logging.c (_assuan_log_control_channel):
    (_assuan_log_control_channel): s/asprintf/gpgrt_asprintf/.
    * src/debug.c (_assuan_debug): s/vasprintf/gpgrt_vasprintf/.
    (_assuan_debug_begin): Ditto.
    (_assuan_debug_add): Ditto. s/asprintf/gpgrt_asprintf/.
    --
    
    We plan to move more code into libgpg-error/gpgrt anyway thus this is
    a good start which also fixes this bug:
    
    GnuPG-bug-id: 1477
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/NEWS b/NEWS
index 01fa3b6..35a5725 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Noteworthy changes in version 2.4.0 (unreleased) [C6/A6/R_]
 
  * New function assuan_sock_connect_byname.
 
+ * Requires at least libgpg-error 1.17.
+
  * Interface changes relative to the 2.3.0 release:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  assuan_sock_connect_byname    NEW.
diff --git a/configure.ac b/configure.ac
index 8e8768f..c18c2d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -355,7 +355,7 @@ AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
 
 
 # Checking for libgpg-error.
-AM_PATH_GPG_ERROR(1.8,, AC_MSG_ERROR([libgpg-error was not found]))
+AM_PATH_GPG_ERROR(1.17,, AC_MSG_ERROR([libgpg-error was not found]))
 
 #
 # Checks for library functions.
@@ -396,7 +396,6 @@ AC_REPLACE_FUNCS(memrchr)
 AC_REPLACE_FUNCS(stpcpy)
 AC_CHECK_HEADERS(unistd.h)
 AC_REPLACE_FUNCS(setenv)
-AC_REPLACE_FUNCS(vasprintf)
 
 
 #
diff --git a/doc/assuan.texi b/doc/assuan.texi
index 8445eb4..131ffc1 100644
--- a/doc/assuan.texi
+++ b/doc/assuan.texi
@@ -603,10 +603,14 @@ this will retrieve the underlying system handle with
 @node Initializing the library
 @section Initializing the library
 
-In general the library requires no initialization.  There are however
-some initialization hooks provided which are often useful.  These
-should be called as early as possible and in a multi-threaded
-application before a second thread is created.
+Libassuan makes use of Libgpg-error and assumes that Libgpg-error has
+been initialized.  In general @code{gpgrt_check_version} should be
+called to guarantee this; the Libgpg-error manual for details.
+
+Libassuan itself requires no initialization. There are however some
+initialization hooks provided which are often useful.  These should be
+called as early as possible and in a multi-threaded application before
+a second thread is created.
 
 These functions initialize default values that are used at context
 creation with @code{assuan_new}.  As there can only be one default,
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index cf0015e..97b053d 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -394,12 +394,6 @@ int setenv (const char *name, const char *value, int replace);
 #ifndef HAVE_PUTC_UNLOCKED
 int putc_unlocked (int c, FILE *stream);
 #endif
-#ifndef HAVE_VASPRINTF
-int _assuan_vasprintf (char **result, const char *format, va_list args);
-int _assuan_asprintf (char **buf, const char *fmt, ...);
-#define vasprintf _assuan_vasprintf
-#define asprintf  _assuan_asprintf
-#endif
 
 
 #define DIM(v)		     (sizeof(v)/sizeof((v)[0]))
diff --git a/src/assuan-logging.c b/src/assuan-logging.c
index d74e5d2..ca87488 100644
--- a/src/assuan-logging.c
+++ b/src/assuan-logging.c
@@ -28,7 +28,7 @@
 #ifdef HAVE_W32_SYSTEM
 # ifdef HAVE_WINSOCK2_H
 #  include <winsock2.h>
-# endif 
+# endif
 # include <windows.h>
 #endif /*HAVE_W32_SYSTEM*/
 #include <errno.h>
@@ -147,7 +147,7 @@ _assuan_log_handler (assuan_context_t ctx, void *hook, unsigned int cat,
   fprintf (fp, "%s", msg);
   /* If the log stream is a file, the output would be buffered.  This
      is bad for debugging, thus we flush the stream if FORMAT ends
-     with a LF.  */ 
+     with a LF.  */
   if (msg && *msg && msg[strlen (msg) - 1] == '\n')
     fflush (fp);
   gpg_err_set_errno (saved_errno);
@@ -174,7 +174,7 @@ _assuan_log_control_channel (assuan_context_t ctx, int outbound,
   /* Check whether logging is enabled and do a quick check to see
      whether the callback supports our category.  */
   if (!ctx
-      || !ctx->log_cb 
+      || !ctx->log_cb
       || ctx->flags.no_logging
       || !(*ctx->log_cb) (ctx, ctx->log_cb_data, ASSUAN_LOG_CONTROL, NULL))
     return;
@@ -204,8 +204,8 @@ _assuan_log_control_channel (assuan_context_t ctx, int outbound,
   if (string)
     {
       /* Print the diagnostic.  */
-      res = asprintf (&outbuf, "chan_" CHANNEL_FMT " %s [%s]\n",
-                      ctx->inbound.fd, outbound? "->":"<-", string);
+      res = gpgrt_asprintf (&outbuf, "chan_" CHANNEL_FMT " %s [%s]\n",
+                            ctx->inbound.fd, outbound? "->":"<-", string);
     }
   else if (buffer1)
     {
@@ -231,7 +231,7 @@ _assuan_log_control_channel (assuan_context_t ctx, int outbound,
         {
           /* No control characters and not starting with our error
              message indicator.  Log it verbatim.  */
-          res = asprintf (&outbuf, "chan_" CHANNEL_FMT " %s %.*s%.*s\n",
+          res = gpgrt_asprintf (&outbuf, "chan_" CHANNEL_FMT " %s %.*s%.*s\n",
                           ctx->inbound.fd, outbound? "->":"<-",
                           (int)length1, (const char*)buffer1,
                           (int)length2, buffer2? (const char*)buffer2:"");
@@ -246,7 +246,7 @@ _assuan_log_control_channel (assuan_context_t ctx, int outbound,
           char *hp;
           unsigned int nbytes;
           unsigned int maxbytes = full_logging? (2*LINELENGTH) : 16;
-            
+
           nbytes = length1 + length2;
           if (nbytes > maxbytes)
             nbytes = maxbytes;
diff --git a/src/debug.c b/src/debug.c
index d6c3e80..9ef6237 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -60,7 +60,7 @@ _assuan_debug (assuan_context_t ctx, unsigned int cat, const char *format, ...)
 
   saved_errno = errno;
   va_start (arg_ptr, format);
-  res = vasprintf (&msg, format, arg_ptr);
+  res = gpgrt_vasprintf (&msg, format, arg_ptr);
   va_end (arg_ptr);
   if (res < 0)
     return;
@@ -87,7 +87,7 @@ _assuan_debug_begin (assuan_context_t ctx,
     return;
 
   va_start (arg_ptr, format);
-  res = vasprintf ((char **) line, format, arg_ptr);
+  res = gpgrt_vasprintf ((char **) line, format, arg_ptr);
   va_end (arg_ptr);
   if (res < 0)
     *line = NULL;
@@ -107,14 +107,14 @@ _assuan_debug_add (assuan_context_t ctx, void **line, const char *format, ...)
     return;
 
   va_start (arg_ptr, format);
-  res = vasprintf (&toadd, format, arg_ptr);
+  res = gpgrt_vasprintf (&toadd, format, arg_ptr);
   va_end (arg_ptr);
   if (res < 0)
     {
       free (*line);
       *line = NULL;
     }
-  res = asprintf (&result, "%s%s", *(char **) line, toadd);
+  res = gpgrt_asprintf (&result, "%s%s", *(char **) line, toadd);
   free (toadd);
   free (*line);
   if (res < 0)
diff --git a/src/vasprintf.c b/src/vasprintf.c
deleted file mode 100644
index bacb71c..0000000
--- a/src/vasprintf.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* Like vsprintf but provides a pointer to malloc'd storage, which must
-   be freed by the caller.
-   Copyright (C) 1994, 2002 Free Software Foundation, Inc.
-
-This file is part of the libiberty library.
-Libiberty is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-Libiberty is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with libiberty; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-
-#ifndef va_copy /* According to POSIX, va_copy is a macro. */
-#if defined (__GNUC__) && defined (__PPC__) \
-     && (defined (_CALL_SYSV) || defined (_WIN32))
-#define va_copy(d, s) (*(d) = *(s))
-#elif defined (MUST_COPY_VA_BYVAL)
-#define va_copy(d, s) ((d) = (s))
-#else
-#define va_copy(d, s) memcpy ((d), (s), sizeof (va_list))
-#endif
-#endif
-
-
-#ifdef TEST
-int global_total_width;
-#endif
-
-static int int_vasprintf (char **, const char *, va_list *);
-
-static int
-int_vasprintf (result, format, args)
-     char **result;
-     const char *format;
-     va_list *args;
-{
-#if defined(HAVE_W32CE_SYSTEM) && defined(_MSC_VER)
-  /* No va_copy and the replacement above doesn't work.  */
-#define MAX_STRLEN 256
-  *result = malloc (MAX_STRLEN);
-  if (*result != NULL)
-    {
-      int res = _vsnprintf (*result, MAX_STRLEN, format, *args);
-      (*result)[MAX_STRLEN - 1] = '\0';
-      return res;
-    }
-  else
-    return 0;
-#else
-  const char *p = format;
-  /* Add one to make sure that it is never zero, which might cause malloc
-     to return NULL.  */
-  int total_width = strlen (format) + 1;
-  va_list ap;
-
-  va_copy (ap, *args);
-
-  while (*p != '\0')
-    {
-      if (*p++ == '%')
-	{
-	  while (strchr ("-+ #0", *p))
-	    ++p;
-	  if (*p == '*')
-	    {
-	      ++p;
-	      total_width += abs (va_arg (ap, int));
-	    }
-	  else
-	    total_width += strtoul (p, (char **) &p, 10);
-	  if (*p == '.')
-	    {
-	      ++p;
-	      if (*p == '*')
-		{
-		  ++p;
-		  total_width += abs (va_arg (ap, int));
-		}
-	      else
-	      total_width += strtoul (p, (char **) &p, 10);
-	    }
-	  while (strchr ("hlL", *p))
-	    ++p;
-	  /* Should be big enough for any format specifier except %s and floats.  */
-	  total_width += 30;
-	  switch (*p)
-	    {
-	    case 'd':
-	    case 'i':
-	    case 'o':
-	    case 'u':
-	    case 'x':
-	    case 'X':
-	    case 'c':
-	      (void) va_arg (ap, int);
-	      break;
-	    case 'f':
-	    case 'e':
-	    case 'E':
-	    case 'g':
-	    case 'G':
-	      (void) va_arg (ap, double);
-	      /* Since an ieee double can have an exponent of 307, we'll
-		 make the buffer wide enough to cover the gross case. */
-	      total_width += 307;
-	      break;
-	    case 's':
-              {
-                char *tmp = va_arg (ap, char *);
-                if (tmp)
-                  total_width += strlen (tmp);
-                else /* in case the vsprintf does prints a text */
-                  total_width += 25; /* e.g. "(null pointer reference)" */
-              }
-	      break;
-	    case 'p':
-	    case 'n':
-	      (void) va_arg (ap, char *);
-	      break;
-	    }
-	  p++;
-	}
-    }
-#ifdef TEST
-  global_total_width = total_width;
-#endif
-  *result = malloc (total_width);
-  if (*result != NULL)
-    return vsprintf (*result, format, *args);
-  else
-    return 0;
-#endif
-}
-
-
-/* We use the _assuan prefix to keep our name space clean. */
-int
-_assuan_vasprintf (char **result, const char *format, va_list args)
-{
-  return int_vasprintf (result, format, &args);
-}
-
-
-int
-_assuan_asprintf (char **buf, const char *fmt, ...)
-{
-  int status;
-  va_list ap;
-
-  va_start (ap, fmt);
-  status = _assuan_vasprintf (buf, fmt, ap);
-  va_end (ap);
-  return status;
-}
-
-
-#ifdef TEST
-
-#define asprintf  _assuan_asprintf
-#define vasprintf _assuan_vasprintf
-static int any_failed;
-
-void
-checkit (const char* format, ...)
-{
-  va_list args;
-  char *result;
-
-  va_start (args, format);
-  vasprintf (&result, format, args);
-  if (strlen (result) < global_total_width)
-    printf ("PASS: ");
-  else
-    {
-      any_failed = 1;
-      printf ("FAIL: ");
-    }
-  printf ("%d %s\n", global_total_width, result);
-}
-
-int
-main (void)
-{
-  checkit ("%d", 0x12345678);
-  checkit ("%200d", 5);
-  checkit ("%.300d", 6);
-  checkit ("%100.150d", 7);
-  checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
-777777777777777777333333333333366666666666622222222222777777777777733333");
-  checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx");
-  checkit ("%2$f%4$s%3$d%1$s", "asdjffffffffffffffiiiiiiiiiiixxxxx", 1.0, 77, "foo");
-  return any_failed;
-}
-#endif /* TEST */

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

Summary of changes:
 NEWS                 |   8 +-
 configure.ac         |   9 +--
 doc/assuan.texi      |  12 ++-
 src/assuan-defs.h    |   6 --
 src/assuan-logging.c |  14 ++--
 src/assuan-socket.c  |  11 +--
 src/debug.c          |   8 +-
 src/vasprintf.c      | 211 ---------------------------------------------------
 8 files changed, 36 insertions(+), 243 deletions(-)
 delete mode 100644 src/vasprintf.c


hooks/post-receive
-- 
IPC library used by GnuPG
http://git.gnupg.org




More information about the Gnupg-commits mailing list