[or-cvs] r18122: {tor} This patch changes the default location where config and dat (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Thu Jan 15 23:07:12 UTC 2009


Author: nickm
Date: 2009-01-15 18:07:11 -0500 (Thu, 15 Jan 2009)
New Revision: 18122

Modified:
   tor/trunk/ChangeLog
   tor/trunk/configure.in
   tor/trunk/src/or/config.c
Log:
This patch changes the default location where config and data files
are stored when the --enable-local-appdata option is configured.  This
changes the Windows path from %APPDATA% to a host local
%USERPROFILE%\Local Settings\Application Data\ path (aka,
LOCAL_APPDATA).

Patch from coderman.



Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2009-01-15 22:00:15 UTC (rev 18121)
+++ tor/trunk/ChangeLog	2009-01-15 23:07:11 UTC (rev 18122)
@@ -12,6 +12,10 @@
       897 and others.
     - Make setting ServerDNSRandomizeCase to 0 actually work.  Bugfix
       for bug 905.  Bugfix on 0.2.1.7-alpha.
+    - Add a new --enable-local-appdata configuration switch to change
+      the default location of the datadir on win32 from APPDATA to
+      LOCAL_APPDATA.  In the future, we should migrate entirely.  Patch
+      from coderman.
 
   o Minor bugfixes:
     - Make outbound DNS packets respect the OutboundBindAddress setting.

Modified: tor/trunk/configure.in
===================================================================
--- tor/trunk/configure.in	2009-01-15 22:00:15 UTC (rev 18121)
+++ tor/trunk/configure.in	2009-01-15 23:07:11 UTC (rev 18122)
@@ -96,6 +96,13 @@
 AC_ARG_ENABLE(gcc-warnings,
      AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings))
 
+AC_ARG_ENABLE(local-appdata,
+   AS_HELP_STRING(--enable-local-appdata, default to host local application data paths on Windows))
+if test "$enable_local_appdata" = "yes"; then
+  AC_DEFINE(ENABLE_LOCAL_APPDATA, 1,
+            [Defined if we default to host local appdata paths on Windows])
+fi
+
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_MAKE_SET

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2009-01-15 22:00:15 UTC (rev 18121)
+++ tor/trunk/src/or/config.c	2009-01-15 23:07:11 UTC (rev 18122)
@@ -3735,8 +3735,12 @@
   /* Find X:\documents and settings\username\application data\ .
    * We would use SHGetSpecialFolder path, but that wasn't added until IE4.
    */
-  if (!SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA,
-                                            &idl))) {
+#ifdef ENABLE_LOCAL_APPDATA
+#define APPDATA_PATH CSIDL_LOCAL_APPDATA
+#else
+#define APPDATA_PATH CSIDL_APPDATA
+#endif
+  if (!SUCCEEDED(SHGetSpecialFolderLocation(NULL, APPDATA_PATH, &idl))) {
     GetCurrentDirectory(MAX_PATH, path);
     is_set = 1;
     log_warn(LD_CONFIG,



More information about the tor-commits mailing list