summaryrefslogtreecommitdiffstats
path: root/common/homedir.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-03-25 13:21:57 +0100
committerWerner Koch <wk@gnupg.org>2022-03-25 13:22:46 +0100
commit0f03bdcd2e611adc8d49d997d3c0b8064d143a0c (patch)
treec711cec92958b6c417e12b73605fddf0f1a4edd4 /common/homedir.c
parenttools:gpgconf: Fix gc_component table. (diff)
downloadgnupg2-0f03bdcd2e611adc8d49d997d3c0b8064d143a0c.tar.xz
gnupg2-0f03bdcd2e611adc8d49d997d3c0b8064d143a0c.zip
common,w32: Fix early home dir creation.
* common/homedir.c (w32_try_mkdir): Remove. (standard_homedir): Call gnupg_mkdir directly. (_gnupg_socketdir_internal): Ditto. -- GnuPG-bug-id: 5895
Diffstat (limited to 'common/homedir.c')
-rw-r--r--common/homedir.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/common/homedir.c b/common/homedir.c
index 174d961e9..260aeb2fa 100644
--- a/common/homedir.c
+++ b/common/homedir.c
@@ -113,24 +113,6 @@ static const char *w32_rootdir (void);
-#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
* either of one DLLs. On success an UTF-8 file name is returned.
* ERRNO is _not_ set on error. */
@@ -277,7 +259,7 @@ standard_homedir (void)
/* Try to create the directory if it does not yet exists. */
if (gnupg_access (dir, F_OK))
- w32_try_mkdir (dir);
+ gnupg_mkdir (dir, "-rwx");
}
else
dir = GNUPG_DEFAULT_HOMEDIR;
@@ -881,7 +863,7 @@ _gnupg_socketdir_internal (int skip_checks, unsigned *r_info)
name = xstrconcat (path, "\\gnupg", NULL);
xfree (path);
if (gnupg_access (name, F_OK))
- w32_try_mkdir (name);
+ gnupg_mkdir (name, "-rwx");
}
else
{