aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-06-16 13:55:01 +0000
committerWerner Koch <[email protected]>2008-06-16 13:55:01 +0000
commit8e37ee4099a33115a21205b1348aaf3fda0ce8ac (patch)
tree7ce3c416b3b2643bf0461750d5b2c77a93714ea2
parent2008-06-13 Marcus Brinkmann <[email protected]> (diff)
downloadgnupg-8e37ee4099a33115a21205b1348aaf3fda0ce8ac.tar.gz
gnupg-8e37ee4099a33115a21205b1348aaf3fda0ce8ac.zip
[W32] Change location of /etc.
Diffstat (limited to '')
-rw-r--r--NEWS3
-rw-r--r--common/ChangeLog5
-rw-r--r--common/homedir.c31
3 files changed, 38 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 4d09f4090..efce67dea 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,9 @@ Noteworthy changes in version 2.0.10 (unreleased)
* [W32] Initialized the socket subsystem for all keyserver helpers.
+ * [W32] The sysconf directory has been moved from a subdirectory of
+ the installation directory to %CSIDL_COMMON_APPDATA%/GNU/etc/gnupg.
+
* New gpg2 command --locate-keys.
* New gpg2 options --with-sig-list and --with-sig-check.
diff --git a/common/ChangeLog b/common/ChangeLog
index dbdcbcf50..5bb986f30 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-16 Werner Koch <[email protected]>
+
+ * homedir.c (w32_commondir): New.
+ (gnupg_sysconfdir): Use it.
+
2008-06-09 Werner Koch <[email protected]>
* b64dec.c: New.
diff --git a/common/homedir.c b/common/homedir.c
index eb1e5025a..616565ef0 100644
--- a/common/homedir.c
+++ b/common/homedir.c
@@ -197,6 +197,35 @@ w32_rootdir (void)
/* Fallback to the hardwired value. */
return GNUPG_LIBEXECDIR;
}
+
+static const char *
+w32_commondir (void)
+{
+ static char *dir;
+
+ if (!dir)
+ {
+ char path[MAX_PATH];
+
+ if (w32_shgetfolderpath (NULL, CSIDL_COMMON_APPDATA,
+ NULL, 0, path) >= 0)
+ {
+ char *tmp = xmalloc (strlen (path) + 4 +1);
+ strcpy (stpcpy (tmp, path), "\\GNU");
+ dir = tmp;
+ /* No auto create of the directory. Either the installer or
+ the admin has to create these directories. */
+ }
+ else
+ {
+ /* Ooops: Not defined - probably an old Windows version.
+ Use the installation directory instead. */
+ dir = xstrdup (w32_rootdir ());
+ }
+ }
+
+ return dir;
+}
#endif /*HAVE_W32_SYSTEM*/
@@ -214,7 +243,7 @@ gnupg_sysconfdir (void)
if (!name)
{
const char *s1, *s2;
- s1 = w32_rootdir ();
+ s1 = w32_commondir ();
s2 = DIRSEP_S "etc" DIRSEP_S "gnupg";
name = xmalloc (strlen (s1) + strlen (s2) + 1);
strcpy (stpcpy (name, s1), s2);