mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
common: Fix creation of Windows socket directories.
* common/homedir.c (w32_try_mkdir): Remove. (standard_homedir): Use gnupg_mkdir instead of w32_try_mkdir. (_gnupg_socketdir_internal): Ditto. -- The w32_try_mkdir was once introduced for WindowsCE and unfortunately at a too brief inspection it looks like it does the utf8->wchar conversion. Which it does not. Thus I obviously never tested the switch to from APPDATA to LOCAL_APPDATA with a non-ascii account name. That might have been due to the use of the very same code for the homedir - but there is other code in gpg to create the homedir; thus a failure here is mostly fixed later. The missing error diagnostic was - and is - on purpose to avoid such error messages due to a race between several running gpg instances. GnuPG-bug-id: 5537
This commit is contained in:
parent
8021fe7670
commit
7d1215cb9c
@ -112,25 +112,6 @@ static const char *w32_rootdir (void);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_W32_SYSTEM
|
|
||||||
static void
|
|
||||||
w32_try_mkdir (const char *dir)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_W32CE_SYSTEM
|
|
||||||
wchar_t *wdir = utf8_to_wchar (dir);
|
|
||||||
if (wdir)
|
|
||||||
{
|
|
||||||
CreateDirectory (wdir, NULL);
|
|
||||||
xfree (wdir);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
CreateDirectory (dir, NULL);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* This is a helper function to load and call a Windows function from
|
/* This is a helper function to load and call a Windows function from
|
||||||
* either of one DLLs. On success an UTF-8 file name is returned.
|
* either of one DLLs. On success an UTF-8 file name is returned.
|
||||||
* ERRNO is _not_ set on error. */
|
* ERRNO is _not_ set on error. */
|
||||||
@ -275,7 +256,7 @@ standard_homedir (void)
|
|||||||
|
|
||||||
/* Try to create the directory if it does not yet exists. */
|
/* Try to create the directory if it does not yet exists. */
|
||||||
if (gnupg_access (dir, F_OK))
|
if (gnupg_access (dir, F_OK))
|
||||||
w32_try_mkdir (dir);
|
gnupg_mkdir (dir, "-rwx");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dir = GNUPG_DEFAULT_HOMEDIR;
|
dir = GNUPG_DEFAULT_HOMEDIR;
|
||||||
@ -860,7 +841,7 @@ _gnupg_socketdir_internal (int skip_checks, unsigned *r_info)
|
|||||||
name = xstrconcat (path, "\\gnupg", NULL);
|
name = xstrconcat (path, "\\gnupg", NULL);
|
||||||
xfree (path);
|
xfree (path);
|
||||||
if (gnupg_access (name, F_OK))
|
if (gnupg_access (name, F_OK))
|
||||||
w32_try_mkdir (name);
|
gnupg_mkdir (name, "-rwx");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user