[svn] GnuPG - r4784 - in trunk: . common

svn author wk cvs at cvs.gnupg.org
Mon Jun 16 15:55:03 CEST 2008


Author: wk
Date: 2008-06-16 15:55:01 +0200 (Mon, 16 Jun 2008)
New Revision: 4784

Modified:
   trunk/NEWS
   trunk/common/ChangeLog
   trunk/common/homedir.c
Log:
[W32] Change location of /etc.


Modified: trunk/common/ChangeLog
===================================================================
--- trunk/common/ChangeLog	2008-06-13 22:10:22 UTC (rev 4783)
+++ trunk/common/ChangeLog	2008-06-16 13:55:01 UTC (rev 4784)
@@ -1,3 +1,8 @@
+2008-06-16  Werner Koch  <wk at g10code.com>
+
+	* homedir.c (w32_commondir): New.
+	(gnupg_sysconfdir): Use it.
+
 2008-06-09  Werner Koch  <wk at g10code.com>
 
 	* b64dec.c: New.

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2008-06-13 22:10:22 UTC (rev 4783)
+++ trunk/NEWS	2008-06-16 13:55:01 UTC (rev 4784)
@@ -9,6 +9,9 @@
 
  * [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.

Modified: trunk/common/homedir.c
===================================================================
--- trunk/common/homedir.c	2008-06-13 22:10:22 UTC (rev 4783)
+++ trunk/common/homedir.c	2008-06-16 13:55:01 UTC (rev 4784)
@@ -197,6 +197,35 @@
   /* 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 @@
   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);




More information about the Gnupg-commits mailing list