[Gpg4win-commits] r1591 - in trunk: . patches patches/dirmngr-1.1.0 src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 14 20:13:52 CET 2010


Author: werner
Date: 2010-12-14 20:13:52 +0100 (Tue, 14 Dec 2010)
New Revision: 1591

Added:
   trunk/patches/dirmngr-1.1.0/
   trunk/patches/dirmngr-1.1.0/01-mmap.patch
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/src/potomo
Log:
Fix bug 1010


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-12-14 10:28:39 UTC (rev 1590)
+++ trunk/ChangeLog	2010-12-14 19:13:52 UTC (rev 1591)
@@ -1,3 +1,8 @@
+2010-12-14  Werner Koch  <wk at g10code.com>
+
+	* patches/dirmngr-1.1.0/01-mmap.patch: New.
+	* Makefile.am (EXTRA_DIST): Add patch.
+
 2010-11-21  Colin Leroy  <colin at colino.net>
 
 	* packages/packages.current: Update Claws Mail and plugins to 3.7.7.

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2010-12-14 10:28:39 UTC (rev 1590)
+++ trunk/Makefile.am	2010-12-14 19:13:52 UTC (rev 1591)
@@ -66,6 +66,7 @@
 	patches/gnupg2-2.0.16/05-err-codes.patch \
 	patches/gnupg2-2.0.16/06-reread-agent.patch \
 	patches/dirmngr-1.0.3/01-ldaphttp.patch \
+	patches/dirmngr-1.1.0/01-mmap.patch \
 	patches/gpgol-0.9.91/01-gpgme.patch \
         patches/gpa-0.9.0/01-title-prop.patch \
 	patches/libetpan-0.57/01-gnutls_compat.patch \

Added: trunk/patches/dirmngr-1.1.0/01-mmap.patch
===================================================================
--- trunk/patches/dirmngr-1.1.0/01-mmap.patch	2010-12-14 10:28:39 UTC (rev 1590)
+++ trunk/patches/dirmngr-1.1.0/01-mmap.patch	2010-12-14 19:13:52 UTC (rev 1591)
@@ -0,0 +1,54 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+src/
+2010-12-14  Werner Koch  <wk at g10code.com>
+
+	* cdb.h (struct cdb) [W32]: Add field CDB_MAPPING.
+	* cdblib.c (cdb_init) [W32]: Save mapping handle.
+	(cdb_free) [W32]: Don't leak the mapping handle from cdb_init by
+	using the saved one.  Fixes bug#1010.
+
+
+--- src/cdblib.c	(revision 345)
++++ src/cdblib.c	(working copy)
+@@ -138,6 +138,7 @@
+   mem = (unsigned char *)MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0, 0);
+   if (!mem)
+     return -1;
++  cdbp->cdb_mapping = hMapping;
+ #else
+   mem = (unsigned char*)mmap(NULL, fsize, PROT_READ, MAP_SHARED, fd, 0);
+   if (mem == MAP_FAILED)
+@@ -174,13 +175,9 @@
+ {
+   if (cdbp->cdb_mem) {
+ #ifdef _WIN32
+-    HANDLE hFile, hMapping;
+-#endif
+-#ifdef _WIN32
+-    hFile = (HANDLE) _get_osfhandle(cdbp->cdb_fd);
+-    hMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
+     UnmapViewOfFile((void*) cdbp->cdb_mem);
+-    CloseHandle(hMapping);
++    CloseHandle (cdbp->cdb_mapping);
++    cdbp->cdb_mapping = NULL;
+ #else
+     munmap((void*)cdbp->cdb_mem, cdbp->cdb_fsize);
+ #endif /* _WIN32 */
+
+
+--- src/cdb.h	(revision 345)
++++ src/cdb.h	(working copy)
+@@ -20,6 +20,9 @@
+ struct cdb {
+   int cdb_fd;			/* file descriptor */
+   /* private members */
++#ifdef HAVE_W32_SYSTEM
++  void *cdb_mapping;            /* Mapping handle.  */
++#endif
+   cdbi_t cdb_fsize;		/* datafile size */
+   const unsigned char *cdb_mem; /* mmap'ed file memory */
+   cdbi_t cdb_vpos, cdb_vlen;	/* found data */
+


Property changes on: trunk/patches/dirmngr-1.1.0/01-mmap.patch
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/src/potomo
===================================================================
--- trunk/src/potomo	2010-12-14 10:28:39 UTC (rev 1590)
+++ trunk/src/potomo	2010-12-14 19:13:52 UTC (rev 1591)
@@ -2,9 +2,9 @@
 # potomo - Convert a .po file to an utf-8 encoded .mo file.
 #
 # This script is used to create the mo files for applications using
-# the simplegetext implementaion as used by GnuPG and some other
+# the simple gettext implementation as used by GnuPG and some other
 # tools.  That gettext can only cope with utf-8 encoded mo files; thus
-# we make this sure while creating the mo.  A vonversion is not done
+# we make this sure while creating the mo.  A conversion is not done
 # if the source file does not exist or if it is not newer than the mo
 # file. 
 



More information about the Gpg4win-commits mailing list