[svn] GnuPG - r4683 - in trunk: g10 kbx sm
svn author wk
cvs at cvs.gnupg.org
Tue Jan 29 17:04:59 CET 2008
Author: wk
Date: 2008-01-29 17:04:57 +0100 (Tue, 29 Jan 2008)
New Revision: 4683
Modified:
trunk/g10/ChangeLog
trunk/g10/keydb.c
trunk/kbx/keybox-blob.c
trunk/sm/certlist.c
Log:
Fixed a W32 crash in gpg2 when creating a new keyring.
Typo fixes.
Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog 2008-01-28 08:03:08 UTC (rev 4682)
+++ trunk/g10/ChangeLog 2008-01-29 16:04:57 UTC (rev 4683)
@@ -1,3 +1,8 @@
+2008-01-29 Werner Koch <wk at g10code.com>
+
+ * keydb.c (maybe_create_keyring): Take care of a missing slash.
+ (maybe_create_keyring) [W32]: Also test for forward slash.
+
2008-01-26 Werner Koch <wk at g10code.com>
* card-util.c (get_manufacturer): Add vendor 0004.
Modified: trunk/g10/keydb.c
===================================================================
--- trunk/g10/keydb.c 2008-01-28 08:03:08 UTC (rev 4682)
+++ trunk/g10/keydb.c 2008-01-29 16:04:57 UTC (rev 4683)
@@ -1,5 +1,6 @@
/* keydb.c - key database dispatcher
- * Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2003, 2004, 2005,
+ * 2008 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -82,6 +83,7 @@
int rc;
mode_t oldmask;
char *last_slash_in_filename;
+ int save_slash;
/* A quick test whether the filename already exists. */
if (!access (filename, F_OK))
@@ -98,6 +100,18 @@
tricky auto-creation which is anyway only done for some home
directory name patterns. */
last_slash_in_filename = strrchr (filename, DIRSEP_C);
+#if HAVE_W32_SYSTEM
+ {
+ /* Windows may either have a slash or a backslash. Take care of it. */
+ char *p = strrchr (filename, '/');
+ if (!last_slash_in_filename || p > last_slash_in_filename)
+ last_slash_in_filename = p;
+ }
+#endif /*HAVE_W32_SYSTEM*/
+ if (!last_slash_in_filename)
+ return gpg_error (GPG_ERR_ENOENT); /* No slash at all - should
+ not happen though. */
+ save_slash = *last_slash_in_filename;
*last_slash_in_filename = 0;
if (access(filename, F_OK))
{
@@ -115,9 +129,8 @@
goto leave;
}
}
- *last_slash_in_filename = DIRSEP_C;
+ *last_slash_in_filename = save_slash;
-
/* To avoid races with other instances of gpg trying to create or
update the keyring (it is removed during an update for a short
time), we do the next stuff in a locked state. */
Modified: trunk/kbx/keybox-blob.c
===================================================================
--- trunk/kbx/keybox-blob.c 2008-01-28 08:03:08 UTC (rev 4682)
+++ trunk/kbx/keybox-blob.c 2008-01-29 16:04:57 UTC (rev 4683)
@@ -103,7 +103,7 @@
b16 MD5 checksum (useful for KS syncronisation), we might also want to use
a mac here.
- b4 resevered
+ b4 reserved
*/
Modified: trunk/sm/certlist.c
===================================================================
--- trunk/sm/certlist.c 2008-01-28 08:03:08 UTC (rev 4682)
+++ trunk/sm/certlist.c 2008-01-29 16:04:57 UTC (rev 4683)
@@ -367,7 +367,7 @@
/* We have to ignore ambigious names as long as
there only fault is a bad key usage. This is
required to support encryption and signing
- certifciates of the same subject.
+ certificates of the same subject.
Further we ignore them if they are due to an
identical certificate (which may happen if a
More information about the Gnupg-commits
mailing list