aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-05-05 19:44:22 +0000
committerDavid Shaw <[email protected]>2002-05-05 19:44:22 +0000
commitffc98f20ea862790097abbc87c0b08d6a14bd41b (patch)
tree56210cdb19b2a6490ea7cdd81b604d2ec9f90125
parent2002-05-04 Timo Schulz <[email protected]> (diff)
downloadgnupg-ffc98f20ea862790097abbc87c0b08d6a14bd41b.tar.gz
gnupg-ffc98f20ea862790097abbc87c0b08d6a14bd41b.zip
* import.c (import_one): When merging with a key we already have, don't
let a key conflict (same keyid but different key) stop the import: just skip the bad key and continue. * exec.c (make_tempdir): Under Win32, don't try environment variables for temp directories - GetTempDir tries environment variables internally, and it's better not to second-guess it in case MS adds some sort of temp dir handling to Windows at some point.
-rw-r--r--g10/ChangeLog12
-rw-r--r--g10/exec.c33
-rw-r--r--g10/import.c2
3 files changed, 30 insertions, 17 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 6c5d957d2..52188192d 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,15 @@
+2002-05-05 David Shaw <[email protected]>
+
+ * import.c (import_one): When merging with a key we already have,
+ don't let a key conflict (same keyid but different key) stop the
+ import: just skip the bad key and continue.
+
+ * exec.c (make_tempdir): Under Win32, don't try environment
+ variables for temp directories - GetTempDir tries environment
+ variables internally, and it's better not to second-guess it in
+ case MS adds some sort of temp dir handling to Windows at some
+ point.
+
2002-05-05 Timo Schulz <[email protected]>
* mainproc.c (proc_symkey_enc): Don't ask for a passphrase
diff --git a/g10/exec.c b/g10/exec.c
index dd2c6472d..a51ccde1d 100644
--- a/g10/exec.c
+++ b/g10/exec.c
@@ -67,8 +67,25 @@ static int make_tempdir(struct exec_info *info)
ext=info->binary?"bin":"txt";
/* Make up the temp dir and files in case we need them */
+
if(tmp==NULL)
{
+#if defined (__MINGW32__) || defined (__CYGWIN32__)
+ tmp=m_alloc(256);
+ if(GetTempPath(256,tmp)==0)
+ strcpy(tmp,"c:\\windows\temp");
+ else
+ {
+ int len=strlen(tmp);
+
+ /* GetTempPath may return with \ on the end */
+ while(len>0 && tmp[len-1]=='\\')
+ {
+ tmp[len-1]='\0';
+ len--;
+ }
+ }
+#else /* More unixish systems */
tmp=getenv("TMPDIR");
if(tmp==NULL)
{
@@ -78,26 +95,12 @@ static int make_tempdir(struct exec_info *info)
#ifdef __riscos__
tmp="<Wimp$ScrapDir>.GnuPG";
mkdir(tmp,0700); /* Error checks occur later on */
-#elif defined (__MINGW32__) || defined (__CYGWIN32__)
- tmp=m_alloc(256);
- if(GetTempPath(256,tmp)==0)
- strcpy(tmp,"c:\\temp");
- else
- {
- int len=strlen(tmp);
-
- /* GetTempPath may return with \ on the end */
- while(len>0 && tmp[len-1]=='\\')
- {
- tmp[len-1]='\0';
- len--;
- }
- }
#else
tmp="/tmp";
#endif
}
}
+#endif
}
info->tempdir=m_alloc(strlen(tmp)+strlen(DIRSEP_S)+10+1);
diff --git a/g10/import.c b/g10/import.c
index 9d57685c7..08289fa9f 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -517,13 +517,11 @@ import_one( const char *fname, KBNODE keyblock, int fast,
KEYDB_HANDLE hd;
int n_uids, n_sigs, n_subk;
-
/* Compare the original against the new key; just to be sure nothing
* weird is going on */
if( cmp_public_keys( pk_orig, pk ) ) {
log_error( _("key %08lX: doesn't match our copy\n"),
(ulong)keyid[1]);
- rc = G10ERR_GENERAL;
goto leave;
}