[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-341-gfeda379

by Werner Koch cvs at cvs.gnupg.org
Mon Mar 10 10:57:29 CET 2014


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 "The GNU Privacy Guard".

The branch, master has been updated
       via  feda379595e06583bc5b3610dec74890de29cb8e (commit)
       via  4387ecb11cdb2addf738eb922c1b9f14c6c76efc (commit)
       via  35266076e3452590931e58f188815859dff6de3c (commit)
       via  72133b54de89e593d8193b106e9369cf90d2e1c0 (commit)
      from  36372dcb2f75a659b7ace0e9c46f07bb431d009c (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 feda379595e06583bc5b3610dec74890de29cb8e
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Mar 7 09:46:44 2014 +0100

    dirmmgr: Use a portability wrapper for struct timeval.
    
    * dirmngr/dirmngr_ldap.c [W32]: Include winber.h.
    (my_ldap_timeval_t): New.

diff --git a/dirmngr/dirmngr_ldap.c b/dirmngr/dirmngr_ldap.c
index 4e706d5..7d3bd17 100644
--- a/dirmngr/dirmngr_ldap.c
+++ b/dirmngr/dirmngr_ldap.c
@@ -37,14 +37,15 @@
 #endif
 
 #ifdef HAVE_W32_SYSTEM
-#include <winsock2.h>
-#include <winldap.h>
-#include <fcntl.h>
-#include "ldap-url.h"
+# include <winsock2.h>
+# include <winldap.h>
+# include <winber.h>
+# include <fcntl.h>
+# include "ldap-url.h"
 #else
-/* For OpenLDAP, to enable the API that we're using. */
-#define LDAP_DEPRECATED 1
-#include <ldap.h>
+  /* For OpenLDAP, to enable the API that we're using. */
+# define LDAP_DEPRECATED 1
+# include <ldap.h>
 #endif
 
 
@@ -97,6 +98,12 @@ static void npth_protect (void) { }
 # define my_ldap_free_attr(a)           ldap_memfree ((a))
 #endif
 
+#ifdef HAVE_W32_SYSTEM
+ typedef LDAP_TIMEVAL  my_ldap_timeval_t;
+#else
+ typedef struct timeval my_ldap_timeval_t;
+#endif
+
 #define DEFAULT_LDAP_TIMEOUT 100 /* Arbitrary long timeout. */
 
 
@@ -154,7 +161,7 @@ struct my_opt_s
 {
   int quiet;
   int verbose;
-  struct timeval timeout; /* Timeout for the LDAP search functions.  */
+  my_ldap_timeval_t timeout;/* Timeout for the LDAP search functions.  */
   unsigned int alarm_timeout; /* And for the alarm based timeout.  */
   int multi;
 

commit 4387ecb11cdb2addf738eb922c1b9f14c6c76efc
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Mar 7 09:46:44 2014 +0100

    Silence more warnings about unused vars and args.
    
    * dirmngr/cdblib.c (cdb_init) [W32]: Remove unused var.
    * dirmngr/dirmngr-client.c (start_dirmngr): s/int/assuan_fd_t/.
    * dirmngr/dirmngr.c (w32_service_control): Mark unused args.
    (call_real_main): New.
    (main) [W32]: Use new function to match prototype.
    (real_main) [W32]: Mark unused vars.
    (handle_signal) [W32]: Do not build the function at all.
    (handle_connections) [W32]: Do not define signo.
    * dirmngr/ldap-wrapper-ce.c (outstream_reader_cb): Remove used vars.
    * g10/tdbio.c (ftruncate) [DOSISH]: Define only if not yet defined.

diff --git a/dirmngr/cdblib.c b/dirmngr/cdblib.c
index 9ab4d3c..9636b6c 100644
--- a/dirmngr/cdblib.c
+++ b/dirmngr/cdblib.c
@@ -115,9 +115,10 @@ cdb_init(struct cdb *cdbp, int fd)
 {
   struct stat st;
   unsigned char *mem;
-  unsigned fsize;
 #ifdef _WIN32
   HANDLE hFile, hMapping;
+#else
+  unsigned int fsize;
 #endif
 
   /* get file size */
@@ -128,7 +129,6 @@ cdb_init(struct cdb *cdbp, int fd)
     gpg_err_set_errno (EPROTO);
     return -1;
   }
-  fsize = (unsigned)(st.st_size & 0xffffffffu);
   /* memory-map file */
 #ifdef _WIN32
 # ifdef __MINGW32CE__
@@ -145,11 +145,12 @@ cdb_init(struct cdb *cdbp, int fd)
   if (!mem)
     return -1;
   cdbp->cdb_mapping = hMapping;
-#else
+#else /*!_WIN32*/
+  fsize = (unsigned int)(st.st_size & 0xffffffffu);
   mem = (unsigned char*)mmap(NULL, fsize, PROT_READ, MAP_SHARED, fd, 0);
   if (mem == MAP_FAILED)
     return -1;
-#endif /* _WIN32 */
+#endif /*!_WIN32*/
 
   cdbp->cdb_fd = fd;
   cdbp->cdb_fsize = st.st_size;
diff --git a/dirmngr/dirmngr-client.c b/dirmngr/dirmngr-client.c
index 76f4710..da97443 100644
--- a/dirmngr/dirmngr-client.c
+++ b/dirmngr/dirmngr-client.c
@@ -459,7 +459,7 @@ start_dirmngr (int only_daemon)
     {
       const char *pgmname;
       const char *argv[3];
-      int no_close_list[3];
+      assuan_fd_t no_close_list[3];
       int i;
 
       if (only_daemon)
@@ -486,7 +486,7 @@ start_dirmngr (int only_daemon)
       if (log_get_fd () != -1)
         no_close_list[i++] = assuan_fd_from_posix_fd (log_get_fd ());
       no_close_list[i++] = assuan_fd_from_posix_fd (es_fileno (es_stderr));
-      no_close_list[i] = -1;
+      no_close_list[i] = ASSUAN_INVALID_FD;
 
       /* Connect to the agent and perform initial handshaking.  */
       rc = assuan_pipe_connect (ctx, opt.dirmngr_program, argv,
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 9f3e2ee..0cbdc7b 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -510,6 +510,10 @@ DWORD WINAPI
 w32_service_control (DWORD control, DWORD event_type, LPVOID event_data,
 		     LPVOID context)
 {
+  (void)event_type;
+  (void)event_data;
+  (void)context;
+
   /* event_type and event_data are not used here.  */
   switch (control)
     {
@@ -1016,6 +1020,9 @@ main (int argc, char **argv)
          existing scripts which might use this to detect a successful
          start of the dirmngr.  */
 #ifdef HAVE_W32_SYSTEM
+      (void)csh_style;
+      (void)nodetach;
+
       pid = getpid ();
       es_printf ("set %s=%s;%lu;1\n",
                  DIRMNGR_INFO_NAME, socket_name, (ulong) pid);
@@ -1275,6 +1282,12 @@ main (int argc, char **argv)
 
 
 #ifdef USE_W32_SERVICE
+static void WINAPI
+call_real_main (DWORD argc, LPSTR *argv)
+{
+  real_main (argc, argv);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -1295,8 +1308,7 @@ main (int argc, char *argv[])
     {
       SERVICE_TABLE_ENTRY DispatchTable [] =
 	{
-	  /* Ignore warning.  */
-	  { "DirMngr", &real_main },
+	  { "DirMngr", &call_real_main },
 	  { NULL, NULL }
 	};
 
@@ -1609,12 +1621,12 @@ dirmngr_sighup_action (void)
 
 
 /* The signal handler. */
+#ifndef HAVE_W32_SYSTEM
 static void
 handle_signal (int signo)
 {
   switch (signo)
     {
-#ifndef HAVE_W32_SYSTEM
     case SIGHUP:
       dirmngr_sighup_action ();
       break;
@@ -1649,11 +1661,12 @@ handle_signal (int signo)
       cleanup ();
       dirmngr_exit (0);
       break;
-#endif
+
     default:
       log_info (_("signal %d received - no action defined\n"), signo);
     }
 }
+#endif /*!HAVE_W32_SYSTEM*/
 
 
 /* This is the worker for the ticker.  It is called every few seconds
@@ -1739,7 +1752,9 @@ static void
 handle_connections (assuan_fd_t listen_fd)
 {
   npth_attr_t tattr;
+#ifndef HAVE_W32_SYSTEM
   int signo;
+#endif
   struct sockaddr_un paddr;
   socklen_t plen = sizeof( paddr );
   gnupg_fd_t fd;
diff --git a/dirmngr/ldap-wrapper-ce.c b/dirmngr/ldap-wrapper-ce.c
index 9af70af..ce63ea6 100644
--- a/dirmngr/ldap-wrapper-ce.c
+++ b/dirmngr/ldap-wrapper-ce.c
@@ -279,8 +279,6 @@ outstream_reader_cb (void *cb_value, char *buffer, size_t count,
                      size_t *r_nread)
 {
   struct outstream_cookie_s *cookie = cb_value;
-  char *dst;
-  const char *src;
   size_t nread = 0;
   int was_full = 0;
 
@@ -288,7 +286,6 @@ outstream_reader_cb (void *cb_value, char *buffer, size_t count,
     return gpg_error (GPG_ERR_NOT_SUPPORTED); /* Rewind is not supported.  */
 
   *r_nread = 0;
-  dst = buffer;
 
   while (BUFFER_EMPTY(cookie))
     {
@@ -302,7 +299,6 @@ outstream_reader_cb (void *cb_value, char *buffer, size_t count,
   if (BUFFER_FULL(cookie))
     was_full = 1;
 
-  src = cookie->buffer + cookie->buffer_pos;
   nread = buffer_get_data (cookie, buffer, count);
 
   if (was_full)
diff --git a/g10/tdbio.c b/g10/tdbio.c
index db7a67c..2b9d4ff 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -38,7 +38,7 @@
 #include "trustdb.h"
 #include "tdbio.h"
 
-#if defined(HAVE_DOSISH_SYSTEM)
+#if defined(HAVE_DOSISH_SYSTEM) && !defined(ftruncate)
 #define ftruncate chsize
 #endif
 

commit 35266076e3452590931e58f188815859dff6de3c
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Mar 7 09:46:44 2014 +0100

    dirmngr: Simplify strtok macro.
    
    * dirmngr/ldap-url.c (ldap_utf8_strtok): Remove unused r3d arg.
    (ldap_str2charray): Remove lasts.
    --
    
    I have no clue why an utf8 version was planned to be used.  Do the
    LDAP folks really assume that eventually non-ascii delimiters might be
    used?  Simplified it to silence the warning about an used helper var.

diff --git a/dirmngr/ldap-url.c b/dirmngr/ldap-url.c
index e5a7d94..8308514 100644
--- a/dirmngr/ldap-url.c
+++ b/dirmngr/ldap-url.c
@@ -91,7 +91,7 @@ software is provided `'as is'' without express or implied warranty.  */
 #define LDAP_MALLOC		malloc
 #define LDAP_REALLOC		realloc
 #define ldap_utf8_strchr	strchr
-#define ldap_utf8_strtok(n,d,s) strtok (n,d)
+#define ldap_utf8_strtok(n,d)   strtok (n,d)
 #define Debug(a,b,c,d,e)
 void ldap_pvt_hex_unescape( char *s );
 
@@ -267,7 +267,6 @@ ldap_str2charray( const char *str_in, const char *brkstr )
 {
 	char	**res;
 	char	*str, *s;
-	char	*lasts;
 	int	i;
 
 	/* protect the input string from strtok */
@@ -292,9 +291,9 @@ ldap_str2charray( const char *str_in, const char *brkstr )
 
 	i = 0;
 
-	for ( s = ldap_utf8_strtok( str, brkstr, &lasts );
+	for ( s = ldap_utf8_strtok( str, brkstr);
 		s != NULL;
-		s = ldap_utf8_strtok( NULL, brkstr, &lasts ) )
+		s = ldap_utf8_strtok( NULL, brkstr) )
 	{
 		res[i] = LDAP_STRDUP( s );
 

commit 72133b54de89e593d8193b106e9369cf90d2e1c0
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Mar 7 09:46:44 2014 +0100

    Use attribute __gnu_printf__ also in estream header files.
    
    * common/estream-printf.h: Use attribute gnu_printf.
    * common/estream.h: Ditto.

diff --git a/common/estream-printf.h b/common/estream-printf.h
index 138ed37..3c2253d 100644
--- a/common/estream-printf.h
+++ b/common/estream-printf.h
@@ -99,11 +99,15 @@
 #endif /*_ESTREAM_EXT_SYM_PREFIX*/
 
 #ifndef _ESTREAM_GCC_A_PRINTF
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
-# define _ESTREAM_GCC_A_PRINTF( f, a )  __attribute__ ((format (printf,f,a)))
-#else
-# define _ESTREAM_GCC_A_PRINTF( f, a )
-#endif
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 )
+#  define _ESTREAM_GCC_A_PRINTF( f, a ) \
+                               __attribute__ ((format (__gnu_printf__,f,a)))
+# elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
+#  define _ESTREAM_GCC_A_PRINTF( f, a ) \
+                               __attribute__ ((format (printf,f,a)))
+# else
+#  define _ESTREAM_GCC_A_PRINTF( f, a )
+# endif
 #endif /*_ESTREAM_GCC_A_PRINTF*/
 
 
diff --git a/common/estream.h b/common/estream.h
index e3c28fe..e3e9fc8 100644
--- a/common/estream.h
+++ b/common/estream.h
@@ -241,11 +241,15 @@ typedef struct
 
 

 #ifndef _ESTREAM_GCC_A_PRINTF
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
-# define _ESTREAM_GCC_A_PRINTF( f, a )  __attribute__ ((format (printf,f,a)))
-#else
-# define _ESTREAM_GCC_A_PRINTF( f, a )
-#endif
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 )
+#  define _ESTREAM_GCC_A_PRINTF( f, a ) \
+                               __attribute__ ((format (__gnu_printf__,f,a)))
+# elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
+#  define _ESTREAM_GCC_A_PRINTF( f, a ) \
+                               __attribute__ ((format (printf,f,a)))
+# else
+#  define _ESTREAM_GCC_A_PRINTF( f, a )
+# endif
 #endif /*_ESTREAM_GCC_A_PRINTF*/
 
 

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

Summary of changes:
 common/estream-printf.h   |   14 +++++++++-----
 common/estream.h          |   14 +++++++++-----
 dirmngr/cdblib.c          |    9 +++++----
 dirmngr/dirmngr-client.c  |    4 ++--
 dirmngr/dirmngr.c         |   23 +++++++++++++++++++----
 dirmngr/dirmngr_ldap.c    |   23 +++++++++++++++--------
 dirmngr/ldap-url.c        |    7 +++----
 dirmngr/ldap-wrapper-ce.c |    4 ----
 g10/tdbio.c               |    2 +-
 9 files changed, 63 insertions(+), 37 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list