1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg,w32: Fix gnupg_remove.

* common/sysutils.c (map_w32_to_errno): New.
(gnupg_w32_set_errno): New.
(gnupg_remove) [w32]: Set ERRNO
--

To support Unicode gnupg_remove was changed to use DeleteFileW and not
properly tested because the code was alreadt used in Windows CE.
However, ERRNO was not set and thus Dirmngr failed due to

 if (!gnupg_remove (fname))
   log_info (_("removed stale te[...] file '%s'\n"), fname);
 else if (errno != ENOENT)
   {
     err = gpg_error_from_syserror ();
     log_error (_("problem remov[...] file '%s': %s\n"),
                fname, gpg_strerror (err));
     goto leave;
   }

GnuPG-bug-id: 5230
(cherry picked from commit b6967d3191)
This commit is contained in:
Werner Koch 2021-01-11 14:19:06 +01:00
parent cf0f67199f
commit 3901c1a8c5
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 132 additions and 1 deletions

View file

@ -437,6 +437,8 @@ static int never_lock;
#ifdef HAVE_DOSISH_SYSTEM
/* FIXME: For use in GnuPG this can be replaced by
* gnupg_w32_set_errno. */
static int
map_w32_to_errno (DWORD w32_err)
{