summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-01-15 23:07:11 +0000
committerNick Mathewson <nickm@torproject.org>2009-01-15 23:07:11 +0000
commit87124f54d0bb8489d4067f71a5bf350d9bdffac6 (patch)
tree4563f97e6354af5d743cd4bf3a5ac3dbcbec73c4
parentba7d786ab2a85724057fc691dc0994dffd7f0e82 (diff)
downloadtor-87124f54d0bb8489d4067f71a5bf350d9bdffac6.tar.gz
tor-87124f54d0bb8489d4067f71a5bf350d9bdffac6.zip
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. svn:r18122
-rw-r--r--ChangeLog4
-rw-r--r--configure.in7
-rw-r--r--src/or/config.c8
3 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ab2adc2f18..6d8af9f295 100644
--- 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.
diff --git a/configure.in b/configure.in
index 8cd4428853..42b6dcd923 100644
--- a/configure.in
+++ b/configure.in
@@ -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
diff --git a/src/or/config.c b/src/or/config.c
index 53fc5fb0bc..586245d353 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -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,