From nobody@FreeBSD.org  Sat Apr 26 18:45:12 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D1F6B106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 26 Apr 2008 18:45:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id C246D8FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 26 Apr 2008 18:45:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m3QIifcY050403
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 26 Apr 2008 18:44:41 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m3QIifYF050399;
	Sat, 26 Apr 2008 18:44:41 GMT
	(envelope-from nobody)
Message-Id: <200804261844.m3QIifYF050399@www.freebsd.org>
Date: Sat, 26 Apr 2008 18:44:41 GMT
From: Yarodin <yarodin@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [UPDATE] security/pinentry to 0.7.5 and fix security/pinentry-gtk2
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         123116
>Category:       ports
>Synopsis:       [UPDATE] security/pinentry to 0.7.5 and fix security/pinentry-gtk2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    rafan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 26 18:50:01 UTC 2008
>Closed-Date:    Tue Sep 23 14:19:34 UTC 2008
>Last-Modified:  Thu Nov 20 08:00:11 UTC 2008
>Originator:     Yarodin
>Release:        6.3-p2
>Organization:
>Environment:
>Description:
[UPDATE] security/pinentry to 0.7.5 and fix security/pinentry-gtk2
>How-To-Repeat:

>Fix:
How to apply:
1) Put patch-pinentry.txt to /usr/ports/security/

2) cd /usr/ports/security/ && patch -E -p <patch-pinentry.txt && find /usr/ports/security/pinentry/ -type f -name "*.orig" -exec rm -f {} \;

3) Put patch-pinentry-gtk2.txt to /usr/ports/security/

4) cd /usr/ports/security/ && patch -E -p <patch-pinentry-gtk2.txt && find /usr/ports/security/pinentry-gtk2/ -type f -name "*.orig" -exec rm -f {} \;



Patch attached with submission follows:

--- pinentry.orig/Makefile	2008-04-19 23:53:28.000000000 +0600
+++ pinentry/Makefile		2008-04-27 00:24:26.000000000 +0600
@@ -6,14 +6,13 @@
 #
 
 PORTNAME=	pinentry
-PORTVERSION=	0.7.3
-PORTREVISION=	1
+PORTVERSION=	0.7.5
 CATEGORIES=	security
 MASTER_SITES=	${MASTER_SITE_GNUPG}
 MASTER_SITE_SUBDIR=	pinentry
 
 MAINTAINER=	lofi@freebsd.org
-COMMENT?=	A collection of simple PIN or passphrase entry dialogs
+COMMENT=	A collection of simple PIN or passphrase entry dialogs
 
 LIB_DEPENDS=	gcrypt.15:${PORTSDIR}/security/libgcrypt \
 		ksba.17:${PORTSDIR}/security/libksba
@@ -37,7 +36,6 @@
 pre-configure:
 	@${REINPLACE_CMD} -e "s@-lpthread@${PTHREAD_LIBS}@g" \
 		${WRKSRC}/acinclude.m4 ${WRKSRC}/configure
-
 .else
 CONFIGURE_ARGS+=--disable-pinentry-qt
 PLIST_SUB+=	WITH_QT="@comment "
@@ -46,7 +44,7 @@
 .if defined(PINENTRY_GTK)
 USE_GNOME+=	gtk12
 PLIST_SUB+=	WITH_GTK=""
-CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include
+CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
 .else
 CONFIGURE_ARGS+=--disable-pinentry-gtk
 PLIST_SUB+=	WITH_GTK="@comment "
@@ -55,7 +53,7 @@
 .if defined(PINENTRY_GTK2)
 USE_GNOME+=	gtk20
 PLIST_SUB+=	WITH_GTK2=""
-CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include
+CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
 .else
 CONFIGURE_ARGS+=--disable-pinentry-gtk2
 PLIST_SUB+=	WITH_GTK2="@comment "
--- pinentry.orig/distinfo	2007-10-30 13:39:28.000000000 +0500
+++ pinentry/distinfo		2008-04-26 18:22:22.000000000 +0600
@@ -1,3 +1,3 @@
-MD5 (pinentry-0.7.3.tar.gz) = 59282278405a8264b39ea28678c78cf4
-SHA256 (pinentry-0.7.3.tar.gz) = df1d2c47d501031b4c995cee3e464e62578b8959559121a207a8046e2cd9a5bf
-SIZE (pinentry-0.7.3.tar.gz) = 417000
+MD5 (pinentry-0.7.5.tar.gz) = ca492afbbb59cd19f1c875533f18b269
+SHA256 (pinentry-0.7.5.tar.gz) = cb269ac058793b2df343a12a65e3402abc4b68503e105b12e4ca903d8d8e3172
+SIZE (pinentry-0.7.5.tar.gz) = 422801
--- pinentry.orig/files/patch-curses-utf	1970-01-01 05:00:00.000000000 +0500
+++ pinentry/files/patch-curses-utf		2008-02-17 22:30:14.000000000 +0500
@@ -0,0 +1,40 @@
+--- m4/curses.m4.orig	2005-09-08 21:25:01.000000000 +0600
++++ m4/curses.m4	2008-02-17 22:23:32.000000000 +0500
+@@ -28,7 +28,7 @@
+   AC_ARG_ENABLE(ncurses,    [  --disable-ncurses       don't prefer -lncurses over -lcurses],
+               , enable_ncurses=yes)
+   if test "$enable_ncurses" = yes; then
+-    AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")
++    AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncursesw")
+     if test "$LIBNCURSES"; then
+       # Use ncurses header files instead of the ordinary ones, if possible;
+       # is there a better way of doing this, that avoids looking in specific
+--- pinentry/pinentry-curses.c.orig	2007-06-15 17:36:39.000000000 +0600
++++ pinentry/pinentry-curses.c		2008-02-17 22:28:40.000000000 +0500
+@@ -587,6 +587,13 @@
+   SCREEN *screen = 0;
+   int done = 0;
+   char *pin_utf8;
++  char *old_ctype = NULL;
++
++  if (pinentry->lc_ctype)
++    {
++      old_ctype = strdup (setlocale (LC_CTYPE, NULL));
++      setlocale (LC_CTYPE, pinentry->lc_ctype);
++    }
+ 
+   /* Open the desired terminal if necessary.  */
+   if (tty_name)
+@@ -739,6 +746,12 @@
+   if (screen)
+     delscreen (screen);
+ 
++  if (old_ctype)
++    {
++      setlocale (LC_CTYPE, old_ctype);
++      free(old_ctype);
++    }
++
+   if (ttyfi)
+     fclose (ttyfi);
+   if (ttyfo)
--- pinentry.orig/files/patch-glib.2.16	2008-04-05 23:36:26.000000000 +0600
+++ pinentry/files/patch-glib.2.16	1970-01-01 05:00:00.000000000 +0500
@@ -1,58 +0,0 @@
---- gtk+-2/gtksecentry.c-	2008-03-26 17:28:13.000000000 +0200
-+++ gtk+-2/gtksecentry.c	2008-03-26 17:32:51.000000000 +0200
-@@ -270,7 +270,7 @@ gboolean g_use_secure_mem = FALSE;
- 
- 
- gpointer
--g_malloc(gulong size)
-+g_malloc(gsize size)
- {
-     gpointer p;
- 
-@@ -282,13 +282,13 @@ g_malloc(gulong size)
-     else
- 	p = (gpointer) malloc(size);
-     if (!p)
--	g_error("could not allocate %ld bytes", size);
-+	g_error("could not allocate %zd bytes", size);
- 
-     return p;
- }
- 
- gpointer
--g_malloc0(gulong size)
-+g_malloc0(gsize size)
- {
-     gpointer p;
- 
-@@ -302,13 +302,13 @@ g_malloc0(gulong size)
-     } else
- 	p = (gpointer) calloc(size, 1);
-     if (!p)
--	g_error("could not allocate %ld bytes", size);
-+	g_error("could not allocate %zd bytes", size);
- 
-     return p;
- }
- 
- gpointer
--g_realloc(gpointer mem, gulong size)
-+g_realloc(gpointer mem, gsize size)
- {
-     gpointer p;
- 
-@@ -3210,11 +3210,11 @@ static gint
- get_cursor_time(GtkSecureEntry * entry)
- {
-     GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(entry));
--    gint time;
-+    gint _time;
- 
--    g_object_get(settings, "gtk-cursor-blink-time", &time, NULL);
-+    g_object_get(settings, "gtk-cursor-blink-time", &_time, NULL);
- 
--    return time;
-+    return _time;
- }
- 
- static void
--- pinentry.orig/files/patch-gtk2-gmem	1970-01-01 05:00:00.000000000 +0500
+++ pinentry/files/patch-gtk2-gmem	2008-04-26 22:53:58.000000000 +0600
@@ -0,0 +1,145 @@
+--- gtk+-2/gtksecentry.c.orig	2007-11-19 16:20:50.000000000 +0500
++++ gtk+-2/gtksecentry.c	2008-04-26 22:52:13.000000000 +0600
+@@ -256,7 +256,7 @@
+ 
+ static GtkWidgetClass *parent_class = NULL;
+ 
+-gboolean g_use_secure_mem = FALSE;
++extern gboolean g_use_secure_mem;
+ 
+ #  define g_sec_new(type, count)	  \
+       ((type *) g_sec_malloc ((unsigned) sizeof (type) * (count)))
+@@ -269,85 +269,6 @@
+ 				} while(0)
+ 
+ 
+-gpointer
+-g_malloc(gulong size)
+-{
+-    gpointer p;
+-
+-    if (size == 0)
+-	return NULL;
+-
+-    if (g_use_secure_mem)
+-	p = (gpointer) secmem_malloc(size);
+-    else
+-	p = (gpointer) malloc(size);
+-    if (!p)
+-	g_error("could not allocate %ld bytes", size);
+-
+-    return p;
+-}
+-
+-gpointer
+-g_malloc0(gulong size)
+-{
+-    gpointer p;
+-
+-    if (size == 0)
+-	return NULL;
+-
+-    if (g_use_secure_mem) {
+-	p = (gpointer) secmem_malloc(size);
+-	if (p)
+-	    memset(p, 0, size);
+-    } else
+-	p = (gpointer) calloc(size, 1);
+-    if (!p)
+-	g_error("could not allocate %ld bytes", size);
+-
+-    return p;
+-}
+-
+-gpointer
+-g_realloc(gpointer mem, gulong size)
+-{
+-    gpointer p;
+-
+-    if (size == 0) {
+-	g_free(mem);
+-
+-	return NULL;
+-    }
+-
+-    if (!mem) {
+-	if (g_use_secure_mem)
+-	    p = (gpointer) secmem_malloc(size);
+-	else
+-	    p = (gpointer) malloc(size);
+-    } else {
+-	if (g_use_secure_mem) {
+-	    g_assert(m_is_secure(mem));
+-	    p = (gpointer) secmem_realloc(mem, size);
+-	} else
+-	    p = (gpointer) realloc(mem, size);
+-    }
+-
+-    if (!p)
+-	g_error("could not reallocate %lu bytes", (gulong) size);
+-
+-    return p;
+-}
+-
+-void
+-g_free(gpointer mem)
+-{
+-    if (mem) {
+-	if (m_is_secure(mem))
+-	    secmem_free(mem);
+-	else
+-	    free(mem);
+-    }
+-}
+-
+ GType
+ gtk_secure_entry_get_type(void)
+ {
+--- gtk+-2/pinentry-gtk-2.c.orig	2007-11-19 16:44:07.000000000 +0500
++++ gtk+-2/pinentry-gtk-2.c		2008-04-26 22:52:13.000000000 +0600
+@@ -39,6 +39,7 @@
+ 
+ #include "gtksecentry.h"
+ #include "pinentry.h"
++#include "memory.h"
+ 
+ #ifdef FALLBACK_CURSES
+ #include "pinentry-curses.h"
+@@ -469,12 +470,36 @@
+ 
+ pinentry_cmd_handler_t pinentry_cmd_handler = gtk_cmd_handler;
+ 
++gboolean g_use_secure_mem = FALSE;
++
++static gpointer
++_malloc(gsize size) {
++  return g_use_secure_mem ? secmem_malloc(size) : malloc(size);
++}
++
++static gpointer
++_realloc(gpointer p, gsize size) {
++  return m_is_secure(p) ? secmem_realloc(p, size) : realloc(p, size);
++}
++
++static void
++_free(gpointer p) {
++  m_is_secure(p) ? secmem_free(p) : free(p);
++}
+ 
+ int
+ main (int argc, char *argv[])
+ {
+   pinentry_init (PGMNAME);
+-    
++
++  GMemVTable mem_vtable = {
++    _malloc,
++    _realloc,
++    _free
++  };
++
++  g_mem_set_vtable (&mem_vtable);
++  
+ #ifdef FALLBACK_CURSES
+   if (pinentry_have_display (argc, argv))
+     gtk_init (&argc, &argv);
--- pinentry.orig/files/patch-more_sec_mem	1970-01-01 05:00:00.000000000 +0500
+++ pinentry/files/patch-more_sec_mem		2008-02-17 22:20:40.000000000 +0500
@@ -0,0 +1,11 @@
+--- secmem/secmem.c.orig	2007-07-03 05:49:48.000000000 +0600
++++ secmem/secmem.c		2008-02-17 22:19:50.000000000 +0500
+@@ -85,7 +85,7 @@
+ #  define MAP_ANONYMOUS MAP_ANON
+ #endif
+ 
+-#define DEFAULT_POOLSIZE 16384
++#define DEFAULT_POOLSIZE 16384*4
+ 
+ typedef struct memblock_struct MEMBLOCK;
+ struct memblock_struct {


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->lofi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Apr 26 18:50:07 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123116 

From: Yar Odin <yarodin@gmail.com>
To: bug-followup@freebsd.org,
 yarodin@gmail.com
Cc:  
Subject: Re: ports/123116: [UPDATE] security/pinentry to 0.7.5 and fix security/pinentry-gtk2
Date: Sun, 27 Apr 2008 01:02:10 +0600

 --Boundary-00=_yw3EIk2zvaHiAaB
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Patch for security/pinentry-gtk2
 
 --Boundary-00=_yw3EIk2zvaHiAaB
 Content-Type: text/plain;
   charset="us-ascii";
   name="patch-pinentry-gtk2.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="patch-pinentry-gtk2.txt"
 
 --- pinentry-gtk2.orig/Makefile	2008-04-27 00:22:21.000000000 +0600
 +++ pinentry-gtk2/Makefile	2008-04-27 00:22:27.000000000 +0600
 @@ -9,7 +9,7 @@
  
  COMMENT=	GTK+ 2.0 version of the GnuPG password dialog
  
 -CONFLICTS=	pinentry-[0-9]*
 +CONFLICTS=	pinentry-[0-9]* gtk-qt-engine-[0-9]*
  
  PINENTRY_GTK2=	yes
  
 
 --Boundary-00=_yw3EIk2zvaHiAaB--
Responsible-Changed-From-To: lofi->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Sep 7 00:37:20 UTC 2008 
Responsible-Changed-Why:  
Maintainer was reset. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123116 
Responsible-Changed-From-To: freebsd-ports-bugs->rafan 
Responsible-Changed-By: rafan 
Responsible-Changed-When: Sun Sep 7 11:44:43 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123116 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Tue Sep 23 14:19:33 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123116 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/123116: commit references a PR
Date: Tue, 23 Sep 2008 14:19:34 +0000 (UTC)

 rafan       2008-09-23 14:19:30 UTC
 
   FreeBSD ports repository
 
   Modified files:
     security/pinentry    Makefile distinfo 
     security/pinentry/files patch-glib.2.16 
   Added files:
     security/pinentry/files patch-curses-utf patch-gtk2-gmem 
                             patch-more_sec_mem 
   Log:
   - Update to 0.7.5
   
   PR:             ports/123116
   Submitted by:   Yarodin <yarodin at gmail.com>
   
   Revision  Changes    Path
   1.44      +3 -5      ports/security/pinentry/Makefile
   1.10      +3 -3      ports/security/pinentry/distinfo
   1.1       +40 -0     ports/security/pinentry/files/patch-curses-utf (new)
   1.2       +0 -58     ports/security/pinentry/files/patch-glib.2.16
   1.1       +145 -0    ports/security/pinentry/files/patch-gtk2-gmem (new)
   1.1       +11 -0     ports/security/pinentry/files/patch-more_sec_mem (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: "Jason E. Hale" <bsdkaffee@gmail.com>
To: bug-followup@freebsd.org
Cc: yarodin@gmail.com,
 rafan@freebsd.org
Subject: Re: ports/123116: [UPDATE] security/pinentry to 0.7.5 and fix security/pinentry-gtk2
Date: Thu, 20 Nov 2008 02:01:47 -0500

 It looks like security/pinentry/files/patch-glib.2.16 did not get removed with 
 the update.  It is currently a 0B file.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/123116: commit references a PR
Date: Thu, 20 Nov 2008 07:59:23 +0000 (UTC)

 rafan       2008-11-20 07:59:07 UTC
 
   FreeBSD ports repository
 
   Removed files:
     security/pinentry/files patch-glib.2.16 
   Log:
   - Remove 0 size patch
   
   PR:             ports/123116
   Reported by:    Jason E. Hale <bsdkaffee at gmail.com>
   
   Revision  Changes    Path
   1.3       +0 -0      ports/security/pinentry/files/patch-glib.2.16 (dead)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
