[git] Pinentry - branch, master, updated. pinentry-0.9.2-19-g9fdb055

by Neal H. Walfield cvs at cvs.gnupg.org
Sat May 16 13:37:59 CEST 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 "The standard pinentry collection".

The branch, master has been updated
       via  9fdb05554b5fc9c6f6621d606ccf21c038c7b6cb (commit)
       via  222866894993041ceaca3ca4ef33373ab78bfdff (commit)
       via  3d97b18ba928677550a8f7eaa938551aad42dacf (commit)
       via  21e83f422667e431c1283b9ae3356fded3523e50 (commit)
      from  4549998627ee04e74f8d1c94aef55e3ed17f14d9 (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 9fdb05554b5fc9c6f6621d606ccf21c038c7b6cb
Author: Neal H. Walfield <neal at gnu.org>
Date:   Sat May 16 13:37:46 2015 +0200

    Don't emit the LC_CTYPE-not-set warning more than once.
    
    * pinentry/pinentry.c (lc_ctype_unknown_warning): New variable.
    (pinentry_utf8_to_local): Only emit the LC_CTYPE warning if
    lc_ctype_unknown_warning is not set.  After emitted such a warning,
    set lc_ctype_unknown_warning.
    (pinentry_local_to_utf8): Likewise.

diff --git a/pinentry/pinentry.c b/pinentry/pinentry.c
index eb70ae7..78ac137 100644
--- a/pinentry/pinentry.c
+++ b/pinentry/pinentry.c
@@ -111,6 +111,8 @@ struct pinentry pinentry =
   };
 
 

+static int lc_ctype_unknown_warning = 0;
+
 #if defined FALLBACK_CURSES || defined PINENTRY_CURSES || defined PINENTRY_GTK
 char *
 pinentry_utf8_to_local (const char *lc_ctype, const char *text)
@@ -129,8 +131,12 @@ pinentry_utf8_to_local (const char *lc_ctype, const char *text)
      string.  */
   if (!lc_ctype)
     {
-      fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n",
-               this_pgmname);
+      if (! lc_ctype_unknown_warning)
+	{
+	  fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n",
+		   this_pgmname);
+	  lc_ctype_unknown_warning = 1;
+	}
       return strdup (text);
     }
 
@@ -191,8 +197,12 @@ pinentry_local_to_utf8 (char *lc_ctype, char *text, int secure)
      string.  */
   if (!lc_ctype)
     {
-      fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n",
-               this_pgmname);
+      if (! lc_ctype_unknown_warning)
+	{
+	  fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n",
+		   this_pgmname);
+	  lc_ctype_unknown_warning = 1;
+	}
       output_buf = secure? secmem_malloc (input_len) : malloc (input_len);
       if (output_buf)
         strcpy (output_buf, input);

commit 222866894993041ceaca3ca4ef33373ab78bfdff
Author: Neal H. Walfield <neal at gnu.org>
Date:   Sat May 16 13:28:16 2015 +0200

    curses: Use default-ok and default-cancel if set.
    
    * pinentry/pinentry-curses.c (default_notok): New macro.
    (MAKE_BUTTON): Also check if default variant is set.

diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c
index 79628fc..73eb05f 100644
--- a/pinentry/pinentry-curses.c
+++ b/pinentry/pinentry-curses.c
@@ -257,13 +257,23 @@ dialog_create (pinentry_t pinentry, dialog_t dialog)
   COPY_OUT (error);
   COPY_OUT (prompt);
 
+  /* There is no pinentry->default_notok.  Map it to
+     pinentry->notok.  */
+#define default_notok notok
 #define MAKE_BUTTON(which,default)					\
   do									\
     {									\
       char *new = NULL;							\
-      if (pinentry->which)						\
+      if (pinentry->default_##which || pinentry->which)			\
         {								\
-          int len = strlen (pinentry->which);				\
+	  int len;							\
+	  char *msg;							\
+									\
+	  msg = pinentry->which;					\
+	  if (! msg)							\
+	    msg = pinentry->default_##which;				\
+          len = strlen (msg);						\
+									\
           new = malloc (len + 3);				       	\
 	  if (!new)							\
 	    {								\
@@ -272,7 +282,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog)
 	      goto out;							\
 	    }								\
 	  new[0] = '<';							\
-	  memcpy (&new[1], pinentry->which, len);			\
+	  memcpy (&new[1], msg, len);					\
           new[len + 1] = '>';						\
 	  new[len + 2] = '\0';						\
         }								\

commit 3d97b18ba928677550a8f7eaa938551aad42dacf
Author: Neal H. Walfield <neal at gnu.org>
Date:   Sat May 16 13:10:41 2015 +0200

    curses: Don't show the notok button in pin entry mode.
    
    * pinentry/pinentry-curses.c (dialog_create): Don't show the notok
    button in pin entry mode.

diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c
index 65a5a67..79628fc 100644
--- a/pinentry/pinentry-curses.c
+++ b/pinentry/pinentry-curses.c
@@ -1,5 +1,5 @@
 /* pinentry-curses.c - A secure curses dialog for PIN entry, library version
-   Copyright (C) 2002 g10 Code GmbH
+   Copyright (C) 2002, 2015 g10 Code GmbH
 
    This file is part of PINENTRY.
 
@@ -535,7 +535,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog)
       move (dialog->ok_y, dialog->ok_x);
       addstr (dialog->ok);
 
-      if (dialog->notok)
+      if (! pinentry->pin && dialog->notok)
 	{
 	  dialog->notok_y = ypos;
 	  /* Calculating the left edge of the middle button, rounding up.  */

commit 21e83f422667e431c1283b9ae3356fded3523e50
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Wed May 13 16:36:26 2015 -0400

    Avoid implicit declaration of function addnwstr.
    
    * pinentry/pinentry-curses.c [HAVE_NCURSESW]: Include <ncursesw/curses.h>.
    [! HAVE_NCURSESW]: Only include <curses.h> in this case.
    
    --
    
    When built with libncursesw, we see this problem:
    
    pinentry-curses.c:440:8: warning: implicit declaration of function ‘addnwstr’ [-Wimplicit-function-declaration]
            ADDCH (start[i]);
            ^

diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c
index 60fd9da..65a5a67 100644
--- a/pinentry/pinentry-curses.c
+++ b/pinentry/pinentry-curses.c
@@ -22,7 +22,11 @@
 #include <config.h>
 #endif
 #include <assert.h>
+#ifdef HAVE_NCURSESW
+#include <ncursesw/curses.h>
+#else
 #include <curses.h>
+#endif
 #include <signal.h>
 #include <fcntl.h>
 #include <unistd.h>

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

Summary of changes:
 pinentry/pinentry-curses.c | 24 +++++++++++++++++++-----
 pinentry/pinentry.c        | 18 ++++++++++++++----
 2 files changed, 33 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
The standard pinentry collection
http://git.gnupg.org




More information about the Gnupg-commits mailing list