]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
This patch changes the default location where config and data files
authorNick Mathewson <nickm@torproject.org>
Thu, 15 Jan 2009 23:07:11 +0000 (23:07 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 15 Jan 2009 23:07:11 +0000 (23:07 +0000)
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.

svn:r18122

ChangeLog
configure.in
src/or/config.c

index ab2adc2f182bd8165a9af3d34a69b051a7d4f066..6d8af9f29554ba4e770a3dd3595abe0947931ece 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,10 @@ Changes in version 0.2.1.11-alpha - 2009-01-??
       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.
index 8cd44288533135c4efcd0eebd619709f9d3dfb9e..42b6dcd923325da6360646534f4bffb8f54bd846 100644 (file)
@@ -96,6 +96,13 @@ fi
 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
index 53fc5fb0bcbb69ef97153194ccfa67845a5face2..586245d35362b9b0911f7dceddc19bf584465451 100644 (file)
@@ -3735,8 +3735,12 @@ get_windows_conf_root(void)
   /* 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,