[git] GnuPG - branch, master, updated. gnupg-2.1.0-beta895-6-g982a6e6

by Werner Koch cvs at cvs.gnupg.org
Wed Oct 29 17:29:39 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  982a6e6e55aa0adde2ca0f21216cc31a730c5817 (commit)
       via  0d73a242cb53522669cf712b5ece7d1ed05d003a (commit)
       via  f5592fcff308007322a201c970a6d5e8763c9fe3 (commit)
      from  158fe900183daf745821dea7a70cf1c673cd8de0 (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 982a6e6e55aa0adde2ca0f21216cc31a730c5817
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 29 17:10:03 2014 +0100

    po: Add a new German translation
    
    --
    Also fixed a typo in the docs.

diff --git a/doc/tools.texi b/doc/tools.texi
index 030f269..d9ce81e 100644
--- a/doc/tools.texi
+++ b/doc/tools.texi
@@ -1062,7 +1062,7 @@ machine startup.
 Passphrases set with this utility don't expire unless the
 @option{--forget} option is used to explicitly clear them from the
 cache --- or @command{gpg-agent} is either restarted or reloaded (by
-sending a SIGHUP to it).  Nite that the maximum cache time as set with
+sending a SIGHUP to it).  Note that the maximum cache time as set with
 @option{--max-cache-ttl} is still honored.  It is necessary to allow
 this passphrase presetting by starting @command{gpg-agent} with the
 @option{--allow-preset-passphrase}.
diff --git a/po/de.po b/po/de.po
index ec1ea50..f15de3c 100644
--- a/po/de.po
+++ b/po/de.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg-2.1.0\n"
 "Report-Msgid-Bugs-To: translations at gnupg.org\n"
-"PO-Revision-Date: 2014-10-27 14:12+0100\n"
+"PO-Revision-Date: 2014-10-29 17:05+0100\n"
 "Last-Translator: Werner Koch <wk at gnupg.org>\n"
 "Language-Team: German <de at li.org>\n"
 "Language: de\n"
@@ -963,6 +963,9 @@ msgstr "Schlüsselwort ist zu lang"
 msgid "missing argument"
 msgstr "Fehlendes Argument"
 
+msgid "invalid argument"
+msgstr "Ungültiges Argument"
+
 msgid "invalid command"
 msgstr "Ungültiger Befehl"
 
@@ -980,6 +983,10 @@ msgid "missing argument for option \"%.50s\"\n"
 msgstr "Fehlendes Argument für Option \"%.50s\"\n"
 
 #, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "Ungültiges Argument für Option \"%.50s\"\n"
+
+#, c-format
 msgid "option \"%.50s\" does not expect an argument\n"
 msgstr "Option \"%.50s\" erwartet kein Argument\n"
 

commit 0d73a242cb53522669cf712b5ece7d1ed05d003a
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 29 17:07:51 2014 +0100

    common: Check option arguments for a valid range.
    
    * common/argparse.h (ARGPARSE_INVALID_ARG): New.
    * common/argparse.c: Include limits h and errno.h.
    (initialize): Add error strings for new error constant.
    (set_opt_arg): Add range checking.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/argparse.c b/common/argparse.c
index c713bf6..844c170 100644
--- a/common/argparse.c
+++ b/common/argparse.c
@@ -39,6 +39,8 @@
 #include <ctype.h>
 #include <string.h>
 #include <stdarg.h>
+#include <limits.h>
+#include <errno.h>
 
 #include "libjnlib-config.h"
 #include "mischelp.h"
@@ -262,6 +264,8 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
             s = _("keyword too long");
           else if ( arg->r_opt == ARGPARSE_MISSING_ARG )
             s = _("missing argument");
+          else if ( arg->r_opt == ARGPARSE_INVALID_ARG )
+            s = _("invalid argument");
           else if ( arg->r_opt == ARGPARSE_INVALID_COMMAND )
             s = _("invalid command");
           else if ( arg->r_opt == ARGPARSE_INVALID_ALIAS )
@@ -278,6 +282,8 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
 
           if ( arg->r_opt == ARGPARSE_MISSING_ARG )
             jnlib_log_error (_("missing argument for option \"%.50s\"\n"), s);
+          else if ( arg->r_opt == ARGPARSE_INVALID_ARG )
+            jnlib_log_error (_("invalid argument for option \"%.50s\"\n"), s);
           else if ( arg->r_opt == ARGPARSE_UNEXPECTED_ARG )
             jnlib_log_error (_("option \"%.50s\" does not expect an "
                                "argument\n"), s );
@@ -588,7 +594,7 @@ optfile_parse (FILE *fp, const char *filename, unsigned *lineno,
                             p[strlen(p)-1] = 0;
                         }
                       if (!set_opt_arg (arg, opts[idx].flags, p))
-			jnlib_free(buffer);
+                        jnlib_free(buffer);
                     }
                 }
               break;
@@ -1032,23 +1038,54 @@ arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts)
 }
 
 
-
+/* Returns: -1 on error, 0 for an integer type and 1 for a non integer
+   type argument.  */
 static int
-set_opt_arg(ARGPARSE_ARGS *arg, unsigned flags, char *s)
+set_opt_arg (ARGPARSE_ARGS *arg, unsigned flags, char *s)
 {
   int base = (flags & ARGPARSE_OPT_PREFIX)? 0 : 10;
+  long l;
 
   switch ( (arg->r_type = (flags & ARGPARSE_TYPE_MASK)) )
     {
-    case ARGPARSE_TYPE_INT:
-      arg->r.ret_int = (int)strtol(s,NULL,base);
-      return 0;
     case ARGPARSE_TYPE_LONG:
-      arg->r.ret_long= strtol(s,NULL,base);
+    case ARGPARSE_TYPE_INT:
+      errno = 0;
+      l = strtol (s, NULL, base);
+      if ((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE)
+        {
+          arg->r_opt = ARGPARSE_INVALID_ARG;
+          return -1;
+        }
+      if (arg->r_type == ARGPARSE_TYPE_LONG)
+        arg->r.ret_long = l;
+      else if ( (l < 0 && l < INT_MIN) || l > INT_MAX )
+        {
+          arg->r_opt = ARGPARSE_INVALID_ARG;
+          return -1;
+        }
+      else
+        arg->r.ret_int = (int)l;
       return 0;
+
     case ARGPARSE_TYPE_ULONG:
-      arg->r.ret_ulong= strtoul(s,NULL,base);
+      while (isascii (*s) && isspace(*s))
+        s++;
+      if (*s == '-')
+        {
+          arg->r.ret_ulong = 0;
+          arg->r_opt = ARGPARSE_INVALID_ARG;
+          return -1;
+        }
+      errno = 0;
+      arg->r.ret_ulong = strtoul (s, NULL, base);
+      if (arg->r.ret_ulong == ULONG_MAX && errno == ERANGE)
+        {
+          arg->r_opt = ARGPARSE_INVALID_ARG;
+          return -1;
+        }
       return 0;
+
     case ARGPARSE_TYPE_STRING:
     default:
       arg->r.ret_str = s;
diff --git a/common/argparse.h b/common/argparse.h
index 29c7b62..471cf74 100644
--- a/common/argparse.h
+++ b/common/argparse.h
@@ -190,6 +190,7 @@ typedef struct
 #define ARGPARSE_AMBIGUOUS_COMMAND (-9)
 #define ARGPARSE_INVALID_ALIAS     (-10)
 #define ARGPARSE_OUT_OF_CORE       (-11)
+#define ARGPARSE_INVALID_ARG       (-12)
 
 
 int arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts);

commit f5592fcff308007322a201c970a6d5e8763c9fe3
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 29 15:41:28 2014 +0100

    Fix stdint.h problem for Apple.
    
    * gl/stdint_.h [__APPLE__]: Include hack.
    --
    
    Patch suggested by Patrick Brunschwig.

diff --git a/gl/stdint_.h b/gl/stdint_.h
index 19577e7..1118e8d 100644
--- a/gl/stdint_.h
+++ b/gl/stdint_.h
@@ -55,6 +55,13 @@
 # include @ABSOLUTE_STDINT_H@
 #endif
 
+#ifdef __APPLE__
+  /* Apple's implementation of <stdint.h> is bugy; we therefore use
+     the source definitions.  */
+# include <_types/_intmax_t.h>
+# include <_types/_uintmax_t.h>
+#endif
+
 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
    MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but

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

Summary of changes:
 common/argparse.c |   53 +++++++++++++++++++++++++++++++++++++++++++++--------
 common/argparse.h |    1 +
 doc/tools.texi    |    2 +-
 gl/stdint_.h      |    7 +++++++
 po/de.po          |    9 ++++++++-
 5 files changed, 62 insertions(+), 10 deletions(-)


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




More information about the Gnupg-commits mailing list