[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-45-g115a6ed

by Werner Koch cvs at cvs.gnupg.org
Mon Feb 6 22:04:42 CET 2012


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  115a6ed55d1f6be33f66de6734359fa590ca3749 (commit)
       via  7981cdd1345d51fd917b2375691ead60c24db2cd (commit)
       via  1a0df8506050448f16c63666850e3ae6d94a971b (commit)
       via  eb0faef81dae2cba1f62056fdc4dc2a7d58ac86a (commit)
      from  ecda65498ac60dfde50fbbc71cd0cc321d7175a9 (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 115a6ed55d1f6be33f66de6734359fa590ca3749
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Feb 6 21:06:16 2012 +0100

    Add replacement hack for Android's broken ttyname.
    
    * configure.ac (HAVE_TTYNAME) [__ANDROID__]: Add hack.

diff --git a/configure.ac b/configure.ac
index f008d23..47c6d12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -490,6 +490,13 @@ AH_BOTTOM([
 # endif
 #endif
 
+/* Hacks required for Android.  */
+#ifdef __ANDROID__
+  /* ttyname is a stub in BIONIC, printing a FIXME warning.  */
+# define ttyname broken_native_ttyname
+# undef HAVE_TTYNAME
+#endif /*__ANDROID__*/
+
 
 /* Tell libgcrypt not to use its own libgpg-error implementation. */
 #define USE_LIBGPG_ERROR 1

commit 7981cdd1345d51fd917b2375691ead60c24db2cd
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Feb 6 21:04:22 2012 +0100

    agent: Simplify printing of INQUIRE_MAXLEN.
    
    * agent/command.c: Include asshelp.h.
    (cmd_pkdecrypt, cmd_genkey, cmd_preset_passphrase)
    (pinentry_loopback): Use print_assuan_status for INQUIRE_MAXLEN.

diff --git a/agent/command.c b/agent/command.c
index c673662..a369c4f 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -39,6 +39,7 @@
 #include "i18n.h"
 #include "cvt-openpgp.h"
 #include "../common/ssh-utils.h"
+#include "../common/asshelp.h"
 
 
 /* Maximum allowed size of the inquired ciphertext.  */
@@ -855,13 +856,11 @@ cmd_pkdecrypt (assuan_context_t ctx, char *line)
   unsigned char *value;
   size_t valuelen;
   membuf_t outbuf;
-  char buf[50];
 
   (void)line;
 
   /* First inquire the data to decrypt */
-  snprintf (buf, sizeof (buf), "%u", MAXLEN_CIPHERTEXT);
-  rc = assuan_write_status (ctx, "INQUIRE_MAXLEN", buf);
+  rc = print_assuan_status (ctx, "INQUIRE_MAXLEN", "%u", MAXLEN_CIPHERTEXT);
   if (!rc)
     rc = assuan_inquire (ctx, "CIPHERTEXT",
 			&value, &valuelen, MAXLEN_CIPHERTEXT);
@@ -912,7 +911,6 @@ cmd_genkey (assuan_context_t ctx, char *line)
   char *cache_nonce = NULL;
   int opt_preset;
   char *p;
-  char buf[50];
 
   opt_preset = has_option (line, "--preset");
   no_protection = has_option (line, "--no-protection");
@@ -926,8 +924,7 @@ cmd_genkey (assuan_context_t ctx, char *line)
     cache_nonce = xtrystrdup (line);
 
   /* First inquire the parameters */
-  snprintf (buf, sizeof (buf), "%u", MAXLEN_KEYPARAM);
-  rc = assuan_write_status (ctx, "INQUIRE_MAXLEN", buf);
+  rc = print_assuan_status (ctx, "INQUIRE_MAXLEN", "%u", MAXLEN_KEYPARAM);
   if (!rc)
     rc = assuan_inquire (ctx, "KEYPARAM", &value, &valuelen, MAXLEN_KEYPARAM);
   if (rc)
@@ -1704,11 +1701,9 @@ cmd_preset_passphrase (assuan_context_t ctx, char *line)
     {
       /* Note that the passphrase will be truncated at any null byte and the
        * limit is 480 characters. */
-      char buf[50];
       size_t maxlen = 480;
 
-      snprintf (buf, sizeof (buf), "%u", maxlen);
-      rc = assuan_write_status (ctx, "INQUIRE_MAXLEN", buf);
+      rc = print_assuan_status (ctx, "INQUIRE_MAXLEN", "%u", maxlen);
       if (!rc)
 	rc = assuan_inquire (ctx, "PASSPHRASE", &passphrase, &len, maxlen);
     }
@@ -2805,10 +2800,8 @@ pinentry_loopback(ctrl_t ctrl, const char *keyword,
 {
   gpg_error_t rc;
   assuan_context_t ctx = ctrl->server_local->assuan_ctx;
-  char buf[50];
 
-  snprintf (buf, sizeof (buf), "%u", max_length);
-  rc = assuan_write_status (ctx, "INQUIRE_MAXLEN", buf);
+  rc = print_assuan_status (ctx, "INQUIRE_MAXLEN", "%u", max_length);
   if (rc)
     return rc;
 

commit 1a0df8506050448f16c63666850e3ae6d94a971b
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Feb 6 20:52:27 2012 +0100

    common: Add function print_assuan_status.
    
    * common/asshelp2.c: New.
    (print_assuan_status): New function.
    * common/Makefile.am (common_sources): Add asshelp2.c.

diff --git a/common/Makefile.am b/common/Makefile.am
index 2ff4ade..b9cba11 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -79,7 +79,7 @@ common_sources = \
 	membuf.c membuf.h \
 	iobuf.c iobuf.h \
 	ttyio.c ttyio.h \
-	asshelp.c asshelp.h \
+	asshelp.c asshelp2.c asshelp.h \
 	exechelp.h \
 	signal.c \
 	audit.c audit.h \
diff --git a/common/asshelp.h b/common/asshelp.h
index 728c039..68be289 100644
--- a/common/asshelp.h
+++ b/common/asshelp.h
@@ -25,6 +25,8 @@
 
 #include "session-env.h"
 
+/*-- asshelp.c --*/
+
 void setup_libassuan_logging (unsigned int *debug_var_address);
 void set_libassuan_log_cats (unsigned int newcats);
 
@@ -62,5 +64,14 @@ start_new_dirmngr (assuan_context_t *r_ctx,
                    ctrl_t status_cb_arg);
 
 
+/*-- asshelp2.c --*/
+
+/* Helper function to print an assuan status line using a printf
+   format string.  */
+gpg_error_t print_assuan_status (assuan_context_t ctx,
+                                 const char *keyword,
+                                 const char *format,
+                                 ...) JNLIB_GCC_A_PRINTF(3,4);
+
 
 #endif /*GNUPG_COMMON_ASSHELP_H*/
diff --git a/common/asshelp2.c b/common/asshelp2.c
new file mode 100644
index 0000000..762a14d
--- /dev/null
+++ b/common/asshelp2.c
@@ -0,0 +1,49 @@
+/* asshelp2.c - More helper functions for Assuan
+ * Copyright (C) 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GnuPG.
+ *
+ * GnuPG is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GnuPG 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <assuan.h>
+
+#include "util.h"
+#include "asshelp.h"
+
+/* Helper function to print an assuan status line using a printf
+   format string.  */
+gpg_error_t
+print_assuan_status (assuan_context_t ctx,
+                     const char *keyword,
+                     const char *format, ...)
+{
+  va_list arg_ptr;
+  int rc;
+  char *buf;
+
+  va_start (arg_ptr, format);
+  rc = estream_vasprintf (&buf, format, arg_ptr);
+  va_end (arg_ptr);
+  if (rc < 0)
+    return gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
+  rc = assuan_write_status (ctx, keyword, buf);
+  xfree (buf);
+  return rc;
+}

commit eb0faef81dae2cba1f62056fdc4dc2a7d58ac86a
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Feb 6 20:50:47 2012 +0100

    common: Add a global variable to for the default error source.
    
    For the shared code parts it is cumbersome to pass an error sourse
    variable to each function.  Its value is always a constant for a given
    binary and thus a global variable makes things a lot easier than the
    former macro stuff.
    * common/init.c (default_errsource): New global var.
    (init_common_subsystems): Rename to _init_common_subsystems.  Set
    DEFAULT_ERRSOURCE.
    * common/init.h: Assert value of GPG_ERR_SOURCE_DEFAULT.
    (init_common_subsystems): New macro.
    * common/util.h (default_errsource): Add declaration.
    * kbx/keybox-defs.h: Add some GPG_ERR_SOURCE_DEFAULT trickery.

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index bc5a6cd..3a86867 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -52,6 +52,8 @@
 #include "exechelp.h"
 #include "asshelp.h"
 #include "../include/cipher.h"	/* for PUBKEY_ALGO_ECDSA, PUBKEY_ALGO_ECDH */
+#include "../common/init.h"
+
 
 enum cmd_and_opt_values
 { aNull = 0,
diff --git a/agent/preset-passphrase.c b/agent/preset-passphrase.c
index f303d5b..3f79336 100644
--- a/agent/preset-passphrase.c
+++ b/agent/preset-passphrase.c
@@ -46,6 +46,7 @@
 #include "simple-pwquery.h"
 #include "i18n.h"
 #include "sysutils.h"
+#include "../common/init.h"
 
 
 enum cmd_and_opt_values
diff --git a/agent/protect-tool.c b/agent/protect-tool.c
index a253143..57842a0 100644
--- a/agent/protect-tool.c
+++ b/agent/protect-tool.c
@@ -43,6 +43,7 @@
 #include "i18n.h"
 #include "get-passphrase.h"
 #include "sysutils.h"
+#include "../common/init.h"
 
 
 enum cmd_and_opt_values
diff --git a/common/init.c b/common/init.c
index f551416..475eaef 100644
--- a/common/init.c
+++ b/common/init.c
@@ -37,6 +37,12 @@
 #include "util.h"
 
 
+/* The default error source of the application.  This is different
+   from GPG_ERR_SOURCE_DEFAULT in that it does not depend on the
+   source file and thus is usable in code shared by applications.  */
+gpg_err_source_t default_errsource;
+
+
 #ifdef HAVE_W32CE_SYSTEM
 static void parse_std_file_handles (int *argcp, char ***argvp);
 static void
@@ -74,10 +80,16 @@ writestring_via_estream (int mode, const char *string)
    required for logging is ready.  ARGCP and ARGVP are the addresses
    of the parameters given to main.  This function may modify them.
 
+   This function should be called only via the macro
+   init_common_subsystems.
+
    CAUTION: This might be called while running suid(root).  */
 void
-init_common_subsystems (int *argcp, char ***argvp)
+_init_common_subsystems (gpg_err_source_t errsource, int *argcp, char ***argvp)
 {
+  /* Store the error source in a gloabl variable. */
+  default_errsource = errsource;
+
   /* Try to auto set the character set.  */
   set_native_charset (NULL);
 
diff --git a/common/init.h b/common/init.h
index e8fe499..b13c060 100644
--- a/common/init.h
+++ b/common/init.h
@@ -1,5 +1,5 @@
 /* init.h - Definitions for init fucntions.
- *	Copyright (C) 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2007, 2012 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -20,7 +20,15 @@
 #ifndef GNUPG_COMMON_INIT_H
 #define GNUPG_COMMON_INIT_H
 
-void init_common_subsystems (int *argcp, char ***argvp);
+#ifndef GPG_ERR_SOURCE_DEFAULT
+# error GPG_ERR_SOURCE_DEFAULT is not defined
+#elseif GPG_ERR_SOURCE_DEFAULT == GPG_ERR_SOURCE_UNKNOWN
+# error GPG_ERR_SOURCE_DEFAULT has default value
+#endif
 
+void _init_common_subsystems (gpg_err_source_t errsource,
+                              int *argcp, char ***argvp);
+#define init_common_subsystems(a,b)                             \
+  _init_common_subsystems (GPG_ERR_SOURCE_DEFAULT, (a), (b))
 
 #endif /*GNUPG_COMMON_INIT_H*/
diff --git a/common/util.h b/common/util.h
index 9381f29..5ea7b81 100644
--- a/common/util.h
+++ b/common/util.h
@@ -63,7 +63,6 @@
 #include "../common/utf8conv.h"
 #include "../common/dynload.h"
 
-#include "init.h"
 #include "gettime.h"
 
 /* Redefine asprintf by our estream version which uses our own memory
@@ -113,6 +112,12 @@ typedef char **rl_completion_func_t (const char *, int, int);
 #define xmalloc_clear(a) gcry_xcalloc (1, (a))
 #define xmalloc_secure_clear(a) gcry_xcalloc_secure (1, (a))
 
+/* The default error source of the application.  This is different
+   from GPG_ERR_SOURCE_DEFAULT in that it does not depend on the
+   source file and thus is usable in code shared by applications.
+   Defined by init.c.  */
+extern gpg_err_source_t default_errsource;
+
 /* Convenience function to return a gpg-error code for memory
    allocation failures.  This function makes sure that an error will
    be returned even if accidently ERRNO is not set.  */
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index b0410af..ee85718 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -56,6 +56,7 @@
 #include "ldapserver.h"
 #include "asshelp.h"
 #include "ldap-wrapper.h"
+#include "../common/init.h"
 
 /* The plain Windows version uses the windows service system.  For
    example to start the service you may use "sc start dirmngr".
diff --git a/dirmngr/dirmngr_ldap.c b/dirmngr/dirmngr_ldap.c
index f166f19..2e73493 100644
--- a/dirmngr/dirmngr_ldap.c
+++ b/dirmngr/dirmngr_ldap.c
@@ -57,6 +57,7 @@
 
 #include "i18n.h"
 #include "util.h"
+#include "../common/init.h"
 
 /* With the ldap wrapper, there is no need for the npth_unprotect and leave
    functions; thus we redefine them to nops.  If we are not using the
diff --git a/g10/gpg.c b/g10/gpg.c
index aa37a88..07d5172 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -55,6 +55,7 @@
 #include "gc-opt-flags.h"
 #include "asshelp.h"
 #include "call-dirmngr.h"
+#include "../common/init.h"
 
 #if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
 #define MY_O_BINARY  O_BINARY
diff --git a/g10/gpgv.c b/g10/gpgv.c
index b62ab82..07e4a2e 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -49,6 +49,7 @@
 #include "sysutils.h"
 #include "status.h"
 #include "call-agent.h"
+#include "../common/init.h"
 
 
 enum cmd_and_opt_values {
diff --git a/g13/g13.c b/g13/g13.c
index b33ea61..6fc83b5 100644
--- a/g13/g13.c
+++ b/g13/g13.c
@@ -36,6 +36,7 @@
 #include "sysutils.h"
 #include "gc-opt-flags.h"
 #include "asshelp.h"
+#include "../common/init.h"
 #include "keyblob.h"
 #include "server.h"
 #include "runner.h"
diff --git a/kbx/kbxutil.c b/kbx/kbxutil.c
index 333c286..9762add 100644
--- a/kbx/kbxutil.c
+++ b/kbx/kbxutil.c
@@ -34,11 +34,11 @@
 #include "../common/stringhelp.h"
 #include "../common/utf8conv.h"
 #include "i18n.h"
-#include "init.h"
 #include "keybox-defs.h"
-
+#include "../common/init.h"
 #include <gcrypt.h>
 
+
 enum cmd_and_opt_values {
   aNull = 0,
   oArmor	  = 'a',
diff --git a/kbx/keybox-defs.h b/kbx/keybox-defs.h
index aad07f9..9a29302 100644
--- a/kbx/keybox-defs.h
+++ b/kbx/keybox-defs.h
@@ -21,9 +21,12 @@
 #define KEYBOX_DEFS_H 1
 
 #ifdef GPG_ERR_SOURCE_DEFAULT
-#error GPG_ERR_SOURCE_DEFAULT already defined
+# if GPG_ERR_SOURCE_DEFAULT != GPG_ERR_SOURCE_KEYBOX
+#  error GPG_ERR_SOURCE_DEFAULT already defined
+# endif
+#else
+# define GPG_ERR_SOURCE_DEFAULT  GPG_ERR_SOURCE_KEYBOX
 #endif
-#define GPG_ERR_SOURCE_DEFAULT  GPG_ERR_SOURCE_KEYBOX
 #include <gpg-error.h>
 #define map_assuan_err(a) \
         map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index e8073b7..7e7850d 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -53,6 +53,8 @@
 #include "mkdtemp.h"
 #include "gc-opt-flags.h"
 #include "asshelp.h"
+#include "../common/init.h"
+
 
 enum cmd_and_opt_values
 { aNull = 0,
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index 7164f42..b2d1d2f 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -38,6 +38,8 @@
 #include "sysutils.h"
 #include "gc-opt-flags.h"
 #include "asshelp.h"
+#include "../common/init.h"
+
 
 #ifndef O_BINARY
 #define O_BINARY 0
diff --git a/tools/gpg-check-pattern.c b/tools/gpg-check-pattern.c
index 42a6c62..e6b8b27 100644
--- a/tools/gpg-check-pattern.c
+++ b/tools/gpg-check-pattern.c
@@ -45,9 +45,10 @@
 #include "util.h"
 #include "i18n.h"
 #include "sysutils.h"
+#include "../common/init.h"
 
 
-enum cmd_and_opt_values 
+enum cmd_and_opt_values
 { aNull = 0,
   oVerbose	  = 'v',
   oArmor          = 'a',
@@ -66,12 +67,12 @@ enum cmd_and_opt_values
 
 /* The list of commands and options.  */
 static ARGPARSE_OPTS opts[] = {
-    
+
   { 301, NULL, 0, N_("@Options:\n ") },
 
   { oVerbose, "verbose",   0, "verbose" },
 
-  { oHomedir, "homedir", 2, "@" }, 
+  { oHomedir, "homedir", 2, "@" },
   { oCheck,   "check", 0,  "run only a syntax check on the patternfile" },
   { oNull,    "null", 0,   "input is expected to be null delimited" },
 
@@ -80,7 +81,7 @@ static ARGPARSE_OPTS opts[] = {
 
 
 /* Global options are accessed through the usual OPT structure. */
-static struct 
+static struct
 {
   int verbose;
   const char *homedir;
@@ -99,7 +100,7 @@ enum {
 /* An object to decibe an item of our pattern table. */
 struct pattern_s
 {
-  int type;  
+  int type;
   unsigned int lineno;     /* Line number of the pattern file.  */
   union {
     struct {
@@ -111,7 +112,7 @@ struct pattern_s
          we need for PAT_STRING and we expect only a few regex in a
          patternfile.  It would be a waste of core to have so many
          unused stuff in the table.  */
-      regex_t *regex;      
+      regex_t *regex;
     } r; /*PAT_REGEX*/
   } u;
 };
@@ -141,14 +142,14 @@ my_strusage (int level)
     case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
 
     case 1:
-    case 40: 
+    case 40:
       p =  _("Usage: gpg-check-pattern [options] patternfile (-h for help)\n");
       break;
-    case 41: 
+    case 41:
       p =  _("Syntax: gpg-check-pattern [options] patternfile\n"
              "Check a passphrase given on stdin against the patternfile\n");
     break;
-    
+
     default: p = NULL;
     }
   return p;
@@ -165,7 +166,7 @@ main (int argc, char **argv )
 
   set_strusage (my_strusage);
   gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
-  log_set_prefix ("gpg-check-pattern", 1); 
+  log_set_prefix ("gpg-check-pattern", 1);
 
   /* Make sure that our subsystems are ready.  */
   i18n_init ();
@@ -194,13 +195,13 @@ main (int argc, char **argv )
         case oHomedir: opt.homedir = pargs.r.ret_str; break;
         case oCheck: opt.checkonly = 1; break;
         case oNull: opt.null = 1; break;
-          
+
         default : pargs.err = 2; break;
 	}
     }
   if (log_get_errorcount(0))
     exit (2);
-  
+
   if (argc != 1)
     usage (1);
 
@@ -239,7 +240,7 @@ read_file (const char *fname, size_t *r_length)
   FILE *fp;
   char *buf;
   size_t buflen;
-  
+
   if (!strcmp (fname, "-"))
     {
       size_t nread, bufsize = 0;
@@ -251,7 +252,7 @@ read_file (const char *fname, size_t *r_length)
       buf = NULL;
       buflen = 0;
 #define NCHUNK 8192
-      do 
+      do
         {
           bufsize += NCHUNK;
           if (!buf)
@@ -282,14 +283,14 @@ read_file (const char *fname, size_t *r_length)
           log_error ("can't open `%s': %s\n", fname, strerror (errno));
           return NULL;
         }
-  
+
       if (fstat (fileno(fp), &st))
         {
           log_error ("can't stat `%s': %s\n", fname, strerror (errno));
           fclose (fp);
           return NULL;
         }
-      
+
       buflen = st.st_size;
       buf = xmalloc (buflen+1);
       if (fread (buf, buflen, 1, fp) != 1)
@@ -331,7 +332,7 @@ parse_pattern_file (char *data, size_t datalen)
   pattern_t *array;
   size_t arraysize, arrayidx;
   unsigned int lineno = 0;
-  
+
   /* Estimate the number of entries by counting the non-comment lines.  */
   arraysize = 0;
   p = data;
@@ -456,7 +457,7 @@ process (FILE *fp, pattern_t *patarray)
   int c;
   unsigned long lineno = 0;
   pattern_t *pat;
-  
+
   idx = 0;
   c = 0;
   while (idx < sizeof buffer -1 && c != EOF )
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 7472728..d340c7f 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -37,6 +37,7 @@
 #ifdef HAVE_W32_SYSTEM
 #  include "../common/exechelp.h"
 #endif
+#include "../common/init.h"
 
 
 #define CONTROL_D ('D' - 'A' + 1)
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index da10e4d..cff6e4b 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -26,6 +26,8 @@
 #include "gpgconf.h"
 #include "i18n.h"
 #include "sysutils.h"
+#include "../common/init.h"
+
 
 /* Constants to identify the commands and options. */
 enum cmd_and_opt_values
diff --git a/tools/gpgtar.c b/tools/gpgtar.c
index ace45c4..b6dd5e1 100644
--- a/tools/gpgtar.c
+++ b/tools/gpgtar.c
@@ -37,6 +37,7 @@
 #include "i18n.h"
 #include "sysutils.h"
 #include "../common/openpgpdefs.h"
+#include "../common/init.h"
 
 #include "gpgtar.h"
 
@@ -71,7 +72,7 @@ enum cmd_and_opt_values
 /* The list of commands and options. */
 static ARGPARSE_OPTS opts[] = {
   ARGPARSE_group (300, N_("@Commands:\n ")),
-    
+
   ARGPARSE_c (aEncrypt,   "encrypt", N_("create an archive")),
   ARGPARSE_c (aDecrypt,   "decrypt", N_("extract an archive")),
   ARGPARSE_c (aSign,      "sign",    N_("create a signed archive")),
@@ -146,7 +147,7 @@ set_cmd (enum cmd_and_opt_values *ret_cmd, enum cmd_and_opt_values new_cmd)
     cmd = aSignEncrypt;
   else if (cmd == aEncrypt && new_cmd == aSign)
     cmd = aSignEncrypt;
-  else 
+  else
     {
       log_error (_("conflicting commands\n"));
       exit (2);
@@ -194,7 +195,7 @@ main (int argc, char **argv)
         case oNoVerbose: opt.verbose = 0; break;
         case oFilesFrom: files_from = pargs.r.ret_str; break;
         case oNull: null_names = 1; break;
-          
+
 	case aList:
         case aDecrypt:
         case aEncrypt:
@@ -217,7 +218,7 @@ main (int argc, char **argv)
         default: pargs.err = 2; break;
 	}
     }
-  
+
   if ((files_from && !null_names) || (!files_from && null_names))
     log_error ("--files-from and --null may only be used in conjunction\n");
   if (files_from && strcmp (files_from, "-"))
@@ -324,7 +325,7 @@ write_record (estream_t stream, const void *record)
     }
   else
     err = 0;
-  
+
   return err;
 }
 
@@ -341,9 +342,9 @@ openpgp_message_p (estream_t fp)
   if (ctb != EOF)
     {
       if (es_ungetc (ctb, fp))
-        log_fatal ("error ungetting first byte: %s\n", 
+        log_fatal ("error ungetting first byte: %s\n",
                    gpg_strerror (gpg_error_from_syserror ()));
-      
+
       if ((ctb & 0x80))
         {
           switch ((ctb & 0x40) ? (ctb & 0x3f) : ((ctb>>2)&0xf))
diff --git a/tools/symcryptrun.c b/tools/symcryptrun.c
index c75f637..942fafa 100644
--- a/tools/symcryptrun.c
+++ b/tools/symcryptrun.c
@@ -89,6 +89,7 @@
 #define JNLIB_NEED_LOG_LOGV
 #include "i18n.h"
 #include "../common/util.h"
+#include "../common/init.h"
 #include "mkdtemp.h"
 
 /* FIXME: Bah.  For spwq_secure_free.  */

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

Summary of changes:
 agent/command.c                         |   17 ++++----------
 agent/gpg-agent.c                       |    2 +
 agent/preset-passphrase.c               |    1 +
 agent/protect-tool.c                    |    1 +
 common/Makefile.am                      |    2 +-
 common/asshelp.h                        |   11 +++++++++
 g13/be-truecrypt.c => common/asshelp2.c |   32 ++++++++++++++++++--------
 common/init.c                           |   14 +++++++++++-
 common/init.h                           |   12 ++++++++-
 common/util.h                           |    7 +++++-
 configure.ac                            |    7 ++++++
 dirmngr/dirmngr.c                       |    1 +
 dirmngr/dirmngr_ldap.c                  |    1 +
 g10/gpg.c                               |    1 +
 g10/gpgv.c                              |    1 +
 g13/g13.c                               |    1 +
 kbx/kbxutil.c                           |    4 +-
 kbx/keybox-defs.h                       |    7 ++++-
 scd/scdaemon.c                          |    2 +
 sm/gpgsm.c                              |    2 +
 tools/gpg-check-pattern.c               |   37 ++++++++++++++++---------------
 tools/gpg-connect-agent.c               |    1 +
 tools/gpgconf.c                         |    2 +
 tools/gpgtar.c                          |   15 ++++++------
 tools/symcryptrun.c                     |    1 +
 25 files changed, 126 insertions(+), 56 deletions(-)
 copy g13/be-truecrypt.c => common/asshelp2.c (53%)


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




More information about the Gnupg-commits mailing list